S
MART
AXIS P
RO
/ L
ITE
U
SER
'
S
M
ANUAL
FT9Y-B1378
13-35
13: S
CRIPTS
Important Notes
This section describes important notes when programming scripts.
Important Notes Regarding While Definition
■
Define so the execution does not go into an infinite loop.
The execution expression is repeatedly executed while the conditional expression is satisfied.
However, it will go into an infinite loop when the conditional expression is satisfied continually.
In the conditional expression of the while definition, it states to exit the loop when the value of D0100 turns 0. However, the value
stored in D0100 is not changed after string 10 in the first line of the script, so the execution goes into an infinite loop.
When using the while definition, define it so the execution will not go into an infinite loop.
If the execution becomes an infinite loop, the scan time will exceed the watchdog timer setting and a watchdog timer error will
occur.
The value of D0100 becomes 0 when the while definition is repeated 10 times in the following example, and the execution will get
out of the while definition.
About the Priority of the Operator
Operators are processed in the order from the left in each line. When multiple operations are combined, the operators are
processed in the following priorities.
[D0100] = 10;
while (0 != [D0100])
{
[D0200] = [D0200] + 1;
}
[D0100] = 10;
while (0 != [D0100])
{
[D0200] = [D0200] + 1;
[D0100] = [D0100] - 1;
}
Priority
Operator
High
()
! ~ - (Negative number)
* / %
+ - (Subtraction)
<< >>
&
^
|
< <= > >=
== !=
&&
||
Low
=
Summary of Contents for SmartAXIS FT9Z-1A01
Page 1: ...FT9Y B1378 7...
Page 10: ...TABLE OF CONTENTS Preface 9 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 212: ...7 DEVICE ADDRESSES 7 16 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 230: ...8 INSTRUCTIONS FUNCTION BLOCKS REFERENCE 8 18 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 344: ...13 SCRIPTS 13 36 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 386: ...APPENDIX Appendix 16 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378 Japanese Font JIS X0201...
Page 393: ......