|
Hello,
I would like to have a BO record which sets its value to 1 whenever processed (without necessarily writing 1 to VAL), then back to 0.
It's part of PLC-based motion control IOC. The database should allow moving the motor to saved waypoint positions; it looks like this:
record(ao, "AbsPos") {
field(EGU, "step")
}
record(ao, "Waypoint1") {
field(EGU, "step")
}
record(longout, "WaypointIdx") {
field(FLNK, "SelectAbsPos")
}
record(sel, "SelectAbsPos") {
field(SELM, "Specified")
field(NVL, "WaypointIdx")
field(INPA, "AbsPos")
field(INPB, "Waypoint1")
field(FLNK, "DesiredPos")
}
record(ao, "DesiredPos") {
field(EGU, "step")
# field(OUT, "OUTLINK") link to PLC
field(DOL, "SelectAbsPos")
field(OMSL, "closed_loop")
field(FLNK, "MoveToPos PP")
}
The processing chain is WaypointIdx -> SelectAbsPos -> DesiredPos -> MoveToPos
MoveToPos is a BO which tells the PLC to start motion, and it must have HIGH field set to non-zero. I'm having a problem triggering its processing in a way that its value becomes 1.
I tried this:
Record(bo, "MoveToPos) {
# field(OUT, "OUTLINK") link to PLC
field(DOL, "1")
field(OMSL, "closed_loop")
field(HIGH, "1)
}
I expected that processing the record would set VAL to 1, then back to 0 after 1 second. It works only once; subsequent processing does not switch value back to 1. Writing 1 into VAL works as expected. Is this the correct functionality of the BO record?
I ended up with the following construct, which provides the desired functionality, but I don't much like having a record which only holds a constant value to be put into the BO. Is there a better way to do this?
record(ao, "DesiredPos") {
field(EGU, "step")
# field(OUT, "OUTLINK")
field(DOL, "SelectAbsPos")
field(OMSL, "closed_loop")
field(FLNK, "Constant1")
}
record(longout, "Constant1") {
field(VAL, "1")
field(OUT, "MoveToPos PP")
}
record(bo, "MoveToPos") {
field(HIGH, "1")
}
Thanks,
Karel
Karel Majer | Senior software developer
Phone: +420 266 051 514
E-mail: karel.majer at eli-beams.eu
|
|
ELI Beamlines Facility|The Extreme Light Infrastructure ERIC
Za Radnicí 835, 252 41 Dolní Břežany, The Czech Republic
www.eli-beams.eu
|
|