Better than 1s time resolution on Red Lion Graphite?

Epy

Lifetime Supporting Member
Join Date
Jul 2012
Location
no
Posts
376
We often use the Red Lion Graphite series as a PLC since it can easily handle the extra workload in scripts. So far it's worked out nicely. But now, needing to do PID control with less than 1s update rate. I know I can run this in the On Update section, which is supposedly run 10 times/second, but I don't want to just say each update is exactly 100 ms apart because I know that's not going to be the case. Is there any way to get more accurate time resolution on these? Without the control module....
 
Should've added, do not have a PID module. Doing the PID myself with the analog output module.
 
You're correct about On Update, it runs each time the display is redrawn. This is usually around 10 times a second, but can vary depending on how loaded down the system is and how complex the display is.

You could try running a background program with an infinite loop, and use the Sleep function at the end of the loop body. This gives "millisecond" resolution, but I wouldn't push it too low and also expect some jitter.
 
Last edited:
Here's something you can try...

Make a program with this code
Code:
while(true){
    Sleep(50);
    ThisTag := !ThisTag;
}
Add it to the global On Startup action to get it running. Be sure to set the Execution Task to Background or it will lock up your unit. Replace 50 with whatever time you want in milliseconds; ThisTag will now toggle at this rate continually.
 
That's an interesting question. Haven't tried it, but maybe this would work:

Use the Comms Delay in the PLC protocol; say 500ms.
Create a tag that reads from a ms counter in the PLC, so the HMI tag will always change every 500ms update.
On that tag, use the Trigger On Change to run your PID code.
 
Here's something you can try...

Make a program with this code
Code:
while(true){
    Sleep(50);
    ThisTag := !ThisTag;
}
Add it to the global On Startup action to get it running. Be sure to set the Execution Task to Background or it will lock up your unit. Replace 50 with whatever time you want in milliseconds; ThisTag will now toggle at this rate continually.

Just curious.
If it's set to background, do you think that it will run every 50ms?
Ie. would it get way off if you load a screen with heavy PLC comms, or when another (non-background) task runs?

I just assumed background to be random, unreliable. But maybe all the code runs so fast that it doesn't really matter.
 

Similar Topics

I have a 10k load cell with signal conditioner that I need to read on a PLC. I can buy a Micrologix that only go up to 12 bit (4095). So the...
Replies
10
Views
2,861
I have a micrologix 1100 and a LVDT displacement sensor. The sensor can measure from 0 to 2in. It has 0 to 10V output and I was going to use it...
Replies
1
Views
1,333
Good Afternoon , It seems like we always have problems with using Type J Thermocouples with our slip rings . Would using a RTD at 10...
Replies
6
Views
1,639
I am beginner in B&R Automation Studio and TIA Portal. Have an experience in electrical part of PLC cabinets. Now its time to get a new skills...
Replies
8
Views
1,667
Bla Bla Bla, why doesn't it work, l need help and l don't understand PLC's. Or better they understand everything, but can't understand +1 -1 = 6...
Replies
22
Views
6,004
Back
Top Bottom