Driver Manual |
4.4.6 Map Descriptor Example 3 – Handling Bits.
This example shows how to read 1 couple of bits from a data table rather than reading a whole byte. The bits can cross byte boundaries. Here we read 2 bits from table %T starting at bit 8. This is most useful when writing to the PLC in cases where you want to turn one particular bit on or off.
Map_Descriptor_Name, Data_Array_Name, Data_Array_Offset, Function, Scan_Interval, node_name, Address, Length, Data_Type, Format
Read_DI | , DA_T | , 100 | , rdbc , 2.0s | , | , 2 | , %T | , Bit |
The format parameter tells the driver to override the default data type and to specifically read bits. In this case the bit states are stored in the data array in two separate elements at DA_T[100] and DA_T[101]
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 (408)
Visit our website: www.fieldserver.com