ControlLogix FOR Instruction with Timer

ohnedich6

Member
Join Date
Jun 2014
Location
Midlands SC
Posts
67
Good day all,

I was hoping the forum could help me with something I've been wondering (I looked through the Forum's Search function but did not find anything).

If I am running a FOR instruction in ControlLogix's Ladder logic, Version >= 20, and I have a timer in the Routine that the FOR instruction is calling how does it react? If the Timer is Enabled does it finish timing before the FOR instruction will continue on to the next Index in the array? I want to say the answer is "Yes", but wanted to hear it from the "horses mouth" so to say.

Thank you.

-Nathan

ControlLogix FOR Instruction with Timer.jpg
 
your answer is NO
The timer ACC will update with each loop the timer itself will continue to run in the background The loop will not be held up whit the timer runs
 
labeledas,

I was trying to use index arraying to have, let's say, PbAuto as a Bool[32] & AutoTmr as a Timer[32] that I could write one line, or two, of logic and just index through it depending on Task scan rate to UnLatch the tag that was set by an HMI. I would not need the Scan to hold while the Timer times before it proceeds onward.

This is just a "what-if" situation for me that I was curious if/how it would work.

Thanks all.

-Nathan
 
Looping in a PLC is rarely a good idea. The PLC runs in a loop by design. It is better to enter a thousand lines of straightforward code than to try to be slick and save yourself some keyboard time...at the expense of simplicity and ability to understand and make changes in the future.
 
I *believe* what you are attempting to achieve is to ensure you "see" all the HMI pushbuttons.

A sure-fire way to do this is to have your HMI buttons configured as "Set ON", and just leave it to the PLC to see it as and when, fire an internal bit ON (this bit will be true for one complete scan after this), then unlatch the HMI bit. See the picture...

2017-06-25_170835.jpg
 
FYI the above FOR loops through 128 buttons, and execution time is approximately 1mS

2017-06-25_171127.jpg
 
I *believe* what you are attempting to achieve is to ensure you "see" all the HMI pushbuttons.

A sure-fire way to do this is to have your HMI buttons configured as "Set ON", and just leave it to the PLC to see it as and when, fire an internal bit ON (this bit will be true for one complete scan after this), then unlatch the HMI bit. See the picture...

Daba,

I would be using a "Set On" button on the HMI but I was curious as to how a FOR loop would act if I had an array of Auto Pushbuttons that Unlatched themselves after so long via a Timer in the PLC.

This is just a what-if situation that I've been wondering about for a while now and just thought I'd ask the collective here on the forum for input.

-Nathan
 
Daba,

I would be using a "Set On" button on the HMI but I was curious as to how a FOR loop would act if I had an array of Auto Pushbuttons that Unlatched themselves after so long via a Timer in the PLC.

This is just a what-if situation that I've been wondering about for a while now and just thought I'd ask the collective here on the forum for input.

-Nathan

I think you are thinking too deep - an HMI button will act as you configure it, and why would it unlatch itself via any timer, HMI or PLC ????

A button has been pushed, it's up to the PLC to deal with it. I don't think any "time" is involved, so why the need for a "timer".

A button push is an asynchronous "event" that can occur in real-time, the PLC code has to decide whether to act on that event according to the specification.
 
what HMI are you using
Set the HMI button to monetary when the button is pushed the bit in the PLC is when the button in the HIMI is released the bit n the PLC is cleared
no scan in the PLC is required
you can also set the HMI button to maintained push on push off simple
 

Similar Topics

Hi everybody, I would like to establish an Ethernet connection between my ControlLogix 5555 (rev.16.21) and a raspeberry pi (Linux). I want to...
Replies
13
Views
2,957
Hello all. I need some help setting up a MSG instruction to transmit 10 bits of data from a compact Logix processor to a micrologix 1400. I have...
Replies
31
Views
19,932
Good Morning , I'm working on trying to get timestamping done on some doses. I am very close, thanks to many of you with your advice. I...
Replies
7
Views
2,600
Does a MAG instruction in a controlLogix gear the master to the slave with drive resolution counts or to the conversion constant? i have a MAG...
Replies
1
Views
1,836
All I am studying a PLC program from another facility. It uses an SSV instruction and a GSV. Data in SSV, GSV as follows...
Replies
4
Views
7,388
Back
Top Bottom