| Page 24 of 51 |
|
|
5.3.9.Map Descriptor Example 5 – Serving Objects which have a time field
Some Data Objects have a time field associated with them, e.g. Frozen Analog Input with Time of Freeze (Object = 31, Variation 3). When this object is served the Server must provide the value of the frozen input as well as the time of the freeze. The driver extracts the object’s value from the Primary Data Array. The object’s time is extracted from a secondary Data Array. If a secondary Data Array is not specified, the driver serves the current FieldServer time in UTC (Universal Coordinated Time). If a secondary Data Array is specified, the driver extracts the value and multiplies it by 1000 before serving it. Thus the Secondary Data Array is assumed to contain the number of seconds since Jan 1 1970 and not the number of milliseconds.
//Server Side Map Descriptors
Map_Descriptors |
|
|
|
|
|
|
|
|
|
Map_Descriptor_Name | ,Data_Array_Name | ,Data_Array_Offset | ,Function | ,Node_Name | ,Address | ,Length | ,dnpDataType | ,dnpDataVari | ,DA_Byte_Name |
Serve_FrozenAI_vari3 | ,DA_AI | ,0 | ,Server | ,Node_A | ,0 | ,100 | ,31 | ,3 | ,DA_AI_TIMES |
|
|
|
|
|
|
|
|
|
|
5.3.10.Map Descriptor Example 6 – Unsolicited Messages
A driver configured as an active Server can send unsolicited messages (not responses to a poll) to a remote Client when data changes.
In this example, 100 elements of the Data Array called DA_AI are monitored. If the data in any one of these elements is updated (even if the value doesn’t change) then the driver generates a once off write message to the remote node called Node_A.
Subscriptions |
|
|
|
Data_Array_Name | ,Data_Array_Offset | ,Node_Name | ,COV_Deadband |
DA_Class0_bin | ,1 | ,Node_A | ,1 |
DA_Class0_bin | ,3 | ,Node_A | ,1 |
DA_Class0_ana | ,0 | ,Node_A | ,2.0 |
|
|
|
|
The function 30 tells the driver to send the message as an unsolicited message.
//Client Side Map Descriptors
Map_Descriptors |
|
|
|
|
|
|
|
|
|
Map_Descriptor_Name ,Data_Array_Name ,Data_Array_Offset | ,Function | ,Node_Name | ,Address | ,Length | ,dnpDataType | ,dnpDataVari | ,DnpFunction | ||
EventMsg1 | ,DA_AI | ,0 | ,Wrbx | ,Node_A | ,0 | ,100 | ,30 | ,0 | ,130 |
This is how you specify the Data Array that will contain the time (in seconds). The driver uses the value found at the offset specified by Data_Array_Offset. You should use a Data Array whose format is UINT32 as only that format provides sufficient precision to store the big numbers required to specify the number of seconds since Jan 1, 1970.
Example: 1095135207 == Aprox Sept 14th 2004
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