TYPE MGT_REQ : (* Management Request *)
STRUCT
ID : DINT; (* 32-bit transaction ID *)
CMD : MGT_CMD; (* Management Command per IEC 61499-1, Table 8 *)
TYPE : MGT_TYPE; (* Management Object Type *)
CONTENTS : USTRING; (* Management Object Contents *)
END_STRUCT;
END_TYPE
This Structured Data Type models the
Request
element defined in the FBMGT
DTD and subclause 6.4 of the Compliance
Profile for Feasibility Demonstrations as follows:
- The
IDandActionvariables represent the corresponding attributes of theRequestelement. - The contained sub-element (
FB, Connection, etc.) of theRequestis represented by the combination of theTYPEandCONTENTSvariables.
The use of a variable of this data type instead of an XML
Request
element encoded as a
STRING
variable has several advantages for the transmission of management
requests to remote devices:
- Message length can be significantly shorter. For instance
the
STRINGencoding of the following XML element would require a communication payload of 88 bytes, while the correspondingMGT_REQvalue would require only 22 bytes:<Request ID="1" Action="CREATE" > <FB Name="FBName" Type="FBType" /> </Request>
- Parsing of the
CONTENTSfield can be accomplished with simple String operations, which can provide significant advantages in both speed and memory usage vs. a general-purpose XML parser.- Click here for a more extensive comparison of encodings.
- UTF-8 provides an efficient encoding of the
CONTENTSfield for the widely used 7-bit US-ASCII character set, with a graceful upgrade path to larger character sets that is more efficient than the use of escape sequences that would be required in aSTRINGencoding.