Code to decrease force when pulse count is 7000

K

Thread Starter

Kenny Dada

I am trying to write code that when a count reaches certain number it should reduce the force by 25.

In my first line of code whenever the pulse count is 7000 the force decreases by 50. The problem is that my count could be 7000 for a second and plc could scan through the codes execute X numbers of times in a second. Meaning that you would be subtracting 50 times X number of times before it goes to 7001. How do i make sure that my initial settings will not be overwriting my changes every program cycle. Any inputs will greatly be appreciated.
 
K
>Set a latch that disables the rung and reset before the next event.

Can you please explain this to me.....i am a little bit confused. Once again thank you for your help
 
C

Curt Wuollet

Ok, lets take the rung you have that becomes true at or over 7000. Now add a latch or set/reset coil in parallel with the output so that it will latch when the rung is true. Put a NC contact from that latch in series with the rung. Now when you hit 7000 the rung will activate once which will decrease your force by 25 or whatever _and_ set the latch which will open the NC contact and the rung will not activate again until you reset the latch. You can do this when it makes sense in your application.

Regards
cww
 
T

Tony R. Gunderman

Many PLCs have a one-shot instruction that you could use. The OSR instruction in RSLogix or the OS instruction in a SIMATIC 505 PLC are a couple of examples. Basically, the output of these instructions will only be on for one ladder scan when the input to the instruction transitions from false to true. The instruction only outputs on the transition, so the input condition must transition back to false before it will execute again.

Regards,
Tony R. Gunderman
 
Top