11 - 122 11 - 122
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
LET
Instruction
LET
• Assigns the value of the expression to a variable.
[LET ] <variable name> = <expression>
variable name
• • • •
Specify numeric variable, character variable, or array
variable.
Syntax
expression
• • • •
Specify numeric expression, character string, array,
or function.
LET A=1
• • • •
Assigns "1" to numeric variable A.
Examples
LET A$=”MITSUBISHI”
• • • •
Assigns character string “MITSUBISHI” to character
string variable A$
Description
• The LET instruction assigns the value of an expression to a variable.
• The LET command may be entirely omitted.
LET A=10
A=10
Example
LET A$=”NAGOYA”
A$=”NAGOYA”
• If the <expression> is a numeric expression, <variable name> must be a numeric variable.
If the <expression> is a character string, the <variable name> must be a character string
variable. If the <expression> and <variable name> do not match, a “Type mismatch error”
will be generated.
• If the <expression> and <variable name> types do not match, the <expression> should be
changed to match with the <variable name> type and then assigned.
Integer type
variable
A%=55.88
PRINT A%
55
Single-precision
type variable
B=.8571428571428571
PRINT B
.857143
Double-precision
type variable
C#=2.04
Example
PRINT C#
2.039999961853027
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...