Program Issues. May be scan time related

Bullzi

Lifetime Supporting Member
Join Date
Jun 2012
Location
Colorado
Posts
1,530
Hi All,
Working a strange problem. Here are the basics:
PLC: ControlLogix L73
Firmware: 21.1

I have created what is the largest program that I have done to date. It controls about 20 wells and collects the data from the meters on the wells.

The control side of things seem to work very good. No big issues.

I am having issues with the Data Collection side of things. Here is some background. I am reading all the meters via HART to get the totalizer number. I to get the flow for the day I subtract the start of day total from current totalizer. I then move that number into a array element that matches the day of the month. So for today it would be Array[5].
At Midnight I run a routine that will move the previous days array element into a tag that is read by the Factory Talk ME Historian Module. I also move the current totalizer into the Start Total tag to create a new start of day total to determine the new daily total.

What is happening is most of the time I get a volume moved into the FTVME tags that is very small. Like .023xx when the daily total is more like 850 +.

So I have set up that part of the program in my test PLC (L73 also) and have been running it for days with no issues. To be honest I did make some very small changes but nothing to the way the system works. The only major thing between the test unit and the real unit is that I am only using a small part of the program. I cant install the complete program as it has way more I/O than my test unit and hast remote I/O too.

So with that info (and I pray that I explained it properly) would you say that scan time could be a issue? IF so what ideas would you have to correct this? Would you recommend putting the Data Program in a timed task? Right now they are all in continuous tasks. Anything you can think of for me to try and I willing to try it. I have to go back in a couple weeks so I would like to have some ideas on what to try.

Thanks for taking the time to read this novel and if you can help I would appreciate it.
 
things that come to mind

Is the small amount that you are seeing is similar in value to say 1 second of production?
If so then it is possible that you are re triggering the capture and the Previous days value is being overwritten?

Try adding a simple Trigger Counter to see how often the trigger is occuring

Sometimes it is useful to store all of the received HART values into a large circular buffer to assist fault finding
 
Last edited:
Have you measured the scan times for every program run within the continuous task? What are they looking like?
 
The Program that is doing the data manipulation and transfer is running on my test unit at 2635us max now. I am not at the plant to look at the real PLC.

What is a scan time that I should be concerned with?
 
Just a update on this.

I moved that program to a Periodic Task with a 50ms update rate and priority of 1. As soon as I did that the system worked perfectly. I am not 100% sure why this works but the original continuous task did not work. I have to think that the scan time of the main task was interfering with the delicate timing required for the change to happen.

If you have any ideas why this is happening please chime in and give me your ideas. I am happy it is working but really want to know why so I can avoid this next time.

Thanks for the help.
 
Just a update on this.

I moved that program to a Periodic Task with a 50ms update rate and priority of 1. As soon as I did that the system worked perfectly. I am not 100% sure why this works but the original continuous task did not work. I have to think that the scan time of the main task was interfering with the delicate timing required for the change to happen.

If you have any ideas why this is happening please chime in and give me your ideas. I am happy it is working but really want to know why so I can avoid this next time.

Thanks for the help.

This is why most people doing a program of any real size will just delete the continuous task and schedule and prioritize the periodic tasks as they need them to work.
 
Just a update on this.

I moved that program to a Periodic Task with a 50ms update rate and priority of 1. As soon as I did that the system worked perfectly. I am not 100% sure why this works but the original continuous task did not work. I have to think that the scan time of the main task was interfering with the delicate timing required for the change to happen.

If you have any ideas why this is happening please chime in and give me your ideas. I am happy it is working but really want to know why so I can avoid this next time.

Thanks for the help.

I'm working from memory of a post I read from Ron Beaufort. Have you ever tried to look through all his posts to find the one you are looking for?? But here goes...

Continuous tasks are actually the last task the processor allocates resources to. If the processor is in the middle of a "continuous task" and it is time for a periodic task to update, the processor will pause the continuous task, run the periodic, then resume the continuous task. If you have several periodic tasks with short update times, the so called "continuous task" can be interupted many times before it reaches the end.

I don't write large programs, but I do have to often try and understand what the programmer was thinking in them. One thing I have learned is that the really important stuff will be in its own periodic task, and the continuous task is used for the less important stuff.

Hope this helps,
Will.
 

Similar Topics

Hey guys, So I'm adding a new HMI alarm and so I had to update alarm text in winCC. I compiled and went to download and get an error for...
Replies
3
Views
1,604
Hey guys, I have probably gone through 3 different forums looking every type of answer anywhere close to what I have, and I just cannot find a...
Replies
5
Views
1,975
This program is part of a "Saw" type of device we designed. The program consists of a bunch of games within the device to escape from, but I'm...
Replies
7
Views
4,260
We installed a dual camera vision system a little over a year ago. The customer finally got around to using it recently. They called me in the...
Replies
11
Views
7,647
Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
0
Views
54
Back
Top Bottom