Yaskawa MP2000 Series: User's Manual for Motion Programming User Manual
Page 197
8 Command Reference
8.4.2 Repeat (WHILE WEND)
8-90
The conditional expressions that can be used for repeat commands are as follows.
(a) Bit Data Comparison
(b) Integer/Double Integer/Real Number Data Comparison
Format
• Use == (MATCH) command for data comparison.
• Specify a register on the left, and 0 or 1 on the right.
WHILE MB000000 == 0; "MB000000 = 0
WHILE MB000000 == 1;
"MB000000 = 1
Operations in
Conditional
Expression
• &,
⏐, and ! (AND, OR, and NOT) can be used.
WHILE (MB000000 & MB000001) == 1; "MB000000=1 AND MB000001=1
WHILE (MB000000 & !MB000001) == 1; "MB000000=1 AND MB000001=0
WHILE (MB000000 | MB000001) == 1;
"MB000000=1 OR MB000001=1
WHILE (MB000000 | !MB000001) == 1; "MB000000=1 OR MB000001=0
Syntax Error
Examples
• When a <> (MISMATCH) is used:
WHILE MB000000 <> 0; => Syntax error
• When a numerical value is specified on the left, or a register is specified on the right:
WHILE 1 == MB000000; => Syntax error
WHILE MB000000 == MB000001; => Syntax error
• No data comparison command:
WHILE MB000000; => Syntax error
WHILE (0); => Syntax error
• When more than one data comparison command is used:
WHILE (MB000000 == 0) & (MB000001 == 1); => Syntax error
Format
• All data comparison commands (==, <>, >, <, >=, <=) can be used.
• Specify a register either on the left or right.
WHILE MW00000 == 3; "MW00000 = 3
WHILE ML00000 <> ML00002; "ML00000
≠ ML00002
WHILE 1.23456 >= MF00000; "1.23456
≥ MF00000
Operations in
Conditional
Expression
• Arithmetic operations and logic operations can be used.
WHILE MW00000 == (MW00001/3); "MW00000 = (MW00001
÷ 3)
WHILE (ML00000 & F0000000H) <> ML00002; "(ML00000
∧ F0000000H) ≠ ML00002
WHILE 1.23456 >= (MF00000 * MF00002);
"1.23456
≥ (MF00000 × MF00002)
Syntax Error
Examples
• When a constant is specified both on the left and right:
WHILE 0 == 3; => Syntax error
WHILE (3.14*2*1000) > 9000.0; => Syntax error
• No data comparison command
WHILE MW000000; => Syntax error
WHILE (-1);
=> Syntax error
• When more than one data comparison command is used:
WHILE (MW00000 < 0) & (MW000001 > 0); => Syntax error