MegunoLink gets values for the table visualizer from specially formatted commands in serial streams. Each command must be surrounded by braces (‘{‘ and ‘}’). Any text that is not within braces is ignored by MegunoLink’s table handler. The MegunoLink Arduino library provides a simpler method for sending data to tables.

The general format of table messages is: {TABLE:channel-name|command|command data}

  • The channel-name argument is optional. If present, it selects the table-channel.
  • The command argument is required. It should be one of SET, GET, CLEAR or DESCRIPTION.
  • The value of the command data argument depends on the command.

Set Command

The SET command sets the entry for a row in the table. The command data argument is the name and value, separated by the ‘|’ character. The description value may be included as well. If present, the description comes after the value. It is separated by the ‘|’ character.

Examples

  • {TABLE|SET|Power good|False}: sending the value ‘False’ to the row labeled ‘Power good’ on the default table.
  • {TABLE:Battery|SET|Battery voltage|3600|mV}: sending the value ‘3600’ to the row labeled ‘Battery voltage’ on the ‘Battery’ table channel. The description is set to ‘mV’.

Get Command

The GET command retrieves the current value for a row in the table. The command data argument is the name of the row to retrieve. If a row with the name requested is present then MegunoLink sends the value to your program as a serial message in the form: {TABLE|name|value}.

Examples

  • {TABLE|GET|Temperature set-point} retrieves the value named ‘Temperature set-point’ from the default table.
  • {TABLE:BatteryMonitor|GET|ChargerEnabled} retrieves the value named ‘ChargerEnabled’ from the ‘BatteryMonitor’ table-channel.

Clear Command

The CLEAR command clears one or all entries from the table. If the command data is supplied, the named row of the table is removed. If no command data is supplied, all rows are removed from the table.

Examples

  • {TABLE|CLEAR} all rows are removed from the default table.
  • {TABLE:BatteryMonitor|CLEAR} all rows are removed from the ‘BatteryMonitor’ table-channel.
  • {TABLE:BatteryMonitor|CLEAR|Battery voltage} the ‘Battery voltage’ row is removed from the default table.

Description Command

The DESCRIPTION command sets the description entry for a named row. The command data argument is the name of the row and value of the description to set. The name and value should be separated using the ‘|’ character.

Examples

  • {TABLE|DESCRIPTION|Battery voltage|mV} sets the description column of the row named ‘Battery voltage’ to ‘mV’ in the default table.
  • {TABLE:BatteryMonitor|DESCRIPTION|Battery voltage|mV} sets the description column of the row named ‘Battery voltage’ to ‘mV’ in the ‘BatteryMonitor’ table-channel.
Recent Posts

Leave a Comment

Contact Us

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

Not readable? Change text. captcha txt

Start typing and press Enter to search