Mg (message), General, N} suppress carriage return line feed – Yaskawa LEGEND-MC User Manual

Page 174: P1} forces a message to the serial port, Case 1: message command displays ascii strings, Mg "good morning" displays the string

Advertising
background image

164

LEGEND-MC User’s 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 or P1} "m", {^n}, V {Fm.n or $m.n} {N} {Sn}

"m" is a text message including letters, numbers, symbols or <ctrl>G. Make sure that maximum line length
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.

{Sn} Display variable as a string of length n where n is 1 thru 6

{N} Suppress carriage return line feed.

{Ex}For Ethernet and ‘x’ specifies the Ethernet handle (A,B,C,D,E, ... P). NOTE: if {Ex} is used, it must be
the first option after the MG command.

{P1} forces a message to the serial port.

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

Distributed Control

If {Ex} Used

"MG" Message

Advertising