ControlLogix Tag Updating Question

jkerekes

Member
Join Date
Aug 2007
Location
NJ
Posts
2,362
I have a rung in a ControlLogix processor running in the continuous task. When the Step tag is a certain value it latches the corresponding bit number in the SystemFlags tag. This is existing code which I did't write.

In another periodic task, running at 100ms, the set bit is used as permissive to other logic. What appears to be happening occasionally is that since on every scan the flag word is being set to zero, the periodic task "sees" the SystemFlags.xx bit as cleared. I understand the asynchronous nature of ControlLogix. Is what I'm describing possible?

LIM(1,Step,20)MOV(Step,FlagReference)MOV(0,SystemFlags)OTL(SystemFlags.[FlagReference]);

2015-02-14_11-37-33.jpg
 
I encountered something similar during a recent project.

In the continues task:
* A rung where unconditionally a 0 is MOVed into a command DINT
* The rungs below will move the correct command number based on curtain conditions. Meaning a 1 was "Motor forward", 2 "Motor reverse", 0 "stop".

This command number was used in a Periodic Task to drive a motor.

We noticed that while the command DINT was constantly MOVed with 1, sometimes the motor stopped for a fraction of a second. In the end we moved the rungs where the command was formed to the periodic task and the problem was solved.

We concluded that the CPU sometimes executed the periodic task right between the unconditionally 0 MOV, but before the actual command was MOVed again.

In the end it seems like the CPU interrups the continues task at ANY moment to execute a higher priority task. Exceptions I have read about are CPS instructions.

Hope this helps :)

command_mov.png
 
Yes this looks like a similar issue. I didn't write the piece of code, but I think it's causing an issue in another area of the program. I'm just trying to confirm this behavior. Thanks for the input.
 
Thanks, Ron. I forgot about the disable/enable interrupt instructions. That may be what I need to add to that rung.
 
Thanks, Ron. I forgot about the disable/enable interrupt instructions. That may be what I need to add to that rung.

Nope. That won't help a bit with your current situation.

You described the situation as the value of the SystemFlags tag is changed by the continuous task, and sometimes you aren't reading the value you want in the periodic task.
Disabling interrupts won't help there at all.

You need to change your core logic to prevent zero writes to your Flags tag perhaps, or maybe even buffer it when it has a valid value, and set a latch bit so that the periodic task will only look at the value if the latch bit is set. Then the periodic routine can reset the latch, allowing the continuous task to load a new value into the "Buffered" flags word.


Continuous task:
(when SystemFlags is valid):

XIO FlagsLoaded MOV SystemFlags FlagBuffer OTL FlagsLoaded


Periodic task:

XIC FlagsLoaded (use your flags word somehow)

OTU FlagsLoaded

-------------------------

Seriously, I'd re-think the core logic. Use your sequencer to set an enable (preferably latched) for your periodic task
 
OK. Then I have a misconception on how it works then. Can you briefly explain why disabling the interrupts won't allow that rung to complete executing before the periodic task reads the tag?

Unfortunately, we can't change significantly the code at this point in time. What we may do instead is use the value in an EQU instruction.
 
Disabling the interrupt will not prevent the continuous task from updating the tag.

Then when the periodic task is scanned again, you still have no idea where in the continuous scan it is using the tag.

The best method to use would be to pull the routine out of the periodic task that is looking at that tag, and dropping it in to your continuous task immediately the routine where it is updated to become valid.

Use it in an EQU ? What, to make sure it is not zero? What if it is (and by Murphy's law, it will be) zero 300 times in a row?
 

Similar Topics

Hi all, if I remember correctly, there is some way in a ControlLogix (or CompactLogix) where you can sort of map tags into SLC addressing format...
Replies
8
Views
1,107
Is it possible to dynamically change Tag Names (in real-time) on these PLCs? I'm guessing the answer is "NO", right? Just externally, then...
Replies
10
Views
3,783
I'm new to the forum and would like to say thanks in advance for any help you guys can give me. I'm relatively new to plcs but have a strong...
Replies
5
Views
2,590
Good Afternoon, I should know the answer to this . I have a 1756- 4-20 ma input card with spare inputs .I would like to add a new Analog...
Replies
3
Views
1,803
I am trying to connect 1756-L65 clx to a PV550 via Controlnet but I keep getting "Error(9005)" which is an invalid tag when I try to save the...
Replies
5
Views
2,012
Back
Top Bottom