| Page 9 of 32 |
4.4.4.Map Descriptor Example 1 – Read
This example illustrates how to read data from the DataPort.
Some basics first: The Map Descriptor is connected to a node by means of the node name and a node definition provides a connection to a port. Thus this Map Descriptor is connected to a port via its node. The FieldServer will use that port to send this poll. The poll will be generated every 5 seconds in this example.
The values extracted from the response will be stored in the array called DA_DISPLAY. Ensure that it is suitable format for storing number – FLOAT is suggested. The driver stores the value of the 1st element at offset 1, the 2nd element at offset 2 ….and the driver stores the number of
table elements whose values have been successfully stored at offset zero.
//Client Side Map Descriptors
Map Descriptors |
|
|
|
|
|
|
|
|
Map_Descriptor_Name, | Data_Array_Name, | Data_Array_Offset, | Function, | Node_Name, | Length, | Scan_Interval | ||
Read_Table_Md | , | Da_Display , | 0 | , | Rdbc , | FAN01 , | 100 , | 5.0s |
|
|
|
|
|
|
|
|
|
Responses get stored in this Data
Array. Table element x gets stored at offset x, where x is a non- zero integer.
Offset zero is used by the driver to report how many value were stored.
The driver generates a read poll continuously.
The Node_Name connects the Map Descriptor to a Node definition.
The length is set to a number big enough to contain all the table’s variables.
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: support@fieldserver.com