Appendix A: Marshalling Protocol
217
NetLinx Programming Language Reference Guide
Marshalling Protocol (Variables)
The protocol assumes that every logical field (variable) is identified with a name or index, type/size
information and the actual data. For example, if there is a 4 byte long integer field within a structure, the
XML stream representing that field would consist of 3 tags: A name tag specifying the name of the
variable, a type tag specifying a 4 byte unsigned value, and the data. This concept is extended to all
primitive, structure and array types. The type of a field is always stored using W3C standard type
declarations. The type of the field is optional, as the data will be "stuffed" into whatever type matches the
name of the parameter. The specific formats of all the supported types are described below.
Marshalled Stream format
The following table describes the byte format of the various types supported in the XML marshaller.
Types Supported in the XML Marshaller
Type
Description
Stream Format
BYTE
Unsigned char/byte value. If var is an element of an
array, name is replaced with <index></index>. The
index value, and the type are optional. Typically, only
<var><data>Data</data></var> is needed.
<var>
<name>MyName</name>
<type>ui1</type>
<data>255</data>
</var>
UWORD
Unsigned short value. If var is an element of an array,
name is replaced with <index></index>. The index
value, and the type are optional. Typically, only
<var><data>Data</data></var> is needed.
<var>
<name>MyName</name>
<type>ui2</type>
<data>65535</data>
</var>
WORD
Signed short value. If var is an element of an array,
name is replaced with <index></index>. The index
value, and the type are optional. Typically, only
<var><data>Data</data></var> is needed.
<var>
<name>MyName</name>
<type>i2</type>
<data>-32767</data>
</var>
ULONG
4-byte unsigned value. If var is an element of an array,
name is replaced with <index></index>. The index
value, and the type are optional. Typically, only
<var><data>Data</data></var> is needed.
<var>
<name>MyName</name>
<type>ui4</type>
<data>4294967295 </data>
</var>
LONG
4-byte signed value. If var is an element of an array,
name is replaced with <index></index>. The index
value, and the type are optional. Typically, only
<var><data>Data</data></var> is needed.
<var>
<name>MyName</name>
<type>ui4</type>
<data>-2147483647 </data>
</var>
FLOAT
4-byte IEEE 754 float value. If var is an element of an
array, name is replaced with <index></index>. The
index value, and the type are optional. Typically, only
<var><data>Data</data></var> is needed.
<var>
<name>MyName</name>
<type>float.IEEE.754.32</type>
<data>1.23</data>
</var>
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...