Constants - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

• To execute instructions at the rising edge or falling edge in an iteration statement (FOR, WHILE, or REPEAT statement),
use the edge relay (V) or perform index modification. In this case, one point of the edge relay (V) is used for each
instruction that uses the edge relay (V) in the system. For this reason, secure the edge relay (V) for the number of
instructions used in addition to the number of points used in the iteration statement.
Ex.
When instructions executed at the rising edge or falling edge are used in the FOR statement
Example of using the edge relay (V) in one location
(The edge relay (V) is used up to a total of 11 points (V0 to V10 for the INC instruction).)
FOR Z0 := 0 TO 9 BY 1 DO
INC(EGP(M100Z0 , V0Z0) , D100Z0);
END_FOR;
Example of using the edge relay (V) in two locations
(The edge relay (V) is used up to a total of 22 points (V0 to V10 for the INC instruction, V11 to V21 for the DEC instruction).)
FOR Z0 := 0 TO 9 BY 1 DO
INC(EGP(M100Z0 , V0Z0) , D100Z0);
DEC(EGF(M200Z0 , V11Z0) , D200Z0);
END_FOR;
■ When the master control instruction is used
Operations when the master control is off will be as follows.
• A statement in the select statement (IF or CASE statement) or iteration statement (FOR, WHILE, or REPEAT statement)
performs no processing.
• For a statement outside the select statement or iteration statement, no processing is performed if it is an assignment
statement, and a statement itself is not executed if it is other than assignment statement.
Ex.
Statement in the select statement (IF statement)
MC(M0 , N1 , M1); //Master control is off.
IF M2 THEN
M3 := M4; //M3 retains the value in the last scan because no processing is performed when the master control is off.
END_IF;
M20 := MCR(M0, N1);
Ex.
Statement (bit assignment statement) outside the select statement or iteration statement
MC(M0 , N1 , M1); //Master control is off.
M3 := M4; //M3 retains the value in the last scan because no processing is performed when the master control is off.
M20 := MCR(M0, N1);
Ex.
Statement (OUT instruction) outside the select statement or iteration statement
MC(M0 , N1 , M1); //Master control is off.
OUT(M2, M3); //M3 turns off because the instruction is not executed when the master control is off.
M20 := MCR(M0, N1);

Constants

Notation of constants
The following table lists the notations of strings in ST programs.
Data type
String
String [Unicode]
For the notations of constants other than the above, refer to the following.
Page 48 Constants
Notation
STRING
Enclose a string (ASCII, Shift JIS) in single quotation marks (' ').
WSTRING
Enclose a Unicode string in double quotation marks (" ").
Example
Stest:='ABC';
Stest:="ABC";
6 STRUCTURED TEXT LANGUAGE
6.1 Configuration
6
71

Advertisement

Table of Contents
loading

Table of Contents