
26: S
CRIPT
26-42
FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
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.
Precautions on Data Type Designations
■
Do not write scripts that use a data type designation inside another data type designation.
Data type designations are called at a maximum depth of one level.
An error will occur when adding a script with Script Editor if a data type designation is used inside another data type designation
as shown in the following example.
■
Do not write scripts that use a temporary device inside a data type designation.
The processing inside the curly brackets "{ }" for the data type designation cannot use temporary devices.
A temporary device works only with the data type set in
Data Type
in Script Editor.
An error will occur when adding a script with Script Editor if a temporary device is used inside a data type designation as shown in
the following example.
[D0100] = 10;
while (0 != [D0100])
{
[D0200] = [D0200] + 1;
}
[D0100] = 10;
while (0 != [D0100])
{
[D0200] = [D0200] + 1;
[D0100] = [D0100] - 1;
}
[D0100] = 1.5;
[D0110] = 10.5;
asd
{
[D0200] = FLOAT2BIN([D0100]);
[D0210] = FLOAT2BIN([D0110]);
[D0300] = [D0200]^[D0210];
asword
{
[D0400] = [D0301];
}
}
@1 = 1.5;
asd
{
[D0200] = FLOAT2BIN(@1);
}
Содержание MICROSmart FC6A Series
Страница 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Страница 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 158: ...6 DATA COMPARISON INSTRUCTIONS 6 10 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 216: ...10 DATA CONVERSION INSTRUCTIONS 10 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 248: ...11 WEEK PROGRAMMER INSTRUCTIONS 11 32 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 288: ...15 INTERRUPT CONTROL INSTRUCTIONS 15 4 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 294: ...16 COORDINATE CONVERSION INSTRUCTIONS 16 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 374: ...18 PULSE OUTPUT INSTRUCTIONS 18 78 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 Setting ...
Страница 450: ...20 DUAL TEACHING TIMER INSTRUCTIONS 20 4 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 574: ...27 FLOW CALCULATION INSTRUCTIONS 27 28 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 583: ...FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 28 9 28 USER DEFINED MACRO INSTRUCTION ...
Страница 584: ...28 USER DEFINED MACRO INSTRUCTION 28 10 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...