Timer functions

BoSChoW

Member
Join Date
Apr 2006
Location
Nova Gorica
Posts
107
Hi all,
any ideas how to make a program in SCL that when an INPUT for example I0.0 is turned on, two OUTPUTS Q0.0 and Q0.1 will pulse in an 1 second interval, in the first second OUTPUTs will be Q0.0 = true Q0.1 = false, in the second second Q0.0 = false and Q0.1 = true, in the third second the OUTPUT rezult will be the same as in the first second and so on ... Any ideas how should i do this?

Thanks for your help.
 
Oh BosChoW - you're not trying at all, are you!

Don't get too hung up thinking about the language. Think about the problem. Once you've got that clear, the solution (in any language) will start to form itself.

OK, so we want two outputs to follow a square-wave pattern with a period of 1 second, and one output has to be inverted with respect to the other.

Now we know from previous posts that you're using an S7 PLC. And we all know that Siemens have already provided every S7 with a 'clock byte' facility where the bits that byte follow a square-wave pattern, each with differing frequencies.

So, find the bit that has the 1s frequency. Write a simple SCL assignment statement such that Q0.0 follows the state of that bit. Write a second assignment statement such that Q0.1 is inverted with respect to either that bit or Q0.0. Something like -
Code:
   Output1 := Input1 AND 1s_SqWave;
   Output2 := Input1 AND NOT 1s_SqWave;
And don't dare start writing absolute addresses (I0.0, Q0.0 etc) like we do in STL and LAD. SCL is for grown-up people who use symbolic addressing everywhere!

By the way, you haven't said what should happen when Input1 is false? Do the two Outputs freeze or should they both be false?

Back to you.

Ken
 
Thank Ken,
I never thaugh of this solution, this looks less complicated as the one i was trying to do. I was thinking about an pulse timer and an delay timer to do the job and i still didnt figure out how to do it but i will try it your way. About the input, if its false then the two outputs are false as well. Now i am trying to do as you recomanded, thanks again.
 

Similar Topics

Hello All, I am working with an old PLC2 and we had some kind of power surge that screwed our program up. I have gone back with an old hardcopy...
Replies
5
Views
4,797
I have some logic that I have written within a 5380 series controller that tracks the time an event is started, while the event is running an RTO...
Replies
2
Views
93
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
313
Question to anyone with ideas about my thoughts on upgrading a very vintage timer, which is being used to switch between 2 5hp domestic water...
Replies
14
Views
437
why my timer only executes once here? After first time i use it, ET stays at 0ms all the time. It is in FB
Replies
5
Views
314
Back
Top Bottom