One-second Pulse Generator

c_conroy

Member
Join Date
Jan 2018
Location
Munster
Posts
3
Very new to PLCs, I am trying to add a delay to a simple motor setup. I want the motor(just name I gave to output) to be able to go on for 5 seconds and then off for 5 again continuously. I've been given the hint to use a pulse generator. Which I been looking up online. However it isn't working like it should, taking far longer to pulse than I have designated and not resetting. Also the motor (output doesn't go high even when it's corresponding bit check is high).
 
Hi, welcome to the forum, and hope you will like doing programming.
This what you are wanting sounds suspiciously like a flasher routine, and a flasher routine would probably work. Just use a self resetting TON, using the .DN bit, and use a GRT instruction with 5 seconds .ACC in the GRT and then a preset of 10 seconds in the timer.
When the time accumulates to more than 5 seconds, the output will come true, and when it times out and resets, the output will be off for 5 seconds. Hope this will at least give you some ideas, anyway. What software are you using? A-B?
 
Yeah I was basing it off a flasher I found online, seemed to fit what I wanted to do. Thanks for the advice I'll get at it now. I don't know why but my Timer doesn't seem to be resetting after the first 5 seconds. Using Studio 5000 on AB yes.
 
Yeah I was basing it off a flasher I found online, seemed to fit what I wanted to do. Thanks for the advice I'll get at it now. I don't know why but my Timer doesn't seem to be resetting after the first 5 seconds. Using Studio 5000 on AB yes.

Your timer will only reset if you tell it to....

You can either....

1. Put XIO Timer.DN in front of it... When it's done, it breaks the rung, and the timer resets, also resetting the .DN bit so that the timer restarts.

2. Put a RES instruction, driven by the Timer.DN bit
 
Thanks so much for the advice guys. Currently have the flasher routine working, turns out it wasn't faulty. Only problem seems to be that the accumulated value on my first timer on delay is going really high, even though I have the preset set at half a second. From the help contents I thought the accumulator was meant to reset once it reached the preset value. What have I missed that is causing this ?
 
Is this a Siemens PLC? If so look at the clock memory in the hardware setup. Basically a byte with bits pulsing at different frequencies.

If not, set a timer or timed task for whatever time base you want (100ms, 500ms or 1s) and increment an integer very time the timer expires or the task runs.

Use the bits in that Integer to pulse at whatever frequency you like.

It takes a little bit more work than a single timer, but you get as many frequencies as you would like in one go. This can be useful if the same PLC controls different areas and you want to differentiate between them or if you have the need to blink a light at different frequencies like for alarms or something like that.
 
If you want it off for a certain time and then on as per your post, then you can use a GRT instruction. For instance, you said 5 seconds on and 5 seconds off. So, set your timer preset (in the timer) to 10 seconds. Have an XIO done bit in front of the timer on the same rung. Put a branch, and put the GRT instruction in front of your OTE that you want to come on (Motor). In value "A" of the GRT, put in Whatever you named the timer and the subscript .ACC. In value "B" put in 5 seconds. When the timer reaches 5 seconds + then the GRT will come true, fire the OTE. When the timer times out, it will reset itself with the .DN bit changing state briefly, and the OTE will be off until 5 seconds accumulates again, etc. etc. Hope this helps. Good luck.
 
A bit off the wall, but this can be done with one instruction..

But you have to put this rung in a periodic task with a period of 5000 mSecs.

In my example I am using XOR to toggle bit 0 of my output module. Doing so does not affect the other bits in the module, so they can be used as normal....

2018-01-12_112913.jpg
 
In ST for most PLCs:

MyTimer.PT:= T#10s;
MyTimer.IN:= NOT(MyTimer.Q);
MyTimer();
Motor:= (MyTimer.ET > T#5s);


In ST for Rockwell:

MyTimer.Pre:= 10000;
MyTimer.TimerEnable:= 1;
MyTimer.Reset:= MyTimer.DN;
MyTimer();
Motor:= (MyTimer.ACC > 5000);
 

Similar Topics

hello guys is there any 1 millisecond pulse generator in the rslogix5000 inbiult
Replies
9
Views
9,948
Hi, I’m looking for some feedback on the best way to develop a one second pulsed (one shot) internal bit that is as accurate as possible, I am...
Replies
9
Views
6,021
Dear All, We have to read the time gap of two rising pulse which is in micro second how can we do it in plc.(any plc) thanks in advance.
Replies
6
Views
2,142
please help what is the equivalent of m8013 of Gx developer in KV builder? i need to have a one second pulse. also can't find the comparator...
Replies
0
Views
1,468
Hello, I am using step7 and I require a one second pulse. I don't think there are any system bits that I can use. Does any one have a suggestion...
Replies
2
Views
1,877
Back
Top Bottom