The message library component stores a collection of messages that can be sent to a serial channel. Message libraries are most useful when several controls send the same message or for requesting data from the interface panel in your Arduino sketch. Use a message library by linking it to a MLPUIMessageProcessor component through the MLPUIMessageProcessor‘s Library property.

Message library component properties
Property Access Type Method Description
EndOfMessage Design-only String Sets the text appended to the end of each message. Supports escape codes. For example \r\n will append carriage-return and new-line characters to the end of each message.
MessagePrefix Design-only String Sets the text added to the start of each message. Supports escape codes and expressions. For example [SiteId.Value] will add the value from a control named SiteId to the start of each message.
Messages Design-only MessageCollection CallCommand The collection of messages in the library. Click the ellipsis (Ellipsis) button in the property editor window to open the message editor.
MessageSuffix Design-only String Sets the text added to the end of each message. Supports escape codes and expressions. For example [SiteId.Value] will add the value from a control named SiteId to the end of each message.
StartOfMessage Design-only String Sets the text added to the beginning of each message. Supports escape codes. For example ! will add a ‘!’ character to the beginning of each message.
Name Design-only String The name of the component.

The message library also supports the following methods, which can be used when creating serial commands.

TextBox control methods
Name Returns Description
Get(string MessageName) string Returns the message named MessageName from the library as a string.
GetData(string MessageName) byte[] Retrieves the message named MessageName from the library converted to an array of bytes.
Showing 3 comments

Leave a Comment

Start typing and press Enter to search