Text shown or spoken by the message monitor and text written to a file by the message logger visualizer is taken 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 message monitor.
This page describes the raw protocol for sending data and commands to the message monitor and message logger visualizers. The MegunoLink Arduino library provides a simpler method for sending data and commands to these visualizers.
The general format of message commands is: {MESSAGE
:channel-name
|command|command data
}
- The
MESSAGE
keyword is required. It identifies the command as one that should be handled by the message monitor. - The
channel-name
parameters is optional. It selects the channel if you want to have several message monitors from the same source. - The
command
parameter is required and sets the action taken by MegunoLink. Supported commands include:DATA
,SPEAK
,SPEAK+DATA
,CLEAR
,F
andX
. - The
command data
is the data used by the command. Not all commands require data.
Data Command
The DATA
displays the command data
on a new line in the message monitor visualizer.
Examples
{MESSAGE|DATA|I am not a fish}
: displays the message I am not a fish in the default message monitor{MESSAGE:Dolphins|DATA|So long and thanks for all the fish}
: displays the message So long and thanks for all the fish in the ‘Dolphins’ channel message monitor
Speak Command
The SPEAK
command uses your computers text-to-speech engine to read out the command data
. The text is not added to the message monitor visualizer. You can enable/disable text-to-speech and select the voice used through the Speech on the toolbar of the message monitor visualizer.
Examples
{MESSAGE|SPEAK|5, 4, 3, 2, 1, Bang!}
: speaks the message 5, 4, 3, 2, 1, Bang!
Speak+Data Command
The SPEAK+DATA
command combines the SPEAK
and DATA
commands. It both reads out the text using your computer’s text-to-speech engine and places it in the message monitor window.
Examples
{MESSAGE|SPEAK+DATA|The battery is nearly flat}
: displays and speaks the message The battery is nearly flat in the default message monitor visualizer.{MESSAGE:Lights|SPEAK+DATA|I turned all the lights off}
: displays and speaks the message I turned all the lights off in the ‘Lights’ channel message monitor
Clear Command
The CLEAR
command removes all text from the message monitor visualizer. This command doesn’t use any command data.
Examples
{MESSAGE|CLEAR}
: clears the text in the default message monitor visualizer.{MESSAGE:Log|CLEAR}
: clears the text in the ‘Log’ message monitors listening to the log channel
Starting Logging
The F
command is used to start logging in the message logger visualizer. The log-file filename is (optionally) supplied in the command data. If the filename is not present, logging is started with the filename selected in MegunoLink. When supplied, the filename is combined with the folders set in MegunoLink. It is not possible to supply a fully qualified path for the filename.
Examples
{MESSAGE|F|ExperimentData1.txt}
: begins writing to a log file namedExperimentData1.txt
.{MESSAGE|F}
: begins writing to the log file selected in MegunoLink.
Stopping Logging
The X
command is used to stop logging in the message logger visualizer. This command doesn’t require any parameters.
Example
{MESSAGE|X}
: stops logging in the message logger visualizer.