Hi,
sorry for the following lengthy expose to a problem regarding completion
notification.
I have several positioners (multiple axes devices) controlled via several
get/set pairs of ai/ao records per axis with a StreamDevice device support
(DTYP=streams).
Sometimes, the underlying "hardware" protocol offers only a set method without
completion notification for a given axis. The StreamDevice protocol file
section then has s.th. like
setX {
out "AxisAbs 1 %f";
in "AxisAbs 1 movement_started";
}
Here the device emits the "AxisAbs 1 movement_started" as mere confirmation of
the control order. There is no further reply indicating completion of the
positioning operation.
While moving, the position can be monitored in an event based manner, i.e.
a .SCAN="I/O Intr" ai record
| record (ai, "$(IOCNAME):stage:$(AXIS)")
| {
| field (SCAN, "I/O Intr")
| field (DTYP, "stream")
| field (INP, "@protocol_file.proto get$(AXIS) PORT")
| }
based on a protocol
getX {
@init {
out "registerVC 2 IOC:stage:X Joe";
in "Joe Crds %f %*f %*f %*f %*f %*f %*f ";
}
in "Joe Crds %f %*f %*f %*f %*f %*f %*f ";
}
Here, the device's capability to do registration based position monitoring is
gluelessly linked with EPICS' monitor concept. The out command issued during
init causes the device to send position update messages ("Joe Crds ...") as
if you posted a monitor on one (or several) EPICS process variable(s).
The six floats thrown away in the "in" part of this protocol ("%*f") are
typically read by a further set of (six) .SCAN="I/O Intr" ai records,
offering completely seperated control information and linear rescaling of the
raw values by means of the respective .ASLO and .AOFF fields. With the
same .ASLo/.AOFF rescaling applied to the corresponding ao record of a given
axis, this rescaling is transparent to the user/client.
In addition, there is a state variable ("ready") available with the same
subscription based event notification mechanism,
| record (bi, "$(IOCNAME):stage:ready")
| {
| field (SCAN, "I/O Intr")
| field (DTYP, "stream")
| field (INP, "@protocol_file.proto getReady PORT")
| field (ZNAM, "not ready")
| field (ONAM, "ready")
| }
with protocol
getReady {
@init {
out "registerVC 32 IOC:stage:ready Joe";
in "Joe %{not ready|ready}";
}
in "Joe %{not ready|ready}";
}
Now if I want to use the sscan record to operate on these positioners, it
expects them to do be capable of ca_put_callback()-based completion
notification. However, e.g. travelling from 0.0 to 10.0 takes ~13 s
| sheim@txm1:~$ camonitor TXM1CL:micos:ready TXM1CL:micos:ZCOARSE &
| [1] 7781
! TXM1CL:micos:ready 2007-08-31 02:09:33.733498 ready
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:11.154559 0 LOLO MAJOR
| sheim@txm1:~$ caput -c TXM1CL:micos:setZCOARSE 10
| Old : TXM1CL:micos:setZCOARSE 0
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.735909 0.022526
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.757608 0.039484
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.779335 0.061448
! TXM1CL:micos:ready 2007-08-31 02:09:44.800247 not ready
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.803464 0.087914
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.828070 0.120282
| New : TXM1CL:micos:setZCOARSE 10
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.849671 0.164518
| sheim@txm1:~$
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.870746 0.205295
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.891945 0.251714
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.914267 0.303483
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:44.935013 0.36009
| [...]
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:45.658592 4.99687
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:45.680585 5.21379
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:45.703397 5.42912
| [...]
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:46.587214 9.98588
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:46.609446 9.99538
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:46.631317 9.99971
! TXM1CL:micos:ZCOARSE 2007-08-31 02:09:46.653736 10
! TXM1CL:micos:ready 2007-08-31 02:09:47.107716 ready
but the caput -c above returns "immediately". Furtermore, the device is
possibly late to give out the "not ready" notification (cf. trace above), but
guarantees to fire "ready" only after (all) movements finished.
While I read the slides on completion notification in Scans.ppt and tried to
understand the busy record, I still wonder what might be the best approach to
the problem. Essentially, I need a way to use StreamDevice based devices not
offering a synchronous setPosition command as positioners with the sscan
record.
Any clues?
-Stefan