Subsections
All labCA calls take a PV argument identifying
the EPICS process variables the user wants to connect to.
PVs are plain ASCII strings. labCA is capable of handling
multiple PVs in a single call; they are simply passed as a
column vector:
pvs = [ 'PVa'; 'b'; 'anotherone' ]
Because matlab doesn't allow the rows of
a string vector to be of different size, the matlab
wrapper expects a cell- array of strings:
pvs = { 'PVa'; 'b'; 'anotherone' }
All channel access activities for the PVs
passed to a single labCA call are batched together and
completion of the batch is awaited before returning from
the labCA call. Consider the following example:6
lcaPut( 'trigger', 1 ) \\
data=lcaGet( ['sensor1' ; 'sens2'] );
- It is guaranteed that writing the “trigger”
completes (on the CA server) prior to reading the
sensors.7
- Reading the two sensors is done in “parallel” —
the exact order is unspecified. After the command sequence
(successfully) completes, all the data are valid.
Timestamp Format
Channel access timestamps are “POSIX struct timespec”
compliant, i.e. they provide the number of nanoseconds
expired since 00:00:00 UTC, January 1, 1970. labCA
translates the timestamps into complex numbers
with the seconds (tv_sec member) and nanoseconds
(tv_nsec) in the real and imaginary parts, respectively.
This makes it easy to extract the seconds while still maintaining
full accuracy.
Footnotes
- 6
-
In matlab, the square brackets (“[]”) must be replaced
by curly braces (“{}”).
- 7
- If the remote sensors have finite
processing time, the subsequent CA read may still
get old data — depending on the device support
etc.; this is beyond the scope of channel access, however.