Previous | Contents | Index |
Use the read data point and write data point functions to read data from and write data to a device in a device independent way.
Table 3-4 lists the read and write data point functions available through the BASEstar Open (CLI) interface and BASEstar Open (API) interface.
Interface | Function Name |
---|---|
CLI | GET VALUE DATA_POINT |
PUT VALUE DATA_POINT | |
API | bstr_data_point_get_value |
bstr_data_point_put_value |
Example 3-4 shows examples of creating a device data point using the CREATE DEVICE_DATA_POINT command.
Example 3-4 DEVICE_DATA_POINT CREATE Command |
---|
BSTR> CREATE DEVICE_DATA_POINT /plc_2_15/p1 \ -DATATYPE UNSIGNED_16 \ -UPDATE_POLICY SOLICITED \ -ACCESS_POLICY ALWAYS \ -DEVICE_ACCESS RDWR \ -VMD_NAME plc_2_15 \ -VAR_NAME p1 \ -VAR_CLASS UNNAMED BSTR> CREATE DEVICE_DATA_POINT /plc_3/p1 \ -DATATYPE INTEGER_16 \ -UPDATE_POLICY SOLICITED \ -ACCESS_POLICY ALWAYS \ -DEVICE_ACCESS RDWR \ -VMD_NAME plc_3 \ -VAR_NAME p1 \ -VAR_CLASS UNNAMED BSTR> CREATE DEVICE_DATA_POINT /plc_5_40/p1 \ -DATATYPE BIT \ -UPDATE_POLICY SOLICITED \ -ACCESS_POLICY ALWAYS \ -DEVICE_ACCESS RDWR \ -VMD_NAME plc_5_40 \ -VAR_NAME p1 \ -VAR_CLASS UNNAMED BSTR> CREATE DEVICE_DATA_POINT /plc_5_40/p2 \ -DATATYPE WORD_ARRAY_10 \ -UPDATE_POLICY SOLICITED \ -ACCESS_POLICY ALWAYS \ -DEVICE_ACCESS RDWR \ -VMD_NAME plc_5_40 \ -VAR_NAME p2 \ -VAR_CLASS UNNAMED BSTR> CREATE DEVICE_DATA_POINT /plc_5_40/p3 \ -DATATYPE PLC_5_COUNTER \ -UPDATE_POLICY SOLICITED \ -ACCESS_POLICY ALWAYS \ -DEVICE_ACCESS RDWR \ -VMD_NAME plc_5_40 \ -VAR_NAME p3 \ -VAR_CLASS UNNAMED BSTR> CREATE DEVICE_DATA_POINT /slc_5_04/p1 \ -DATATYPE INTEGER_16 \ -UPDATE_POLICY SOLICITED \ -ACCESS_POLICY ALWAYS \ -DEVICE_ACCESS RDWR \ -VMD_NAME slc_5_04 \ -VAR_NAME p1 \ -VAR_CLASS UNNAMED |
Example 3-5 shows the information displayed when you enter the GET VALUE DATA_POINT command.
Example 3-5 DATA_POINT GET VALUE Output |
---|
BSTR> GET VALUE DATA_POINT /plc_5_40/p1 20 BSTR> GET VALUE DATA_POINT /plc_5_40/p2 array[10] of INTEGER_16 [ 0]: 0 [ 1]: 0 [ 2]: 0 [ 3]: 0 [ 4]: 0 [ 5]: 0 [ 6]: 0 [ 7]: 0 [ 8]: 0 [ 9]: 0 BSTR> GET VALUE DATA_POINT /plc_5_40/p3 structure PLC_5_COUNTER { CONTROL: 0 PRE: 0 ACC: 0 } |
Example 3-6 shows the information displayed when you enter the PUT VALUE DATA_POINT command.
Example 3-6 DATA_POINT PUT VALUE Output |
---|
BSTR> PUT VALUE DATA_POINT /plc_5_40/p1 (Bit) : 1 BSTR> PUT VALUE DATA_POINT /plc_5_40/p2 array[10] of INTEGER_16 [ 0]: (Integer 16) : 1 [ 1]: (Integer 16) : 2 [ 2]: (Integer 16) : 3 [ 3]: (Integer 16) : 4 [ 4]: (Integer 16) : 5 [ 5]: (Integer 16) : 6 [ 6]: (Integer 16) : 7 [ 7]: (Integer 16) : 8 [ 8]: (Integer 16) : 9 [ 9]: (Integer 16) : 10 |
Previous | Next | Contents | Index |