Single vs. repeated rung execution

Epy

Lifetime Supporting Member
Join Date
Jul 2012
Location
no
Posts
376
This is probably a newbie question, so bear with me.

I've been noticing that some things need a one-shot (ONS) so that they only get executed once, while others do not.

For instance, a count-up (CTU) block only counts up once when it is activated, but if you tried the same behavior with a MOV or COP, it will do it every time the rung is true, correct?

Is there a general rule of thumb to what is executed once and what isn't? Or is it just a trial and error learning experience type of deal?
 
Is there a general rule of thumb to what is executed once and what isn't? Or is it just a trial and error learning experience type of deal?
I say that there is a general rule of thumb: First read the manual (some say RTFM) to find out how each instruction works. Then verify those instructions through experience.
 
do you want to just KNOW it? - or really UNDERSTAND it? ...

probably a better question to ask would be:

what makes the CTU (Count Up) instruction count only ONCE - even though the rung conditions stay TRUE for multiple scans? ...

investigate the operation of the CU (Count Up) bit – and once you understand that piece of the puzzle, then many other pieces will start falling into place ...

 
This is probably a newbie question, so bear with me.

I've been noticing that some things need a one-shot (ONS) so that they only get executed once, while others do not.

For instance, a count-up (CTU) block only counts up once when it is activated, but if you tried the same behavior with a MOV or COP, it will do it every time the rung is true, correct?

Is there a general rule of thumb to what is executed once and what isn't? Or is it just a trial and error learning experience type of deal?

I think what Lancie is getting at is it is manufacture specific, so to be certain how an instruction operates it is best to actually read about that instruction specific to that sofware. Some manufacturers have counters that WILL continue to count as long as the rung condition remains true i.e. Unitronics. Unitronics also does timers differently, they do them in decrementing fashion instead of incrementing fashion (much to my irritation).

Omron gives you the ability to make many block execute on transitions. Simply by putting the @ symbol ahead of the MOV instruction will cause the instruction to execute on a one-shot intead of purely on the RLO.

If it were up to me, all function blocks would give a visual indication somehow (like the @ in Omron) of whether it is a one-shot execution or not.

In any event, never assume anything. In RsLogix it is as simple as highlighting the instructin and pressing F1.
 
Thanks guys. And sorry, should've specified I was referring to RSLogix.
 
Thanks guys. And sorry, should've specified I was referring to RSLogix.
Then as Damian says, help is just an F1-click away. From the RSLogix top menu bar, click on "Help", then "SLC Instruction Help" then "CTU" for the CTU counter instruction.
This output instruction counts up for each false-to-true transition of conditions preceding it in the rung...
Rockwell Software
That means the CTU acts as a one-shot. It only counts "1" for 1 off-to-on. It is the change, or transition from off-to-on that causes the count, not the fact that the trigger is ON. If the input trigger goes ON but does not go back OFF, you only get one count.
 
Last edited:
Asked for a general "rule-of-thumb", so here goes....

Any instruction that has a "Control" register, (eg, Timers, Counters, FALs, etc.) will almost always need a false-to-true rung transition to make them operate again.

Instructions that have no control register will execute every time they are scanned when the rung continuously evaluates as truem (eg. ADD, SUB, MOV, etc.)

There may be exceptions to this, but trying hard to think of any.

Just thought of one - ONS - but the assigned BOOL acts as the control register for this instruction.
 

Similar Topics

Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
78
I am converting a SLC 500 to a Compact Logix. I plan on using a Compact Logix 5380 with conversion Kit. The problem is that the analog input cards...
Replies
1
Views
146
Hello, friends, I am trying to upgrade a system that uses an Onrom incremental encoder (E6B2-CWZ6C) connected to a Danfoss VFD (FC360), but now...
Replies
4
Views
271
Hello, I am using Unity pro V15. I have Quantum CPU 671 and Ethernet NOE 77101 configured. I have configured IO scanning on NOE. I have attached...
Replies
5
Views
173
What would happen if you ran a 60Hz Single Phase Motor on 50Hz supply?
Replies
6
Views
526
Back
Top Bottom