5 Basic Instruction
5.4 Operating Timer
68
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Program example
1. Program that turns ON Y010 and Y014 in 10 seconds after X000 turns ON.
2. Program that sets the BCD data of X010 to X01F to a timer.
3. Program that turns ON Y010 in 250 milliseconds after X000 turns ON.
OUT_T
EN ENO
TC1
X000
TCoil
TValue
100
TS1 Y010
Y014
[Structured ladder/FBD] [ ST ]
OUT_T(X000,TC1,100);
OUT(TS1,Y010);
OUT(TS1,Y014);
X000
OUT_T
EN ENO
TC2
X002
TCoil
TValue
D10
TS2
BCD data of X010 to X01F is
converted to binary data and
stored in D10.
When X002 turns ON, timer
starts to count using data
stored in D10 as set value.
When T2 timer completes
counting up, Y015 turns on.
Y015
BINP
EN
s
ENO
d
D10K4X010
[Structured ladder/FBD] [ ST ]
BINP(X000,K4X010,D10);
OUT_T(X002,TC2,D10);
OUT(TS2,Y015);
OUT_T
EN ENO
TC200
X000
TCoil
TValue
25
TS200 Y010
[Structured ladder/FBD] [ ST ]
OUT_T(X000,TC200,25);
OUT(TS200,Y010);