Timing of ControlLogix Tag Updates

Dan123

Member
Join Date
Sep 2014
Location
California
Posts
17
Hi,

This seems like a simple question, but I haven't been able to find a clear/definitive answer so far -- when writing a value to a PLC tag through an external application (through OPC-UA), when will that tag update in relation to the PLC scan?

More specifically -- should I worry about one of my tags changing in the middle of a routine? I have a continuous routine where one bit is being set externally by Ignition. Once this bit has been set, I would like to check it in multiple places in my routine, then clear it at the end of the routine. This will be an issue if it is possible for that bit to update during the scan of the routine, because then only a portion of my routine will see the set bit.

I know I could create another intermediate bit to latch the external bit for one cycle, but I still would like to know about the timing as I've run into similar questions on some other projects as well.
 
I believe that the communication update is asynchronous to the scan cycle, so you could have the tag change mid-scan. Disclaimer: I'm not basing this on a documented fact, only that I've had the sort of issue you describe, and after extensive testing, the only possibility left (as far as I could see) was a tag updating partway through the scan.

For this reason, whenever I do any commands from a HMI, I create a SCADA routine and do this for each and every button:
Code:
| HMI_PB_Start                   HMI_PB_Start       HMI_Start
|-----| |----------------------------( U )------------(   )--|

(note - the buttons on the HMI should be a "set" or "latch" type, not momentary - although it will work to a degree even if they're momentary)

I never, ever use the "PB" tag anywhere else. I use the other bit throughout the code. That means that my HMI_Start bit will be on for one complete scan of every rung, no matter when the HMI updates the PB tag, and also means that it's very easy to track down your HMI controls if someone is looking for them.
 
Should I worry about one of my tags changing in the middle of a routine?

Absolutely yes. The ControlLogix Tag Database is updated totally asynchronous to the program execution.

It's possible to have a tag update in between rungs, or even in between instructions.

If you have data that needs to be processed by a routine without the possibility that the source data is changed, it needs to be copied to a "scratchpad" tag.

The Copy Synchronous (CPS) instruction exists for exactly this reason.
 
I also like using a set/latch on the HMI buttons to trigger the PLC functions, which then unlatch the tag. This also help to prevent issues with there being a hiccup in the communication between the PLC and the HMI, where perhaps the HMI button (momentary) isn't on long enough for the PLC to actually see it being on.

I've implemented it similarly to what ASF describes above, and I've also done it (less frequently) where I have a routine that is called at the very end of my program that just zeroes/resets all of those sorts of values.

This is also why you'll see people do things like have a routine at the very beginning of their PLC scan that copies all of their PLC inputs (digital and analog) into local working memory (doing whatever conditioning/scaling is necessary) so that everything in the logic part of the program is working with variables from the same time reference. Then do something similar with all of the outputs at the end of their program.
 

Similar Topics

Hi all, I want to show on a SCADA the time it take my ControlLogix to send and receive Messages to five AB504 PLC's. Does anyone have a...
Replies
1
Views
3,739
Hello, I am struggling to figure out some logic. I have an analog pressure sensor coming into the PLC and would like to have multiple timing...
Replies
4
Views
150
the plant I am supporting uses a siemens graph function to do some of the step procedures. in several steps it waits for the step to execute for...
Replies
1
Views
765
All Using a MicroLogix 1400. Not a huge program doing an auto stop function based on a calculated roll diameter Using encoder feedback for...
Replies
12
Views
3,234
Hi all, I'm trying to fully understand the different effects of the Loop Update Time parameter within the Logix PID instruction. I was always...
Replies
18
Views
4,595
Back
Top Bottom