CreateMessage

Creates a message object of the specified type. This object can have its properties set to the required values prior to it being sent out to a device via the SendMessage method.

Function

object CreateMessage (type: string);

Parameters

Name Type Description
type String The name of the message type to be created

Return Value

Created message object

Example

var myHeader = CreateHeader(); // Create header structure
var myBody = CreateMessage("TraceRequest"); // Create message structure
myHeader.MessageID = 75;
myHeader.DeviceID = 5;
myHeader.LocationID = 2;
myHeader.DeviceRef = 0;

myBody.Barcode = "123456789000"; // Fill the members of the structure
myBody.ActionID = 1;
myBody.OperatorID = 0;
myBody.reserved = 0;
SendMessage(myBody,myHeader); // Send message

myBody.Dispose(); // Release body memory
myHeader.Dispose(); // Release header memory