Plc counter code
Plc counter code
(OP)
Could someone give me some ideas I would like to capture the pulse time for a pulsing input to A PLC, and would like to maitain the time for evaluating untill the next pulse.Just need some help with ladder instructions.





RE: Plc counter code
RE: Plc counter code
example
input pulse change over 40msec
scan time less than 20msec
This example will work
Are you asking to check for a fault if missing pulses?
If so, then use the pulse to reset a timer over a length of time. If the timer times out you set a latch bit, flag an alarm bit.
or
start a timer on transistion of the pulse going true, when it goes true again move the accumulated time into the beginninng of an array. Copy block the array down 1 position for the whole array.
rinse repeat
what you should see is the array filing up with the time between pulses, if the plc is able to capture it.
RE: Plc counter code
So the first command in your ISR would be to move the timer accumulator value into a word, the second command would be to reset the timer. The word value would contain the most recent pulse interval.
RE: Plc counter code
The code I added was like what i have in the link below. the problem is the reset does not reset the ACC of T4:10. In fact when I test that rung the count never makes it to my N7:2 file, If I AFI that rung my counter continues to count and shift the values to my two N7 files.
http://pi
RE: Plc counter code
Does your knife have a "home" position sensor? It should not go several revolutions, if you stop it at the home.
RE: Plc counter code
Right before it triggers the rto during the transistion, do the reset (use a oneshot of the input), its a rung order problem. You would also break the enable on the rto with the reset right before. Also move the data at the reset rung of the rto.
You might be missing the pulse on the plc input like someone was saying, is why you think it went 4-5 revs and you did not see it. Look at the specs on the input card see if it is even capable of seeing a pulse at this speed.