Latches

This what i am trying to do....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.
 
There are many easy ways to do this. You'll need to tell us which PLC you are using for this.

For example, on a PLC5 you would use ONS (one-shot), on a SLC you would use OSR (one-shot rising).
 
is the inital setting only present for the very first program scan of the plc? because im not sure of the details but i believe theres a first scan flag thats set when the plc preforms the the very first scan.

if you can tie in that status flag to set the inital value, then use its status to control the OSR function?
 
This what i am trying to do....In my first line of code whenever the pulse count is 7000 the force decreases by 50.

The following will subtract 50 from the FORCE variable once each time the PULSE_COUNT variable is greater than or equal to 7000. So, if it stays at 7000 or rises from there, it will only happen once. If it dips back and forth between 6999 and 7000 eight times, for example, then you will be subtracting 50 eight times.

attachment.php


Now, what you may want instead, is to subtract 50 from the force whenever the threshold has been met or exceeded for (n) seconds.

attachment.php


1shot_a.jpg 1shot_b.jpg
 
Last edited:
Maybe this might help. As soon as the system comes on the initial value is 500 (force),which we want to keep throughout the program, know i have a counter that counters pulses per ft,when the pulse equals let just say 3 i want the force to decrease by 10, by i only want this to happen once when that rung is true
 
I'm a little confused as to what you're trying to do, or rather when you're trying to do it. If you're looking to set a value on the first scan, you need to use S:1/15, the first pass bit.

A one shot is used when you only want something to happen only once every time the logic goes true. So the count for you would need to hit 7000, you'd subtract 50 ONCE, then your logic would need to go false, then true again to subtract another 50. In your case it would be like:

Based on your above example I have this code.

First Pass and One shot.jpg
 
Last edited:
I am using Allen bradley's RSlogix 500

RSLogix500 is programming software. Its used to program
SLC5/01,02,03,04,05 and Micrologix series of PLC's ML1000,1100,1200,1400,1500. Which one do you have? It makes a difference on the available one-shot instruction that they support.
 

Similar Topics

So I know there is a lot of material on here about latch and unlatch topics, but I didn't find anything that helped shed some light on a problem...
Replies
18
Views
4,550
I was wondering was considered good practice when it comes to programming. When I first started out doing ladder, I went crazy with my Latch /...
Replies
70
Views
38,544
need help i know traffic light latch on for crosswalk but kinda stumped
Replies
1
Views
1,370
Greetings to all, for those who aren’t totally tired of the “latch or don’t latch” discussion in this recent thread, here is one more little item...
Replies
38
Views
45,247
Back
Top Bottom