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.
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?
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.
Now, what you may want instead, is to subtract 50 from the force whenever the threshold has been met or exceeded for seconds.
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:
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.