MegunoLink gets values for the record 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 record table handler. The MegunoLink Arduino library provides a simpler method for sending data to record tables.
The general format of table messages is: {RECTBL
: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 ofADD
,ADI
orSET
,STI
,STC
orCLEAR
. - The value of the
command data
argument depends on the command.
Add Command
The ADD
command appends a new row of data to the end of the table. Column values are provided in the command data
. Column values are separated by a comma (‘,
‘). Columns are populated in logical order.
Examples
{RECTBL|ADD|1,2,3,Fish,Turtle,Lemon}
: Appends a new row filling columns with the values 1,2,3,Fish,Turtle,Lemon.
Add with Ids Command
The ADI
command appends a new row of data to the end of the table. Column values and column ids are provided in the command data
. The format is list of column ids = corresponding column values
. Each value in the lists of column ids and values is separated by a comma (‘,
‘). There must be the same number of column ids and column values in each list. Not all columns need to be included.
Examples
{RECTBL|ADI|1,4,3=42,Answers,All}
: places 42 in the column with id 1, Answers in the column with id 4 and ‘all’ in the column with id 2.
Set Command
The SET
command updates the column values in an existing row to the values supplied. The row number (counting from 0) and column values are provided in the command data
. The row number is separated from the column values using a pipe (‘|
‘) character. Column values are separated by a comma (‘,
‘). Columns are populated in logical order.
Examples
{RECTBL|SET|3|1,2,34}
: updates the values in the first 3 logical columns of row 3 to 1, 2, 34.
Set with Ids Command
The STI
command updates the column values in an existing row to the values supplied. The row number (counting from 0) and column values are provided in the command data
. The row number is separated from the column values using a pipe (‘|
‘) character. The format is list of column ids = corresponding column values
. Each value in the lists of column ids and values is separated by a comma (‘,
‘). There must be the same number of column ids and column values in each list. Not all columns need to be included.
Examples
{RECTBL|STI|2,6,5=Universe,Unknown,Question}
: places ‘Universe’ in the column with id 2, ‘Unknown’ in the column with id 6 and ‘Question’ in the column with id 6.
Set Cell Command
The STC
sets the value of a single cell in the table. Row and column numbers, and cell value are all supplied in the command data
, separated by the pipe (‘|
‘) character. Rows and columns are counted from 0. Columns are specified in logical order.
Example
{RECTBL|STC|3|4|Hello}
: sets the content of the cell at row 3, logical column 4 to ‘Hello’.
Clear Command
The CLEAR
command removes the contents of a single row, when a row number is supplied, or the whole table when no row number is supplied. The optional row number is provided in the command data
.
Examples
{RECTBL|CLEAR}
: clears all data from the table.
{RECTBL|CLEAR|5}
: clears the contents of row 5 from the table.