Hi all,
We use a Beckhoff TwinCAT controller to move 3 independent axes, and it is integrated into EPICS via the s7 driver. Now I am trying to add the soft motor record support on top of that. Everything works fine except for a problem with the .DMOV
field. The .DINP filed is linked to the DONE flag of the TwinCAT controller.
When initiating the motion from “s7” EPICS PVs, the soft motor DMOV field behaves as expected, however when the move is initiated by the motor record I get the 1/0/1/0/1 pulse form the DMOV instead of the desired 1/0/1 (of course any user script
monitoring the DMOV would capture that additional pulse). I notice that the first 1/0/1 pulse happens before the DONE flag changes to 0, and the remaining /0/1 part is in accordance with the processing of the DONE flag (as expected via ca link).
I suspect that the reason is in the way the Twincat motion is implemented - one has to set the position first and then execute the “GO” command. I handle this with a sequence record that is linked to the OUT filed of the motor record. Could the
fact that there is a delay between the time of writing to the motor record .VAL field and the time that the “GO” command is issued on the PLC and the DONE flag processes, cause the initial 1/0/1 pulse on the motor record .DMOV field (thinking there is no move
- analog to sending it to the current position)?
And if this is the case, is there a “timeout” I could set for that? Or any other ideas how to overcome this issue?
——
record(motor, "$(P):$(AXIS)") {
field(DESC, "$(AXIS) soft motor")
field(DTYP, "Soft Channel")
field(OUT, "$(P):$(AXIS)_SETANDGO PP")
field(RDBL, "$(P):$(AXIS)_RBVCALC NPP")
field(MRES, "1")
field(RRES, "1")
field(URIP, "Yes")
field(PREC, "2")
field(EGU, "mm")
field(TWV, "1")
field(DINP, "$(P):$(AXIS)_DONE NPP")
field(RTRY, "0")
field(NTM, "NO")
}
record(seq, "$(P):$(AXIS)_SETANDGO") {
field(DOL1, "$(P):$(AXIS).DVAL")
field(LNK1, "$(P):$(AXIS)_SETPOS PP")
field(DOL2, "1")
field(LNK2, "$(P):$(AXIS)_EXECUTE PP")
}
---------
Thanks,
Tine
--
Dr. Tine Celcer
Controls Section
Group Leader Integration and Support – Photon Science
Group Leader a.i. Integration and Support – Large Research Facilities