how to make 2 delay time for 1 output?

j3py

Member
Join Date
Mar 2004
Location
frankfurt
Posts
1
hai.. im quiet new for plc programming, and now currently learning plc with siemens s5 - 100.

btw, my friend gave a program to me, its a blinking lamp with only one steady time. for example if i set the timer to 3 secs, then it will 3 secs on, 3 secs off, 3 secs on, and so on. the problem is i tried to make the lamp i.e. 3 secs on, 1 secs off, 3 secs on, and so on.

can anyone help? thanks a million...
 
j3py

This is something that I have done using a function block.

I setup a function block (FB51) as the following:-


Name : CLOCK
Decl : TIMA I/Q/D/B/T/C: T
Decl : VALA I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KT
Decl : TIMB I/Q/D/B/T/C: T
Decl : VALB I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KT
Decl : OUTP I/Q/D/B/T/C: Q BI/BY/W/D: BI

:AN =TIMB
:LW =VALA
:SD =TIMA
:A =TIMA
:LW =VALB
:SD =TIMB
:A =TIMA
:= =OUTP
:BE



Then I call the FB from a PB and set the values for the delays in the PB, to give 3 seconds on 1 off set the values as below:



:JU FB51 //Jump unconditionally to FB51
Name: CLOCK //Symbolic name of the FB
TIMA: T 44 //Timer 44 used for ‘TIMA’
VALA: KT 030.1 //Set the value for T44 to 3 seconds
TIMB: T 45 //Timer 45 used for ‘TIMB’
VALB: KT 010.1 //Set the value for T45 to 1 second
OUTP: F82.6 // F82.6 will flash 3 seconds on and 1 second off.
***


If you do your ‘flashing’ using this FB, then it is quite easy to change the timer values within any PB, you would just call the FB conditionally (JC) and write different values to VALA and VALB, for however long you wish the 'flash' to last for.

Hope this helps

Paul
 
The following ladder is just one of the methods to achieve that, there are many, pls explore

Output O:2.0/0 turns on for 3 sec and off for 1 sec

timer.jpg
 

Similar Topics

Hi I need a safety system with safety encoders as input (profisafe bus) and digital outputs. When position or speed of some rotating device...
Replies
2
Views
1,744
I have a conveyor belt dropping product into a burner. The conveyor has a weight belt input that is used to vary the heat to the burner. I need to...
Replies
18
Views
3,720
The diagram in the "Learn PLC's" tutorial showing the longest time it takes to turn an output on looks incorrect to me? Surely the diagram should...
Replies
16
Views
4,215
Build error occurs with TON ladder logic command. Time Input expected on block. Using Integer Tag under Control Local, and then hard number 19...
Replies
2
Views
772
I have an SLC 503 running a machine with a scanner and 1794 RIO. One of the functions is a register motor on a printing cylinder. The manual 3...
Replies
3
Views
1,282
Back
Top Bottom