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.
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 () 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.
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
Hi,
I was wondering if there is a way to have the micro send a message to change the color of a button on an interface panel? I’ve tried a couple ways and can’t seem to get this to work. Is it possible?
Thanks,
Tim
Hi Tim, unfortunately the button control doesn’t allow you to adjust its settings from the Arduino end.
You can set the button colors now using SetForeColor and SetBackColor methods. See https://www.megunolink.com/documentation/interface-panel/common-control-properties/