EasyManuals Logo

IDEC FT1A Series User Manual

IDEC FT1A Series
393 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #324 background imageLoading...
Page #324 background image
13: S
CRIPTS
13-20 S
MART
AXIS P
RO
/L
ITE
U
SER
'
S
M
ANUAL
FT9Y-B1378
Example 1.12 Conditional branch with switch using the default statement
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.13 Terminate the script with the return statement
Script
Operation Description
If the value of D0100 is not 0x1234, then 0 is stored in D0103.
If the value of D0100 is 0x1234, then 0x5678 is stored in D0102 and the script is terminated.
The return statement does not break out of a loop like the break statement, it terminates the script execution.
Example 1.14 Break out of a loop with the break statement
Script
Operation Description
While the value of D0100 is 0, the while statement is repeated until D0102 and D0103 match.
Inside the while statement, if the values of D0102 and D0103 are equal, the while statement will end and execution breaks out of
the while statement.
In the example above, the values of D0102 and D0103 match when the while statement is repeated twice, and after D0000.01
changes to 1, the while statement ends. After execution, the value of D0100 is 0, the value of D0102 is 5, the value of D0103 is 5,
and the value of D0000.01 is 1.
switch ([D0100])
{
case 0:
[D0102] = 0x1234;
break;
case 1:
[D0102] = 0x5678;
break;
default:
[D0102] = 0x9999;
break;
}
if (0x1234 == [D0100])
{
[D0102] = 0x5678;
return;
}
[D0103] = 0;
[D0100] = 0;
[D0102] = 3;
[D0103] = 5;
while ([D0100] == 0)
{
[D0102] = [D0102] + 1;
if ([D0102] == [D0103)
{
SET([D0000.01]);
break;
}
}

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IDEC FT1A Series and is the answer not in the manual?

IDEC FT1A Series Specifications

General IconGeneral
Programming SoftwareWindLDR
TypeProgrammable Logic Controller (PLC)
DisplayLCD (varies by model)
Communication PortsRS232C/RS485 (built-in), USB (programming), Ethernet (optional)
DimensionsVaries by model
WeightVaries by model
ModelFT1A Series

Related product manuals