MLP UI Message Processor Library

 In Interface Panel

The InterfacePanel class in the MegunoLink Pro Arduino Library provides a convenient set of methods for sending messages to a MLP UI Message Processor on a MegunoLink Pro Interface Panel. The messages sent are processed by a MLPUIMessageProcessor component, which must be added to the interface panel in the designer. This library lets you:

  • Set the value of a control on the interface panel
  • Get the value of a control on the interface panel
  • Invoke a message from the MessageLibrary component attached to the MLPUIMessageProcessor

To use the InterfacePanel functions:

  1. Install the MegunoLink Pro Arduino library
  2. Add #include “MegunoLink.h” to the top of your Arduino program
  3. Create a InterfacePanel variable
  4. Call methods on the InterfacePanel variable

Example

This program sends out commands to set the value of a progress bar named ‘Progress’, a numeric up/down control named ‘Current’ and a text box named ‘Status’ periodically.

An Arduino program to send data to MegunoLink Pro

An Arduino program can update controls on a MegunoLink Pro Interface Panel by sending specially formatted commands through the serial port.

Description

The interface panel provides a canvas for building simple user interfaces that use controls such as buttons, sliders and check-boxes to send serial messages to connected devices. Components such as the MLP UI Message Processor allow connected devices to send messages down the serial channel to update controls in the user interface.

The InterfacePanel class provides a set of functions to format serial messages for accessing controls on the interface panel.

Methods

InterfacePanel(ChannelName — optional ) (constructor)
SetText(ControlName, Value)
SetProgress(ControlName, Value)
SetNumber(ControlName, Value)
SetListIndex(ControlName, Index)
SetListValue(ControlName, Value)
SetCheck(ControlName, Checked — optional)
ClearCheck(ControlName)
CallCommand(CommandName)
GetValue(ControlName, PropertyName)
HideControl(ControlName)
ShowControl(ControlName)

Detailed Descriptions

InterfacePanel(ChannelName — optional )

Constructs an InterfacePanel variable, with an optional ChannelName.

SetText(ControlName, Value)

Sets the text displayed in a text box control.

SetProgress(ControlName, Value)

Sets the current value displayed by a progress bar control.

SetNumber(ControlName, Value)

Sets the number displayed in a numeric up/down control or a track-bar with indicator control.

SetListIndex(ControlName, Index)

Sets the index of the item selected in a value-list control. The first item in the list box is 0.

SetListValue(ControlName, Value)

Selects the item with the given value in a single-selection, value-list control. In a multi-selection value-list control, selects any items where a bitwise and between the item value and the new value is equal to the item value. This allows a list box to represent bit-flag variables.

SetCheck(ControlName, Checked — optional)

Sets the check-state of a check box control. If the optional Checked parameter is missing, the control is checked. Otherwise, if Checked is true, the control is checked; if false, the control is unchecked.

ClearCheck(ControlName)

Clears the check mark from a check box control.

CallCommand(CommandName)

Invokes a named command from the message library attached to the message processor. Typically the command returns a serial message.

GetValue(ControlName, PropertyName)

Returns the value of a serial message property for the named control. The format used for the message return is described in the Message Processor Reference.

ShowControl(ControlName)

Makes a previously hidden control visible. Currently only supported for picture box controls.

HideControl(ControlName)

Hides a control so it is no longer visible. Currently only supported for picture box controls.

Recent Posts

Leave a Comment

Contact Us

Send us an email and we will get back to you shortly.

Not readable? Change text.

Start typing and press Enter to search