Page 19 of 32 |
Appendix A.3. Map Descriptor Length Explained
The Length parameter is specified as part of the Map Descriptor.
Client Reads:
The length means: “The number of table variable’s whose values are to be stored when the response is received.” If you do not know the length of the table in advance, set the length to a larger number (e.g. 100). The driver will process the response; if the table contains more than 100 elements then some data will be discarded.
Server:
The length parameter is used when the server returns a value that is a string. The length is used to tell the driver how many characters to extract from consecutive array location to form the response string. When the server returns a value that is a number, state or time the length should always be 1.
Appendix A.4. How the Client stores the states/values of the Table Variables.
Appendix A.4.1. | Discrete States |
When a Carrier DataPort device reports the state of a table variable which has a discrete state, it reports the state as a keyword like on/off. This driver converts the keywords to facilitate reading by other devices.
The driver is programmed to recognize the keywords listed below. The user can add keywords by specifying additional information in the configuration file.
State Word | Value | State Word | Value | State Word | Value |
CLEAN | 1 | ABNORMAL | 1 | OPEN | 1 |
DIRTY | 0 | NORMAL | 0 | CLOSE | 0 |
HEAT | 1 | LOCAL | 0 | CLOSED | 0 |
COOL | 0 | REMOTE | 1 | ALARM | 1 |
ON | 1 | LOCAL R | 0 |
|
|
|
|
|
|
|
|
OFF | 0 | RUNNING | 1 |
|
|
|
|
|
|
|
|
If the driver doesn’t recognize the state word, it stores the characters of the state word as decimal values based on their ASCII value. the number of characters stored is dependent on the length parameter.
For example, say the driver responds, reporting a variable to be a state ‘INCREDIBLE’. If the length parameter of the polling Map Descriptor is 1 then the driver stores the first character of the word incredible; by storing a value of 73 (An uppercase ‘I’ is the seventy third character in the ASCII alphabet.).
The driver recognizes discrete state words by checking the 1st character of the value field. If it is a
Unrecognized Discrete State Words
If the driver does not recognize the discrete state word that has been used it will report the following error - CarrDP:#24 Err. MD=<MapDesc1> discrete state word not recognized.
The unrecognized discrete word can be found by extracting 10 characters from the line starting at the 10th character. Once the 10 characters have been extracted they are left and right trimmed to remove leading and trailing spaces.
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