In your program, wait6 timer is only reached when wait5 timer expires. Look at the flow of your code - if wait5 timer is not finished, then return - so the rest of your code is skipped. You only need multiple timers if you need to run timers simultaneously.
Your code must run every PLC scan - it's not like a PC script - you don't go from the first line to the last line and then be "done". Every PLC scan (xxx uS), your code is run. If you need to do steps 1,2,3, then you need a state machine (CASE statement):
Code:
CASE Step OF
0: //init
Step := Step + 1;
1: //first timer routine
a := 1;
b := 2;
c := 3;
wait(IN:=TRUE, PT:=T#5s);
IF wait.Q THEN
wait(IN:=FALSE);
Step := Step + 1;
END_IF
2: //second timer routine
a := 4;
b := 5;
c := 6;
wait(IN:=TRUE, PT:=T#15s);
IF wait.Q THEN
wait(IN:=FALSE);
Step := Step + 1;
END_IF
3: //done - don't do anything more
;
ELSE //code error!!! restart state machine
Step := 0;
END_CASE
Now your code executes this way:
- PLC scan 1 - case 0 executes (step incremented)
- PLC scan 2 - case 1 executes (timer starts - 5 seconds)
- PLC scan 3 - case 1 executes (timer running)
- PLC scan 4 - case 1 executes (timer running)
- ...
- PLC scan xx - case 1 executes (timer expires, timer disabled, step incremented)
- PLC scan xx+1 - case 2 executes (timer starts - 15 seconds)
- ...
I hope that helps!