Optima DMC-1xxx and DMC-18x2 Command Reference
MG
i
134
MG
FUNCTION: Message
DESCRIPTION:
The MG command sends data out the bus. This can be used to alert an operator, send
instructions or return a variable value.
ARGUMENTS: MG "m", {^n}, V {Fm.n or $m,n} {N}
where
"m" is a text message including letters, numbers, symbols or <ctrl>G (up to 72 characters).
{^n} is an ASCII character specified by the value n
V is a variable name or array element where the following formats can be used:
{Fm.n} Display variable in decimal format with m digits to left of decimal, and n to the
right.
{Zm.n} Same as {Fm.n} but suppresses the leading zeros.
{$m.n} Display variable in hexadecimal format with m digits to left of decimal, and n to
the right.
{Sn} Display variable as a string of length n where n is 1 through 6
{N} Suppress carriage return line feed.
Note: Multiple text, variables, and ASCII characters may be used, each must be separated by
a comma.
Note: The order of arguments is not important.
USAGE: DEFAULTS:
While Moving
Yes
Default Value
-
In a Program
Yes
Default Format Variable
Format
Command Line
Yes
Controller Usage
ALL CONTROLLERS
EXAMPLES:
Case 1: Message command displays ASCII strings
MG "Good Morning" Displays the string
Case 2: Message command displays variables or arrays
MG "The Answer is", Total {F4.2}
Displays the string with the content of variable
'Total' in local format of 4 digits before and 2 digits after the decimal point.
Case 3: Message command sends any ASCII characters to the port.
MG {^13}, {^10}, {^48}, {^055} displays carriage return and the characters 0 and 7.