Mg (message), General – Yaskawa SMC–4000 User Manual
Page 168
158
SMC–4000 User Manual
MG (Message)
[General]
DESCRIPTION:
The MG command sends data out the specified port. This can be used to alert an operator, send instructions
or return a variable value.
ARGUMENTS: MG {Ex} "m", {^n}, V {Fm.n or $m.n} {N} {Sn}where
{Ex}For Ethernet and ‘x’ specifies the Ethernet handle (A,B,C,D,E,F,G,H). Note: if {Ex} is used, it must be
the first option after the MG command.
"m" is a text message including letters, numbers, symbols or
is not exceeded.
{^n} is an ASCII character specified by the value n in decimal.
V is a variable name or array element where the following specifiers can be used for formatting:
{Fm.n} Display variable in decimal format with m digits to left of decimal, and n to the right.
{$m,n} Display variable in hexadecimal format with m digits to left of decimal, and n to the right.
{N} Suppress carriage return line feed.
{Sn} Display variable as a string of length n where n is 1 thru 6 (n can be omitted, all characters)
*Note Multiple text, variables, and ASCII characters may be used, each must be separated by a
comma.
USAGE:
RELATED COMMANDS:
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}, {^30}, {^37}, {N} Sends carriage return, characters 0 and 7 followed by no carriage return line
feed command to the port.
While Moving
Yes
Default Value
-
In a Program
Yes
Default Format
Variable Format
Command Line
Yes
Can be Interrogated
No
Used as an Operand
No