Summary of message functions, Example - printing a variable, Input of data – Yaskawa LEGEND-MC User Manual
Page 322: Example, This program sends the message
312
LEGEND-MC User’s Manual
Summary of Message Functions:
Variables may also be sent to the screen using the variable= format. Variable Name= returns the variable
value. For example, V1= , returns the value of the variable V1.
Example - Printing a Variable
Input of Data
The IN command is used to prompt the user to input numeric or string data. The input data is assigned to
the specified variable or array element.
A message prompt may be sent to the user by specifying the message characters in quotes.
Example:
#A
IN "Enter Length", LENX
EN
This program sends the message:
Enter Length
to the PC screen or dumb terminal and waits for the operator to enter a value. The operator enters the
numeric value which is assigned to the variable, LENX. String variables with up to six characters may
also be input using the {S} specifier. For example, IN "Enter X,Y or Z", V{S} specifies a string variable
MG
Message command
" "
Surrounds text string
{Fn.m}
Formats numeric values in decimal n digits to the right of the
decimal point and m digits to the left
{$n.m}
Formats numeric values in hexadecimal
{^n}
Sends ASCII character specified by integer n
{N}
Suppresses carriage return/line feed
{Sn}
Sends the first n characters of a string variable, where n is 1
through 6.
#DISPLAY
Label
PR 1000
Position Command
BGX
Begin
AMX
After Motion
V1=_TPX
Assign Variable V1
V1=
Print V1