Let ( Assigns The Value Of The Expression To A Variable ) - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
LET
Instruction
• Assigns the value of the expression to a variable.
[LET ] <variable name> = <expression>
Syntax
variable name
expression
LET A=1
Examples
LET A$="MITSUBISHI"
• The LET instruction assigns the value of an expression to a variable.
Description
• The LET command may be entirely omitted.
Example
• 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.
Example
11 - 122
LET
• • • •
• • • •
• • • •
• • • •
LET A=10
LET A$="NAGOYA"
Integer type
variable
Single-precision
type variable
Double-precision
type variable
Specify numeric variable, character variable, or array
variable.
Specify numeric expression, character string, array,
or function.
Assigns "1" to numeric variable A.
Assigns character string "MITSUBISHI" to character
string variable A$
A=10
A$="NAGOYA"
A%=55.88
PRINT A%
B=.8571428571428571
PRINT B
C#=2.04
PRINT C#
MELSEC-Q
55
.857143
2.039999961853027
11 - 122

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents