You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 14th, 2015, 10:42 AM   #1
jkerekes
Member
United States

jkerekes is offline
 
jkerekes's Avatar
 
Join Date: Aug 2007
Location: NJ
Posts: 2,155
ControlLogix Tag Updating Question

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,SystemF lags)OTL(SystemFlags.[FlagReference]);
Attached Images
File Type: jpg 2015-02-14_11-37-33.jpg (4.9 KB, 98 views)
__________________
John
  Reply With Quote
Old February 14th, 2015, 04:16 PM   #2
Basti504
Member
Netherlands

Basti504 is offline
 
Basti504's Avatar
 
Join Date: Apr 2008
Location: Netherlands
Posts: 27
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
Attached Images
File Type: png command_mov.png (4.6 KB, 86 views)
  Reply With Quote
Old February 14th, 2015, 07:23 PM   #3
jkerekes
Member
United States

jkerekes is offline
 
jkerekes's Avatar
 
Join Date: Aug 2007
Location: NJ
Posts: 2,155
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.
__________________
John
  Reply With Quote
Old February 14th, 2015, 09:33 PM   #4
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,412
actually a periodic task in capable of interrupting the so-called "continuous" task even part way through an ADD instruction ...

if this type of behavior is causing a problem you might try experimenting with the UID and UIE instructions ... (User Interrupt Disable and User Interrupt Enable) ...

http://www.plctalk.net/qanda/showthr...0&postcount=64

.
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.

  Reply With Quote
Old February 15th, 2015, 10:11 AM   #5
jkerekes
Member
United States

jkerekes is offline
 
jkerekes's Avatar
 
Join Date: Aug 2007
Location: NJ
Posts: 2,155
Thanks, Ron. I forgot about the disable/enable interrupt instructions. That may be what I need to add to that rung.
__________________
John
  Reply With Quote
Old February 15th, 2015, 11:21 PM   #6
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 5,218
Quote:
Originally Posted by jkerekes View Post
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
__________________
------------------------------------
How to ask questions the SMART Way!

Look First, Ask Second!

  Reply With Quote
Old February 16th, 2015, 08:23 AM   #7
jkerekes
Member
United States

jkerekes is offline
 
jkerekes's Avatar
 
Join Date: Aug 2007
Location: NJ
Posts: 2,155
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.
__________________
John
  Reply With Quote
Old February 17th, 2015, 12:21 AM   #8
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 5,218
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?
__________________
------------------------------------
How to ask questions the SMART Way!

Look First, Ask Second!

  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
simple tag server question bulletin blues LIVE PLC Questions And Answers 2 March 1st, 2014 06:18 PM
Controllogix tag security Paul351W LIVE PLC Questions And Answers 9 January 25th, 2012 09:55 AM
Red Lion Crimson 3 ControlLogix Driver Question glubash LIVE PLC Questions And Answers 4 January 19th, 2012 01:52 PM
Question about AB ControlLogix 5000 unusual issue cipitio LIVE PLC Questions And Answers 16 August 29th, 2009 11:24 AM
ControlNet MSG communication question for Controllogix coolblind LIVE PLC Questions And Answers 4 April 25th, 2008 10:02 PM


All times are GMT -5. The time now is 12:33 AM.


.