26: S
CRIPT
26-20
FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
Example 1.5
Conditional branch
Script
Operation Description
If the value of D0100 is 0, then 0x1234 is stored in D0102.
If the value of D0100 is 1, then 0x5678 is stored in D0102.
If the value of D0100 is not 0 nor 1, then 0x9999 is stored in D0102.
Example 1.6
Conditional branch
Script
Operation Description
If the value of D0100, D0102, and D0103 are all not 0, then 100 is stored in D0104.
If the values of D0100 and the value of D0102 are not 0 and the value of D0103 is 0, then 200 is stored in D0104.
If either the value of D0100 or D0102 is 0, then nothing is executed regardless of the value of D0103.
Example 1.7
Iteration
Script
Operation Description
If the value of D0100 is larger than 0, then 1 is repeatedly added to the value of D0102 and 1 is repeatedly subtracted from the
value of D0100.
In the script example above, when the while statement repeats ten times, the value of D0100 becomes 0 and the while statement
ends.
After this script is executed, the value of D0100 is 0 and the value of D0102 is 20.
if ([D0100] == 0)
{
[D0102] = 0x1234;
}
else if ([D0100] == 1)
{
[D0102] = 0x5678;
}
else
{
[D0102] = 0x9999;
}
if ([D0100])
{
if ([D0102])
{
if ([D0103])
{
[D0104] = 100;
}
else
{
[D0104] = 200;
}
}
}
[D0100] = 10;
[D0102] = 10;
while (0 < [D0100])
{
[D0102] = [D0102] + 1;
[D0100] = [D0100] - 1;
}
Summary of Contents for MICROSmart FC6A Series
Page 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Page 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...