Messaging

A message consists of a header and a body. Currently the Sym3 header is fixed and defined as below.

Creating a Message

In Project Explorer, right-click on Messages > New.

Properties

Name Description
Name Name of the message. The name will be used in script to create a new message. (eg. CreateMessage(“MyMessage”); )
Type ID of the message. The pair ID / Input must be unique. For instance there can be only one input message of type ID 80, but there can be one input and one output message with the same type ID.
Data Type The data type defining the message body structure.
Script Handler The script function called when the message is received. (input message only)
Input True for incoming messages, False for outgoing messages.

Header structure

All messages have the same header structure:

Name Type Description
MessageID Byte Integer value that identifies the message type.
DeviceID Byte Integer value that identifies the device that sent or is to receive message.
LocationID Word Integer value that identifies specific equipment.
DeviceRef Word Integer value that is sent by the device for its own internal use, should be copied back to the device in any response message.
MessageLength Word The total length of the message. It means: MessageLength = Header length (8 bytes) + Body length

WARNING: At present, the network byte order of LocationID and DeviceRef is set to little endian, and will not be changed by the NetworkByteOrder device option. Byte order of MessageLength is still affected by NetworkByteOrder.

Body structure

The structure of the message body is defined by its data type.

To create, send and receive message, See “Message Methods”