Carl Lionberger, CALionberger@lbl.gov
Device support has been provided for ai, ao, longin, longout, stringin,
stringout and waveform record types. These seven device support
modules provide the ability to read and write double,
long, and string types respectively (waveform
uses type of waveform record; input and waveform records read and
output records write.
The device type "vxWorks Variable" is defined in the sdr source file
"devSup.ascii.". The name of the VxWorks symbol desired is
obtained one of two ways, depending on whether the LINK field is set to
CONSTANT or INST_IO.
For example: "ppp:fred;sss" refers to the vxWorks global
variable "_fred".
The intention is that the prefix would refer to the IOC and the suffix would
distinguish references within an IOC. Suffixes and prefixes are optional.
[ "*" ] name [ "[" index "]" ]
For example:
fred" refers to the value of the vxWorks global
variable "_fred"
*fred" refers to the value whose address is the
value of the _fred"
fred[1]" assumes that the vxWorks global
variable "_fred" is an array and refers to its second
element
*fred[1]" assumes that the vxWorks
global variable "_fred" contains the address of an array
and refers to the second element of the array
Note that the interpretation of the "*" operator is not
the same as in C. For example, "fred" and
"fred[0]" are the same and "*fred" and
"fred[0]" are not the same. In this version of the
driver, the value of the pointer is read at run-time rather than
initialisation.
Finally note that strings are not treated any differently from longs or
doubles in that the address returned from this routine is simply the
address of the data. "fred" is the entire string.
"fred[2]" starts at the third character of the string.
Symbol table lookup is performed only at record init time; the
resulting pointer is stored in the DPVT field. (The indirection, if
present, is resolved at run time.) If the symbol is not found an
illegal NAME field error is posted and DPVT is set to NULL. Processing
consists of reading or writing the VAL field using the pointer, unless
the pointer is NULL, in which case the device support module exits
immediately. No value conversion is performed; it is assumed that the
symbol refers to a variable of the same type as the VAL field. String
operations are restricted to the 40 character size of the string record
VAL fields and null termination is enforced.
No exclusion or interlocking with other code using the referenced variable is provided. This must be dealt with on a case-by-case basis. Typically the VxWorks code will have to poll for its input variables (from"write" records) and EPICS will poll the code's output variables with suitable SCAN values (from "read" records).