beautypg.com

Appendix a.2. store unpacked bit data, Appendix a.2, O appendix a.2 – FieldServer Optomux FS-8700-17 User Manual

Page 16

background image

FS-8700-17_Opto22.doc Manual

Page 14 of 24

FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com

Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: [email protected]

Appendix A.2. Store Unpacked Bit Data

By default the OPTO22 devices returns 16 position states when digital data is read ( eg. READ STATUS). The Optomux driver writes the data as one 16 bit unsigned
integer to one data element of the Data Array specified. (packed bit format.), e.g. if the 1

st

and 5

th

inputs were on and all others were off the driver would write

the value 17 to the first element of the Data Array.

The Driver can be instructed to unpact this data into separate bit states using the Opto22_Format paramater. When this parameter is specified as Bit, each
module position’s state is written to a consecutive Data Array element.starting at Data_Array_Offset. The number of elements that are written is determined by
the Length parameter and a maximum of 16 elements will be written.

Map_Descriptor_Name

, Data_Array_Name

, Data_Array_Offset

, Function

, Node_Name

, Length

, Scan_Interval

, Opto22_Function

, Opto22_Format

DEVICE77_STAT

, DISC_INPUTS

, 0

, Rdbc

, DEV77

, 16

, 5.0s

, READ STATUS

, Bit

Appendix A.3. Expose Command Response/Completion Status

Use of the DA_Byte_Name parameter allows the driver to expose the response/status generated when the command was executed. The response/status values
indicate the success/failure of the command based either on the driver’s ability to complete the command OR on the ack/nack returned by the device.

Map_Descriptor_Name , Data_Array_Name

, Data_Array_Offset , Function

, Node_Name , Length

, Scan_Interval , Opto22_Function

, DA_Byte_Name

DEVICE77_STAT

, DISC_INPUTS

, 0

, Rdbc

, DEV77

, 1

, 5.0s

, READ STATUS

, RESPONSE_ARR

The length is set to 16 to
reserve 16 data array
elements for this Map
Descriptor.

This is how the
driver is instructed
to unpack the digital
data.

By virtue of defining the DA_Byte_Name parameter the driver will now store
a response status each time the poll is executed.

The response / status code will be stored in the data array called
REPONSE_ARR. One element of the array located at Data_Array_Offset will be
used. The data array’s data format should at least be able to store a byte of
data as response/status codes range from 0-255.