id10t_error
Lifetime Supporting Member
From what I can tell the STI timed interrupt in 500 is a real hardware interrupt, correct me if I'm mistaken. I currently use this for exact averaging calculations or PID timing as it jumps to my interrupt routine every time the STI clock expires.
So, the periodic tasks in Studio 5000 seem to be a software interrupt queue or stack where the priority can be set? I'm trying to think of possible errors I can unknowingly induce when needing exactly timing logic when Studio 5000 is stacking/queuing event priorities.
Example: Let’s say a particular periodic task named code1 has a priority of 1, a I/0 tag event task named code2 has a priority of 2 and another periodic task named code3 has a priority of 3 exists in our little program. Thus, we have,
code1 = periodic task = priority =1
code2 = event task = priority 2
code3 = periodic task = priority =3
When code3 triggers and is mid execution, code2 just so happens to trigger which causes the plc to jump to code2. While code2 is in mid execution, code1 just so happens to trigger, causing the plc to jump to code1. Not until code1 finishes will it return to code2 and will return to code3 after code2 finishes. Is this correct as explained in the documentation, or are priority numbers separate from I/O event tasks and priority event tasks where I/O event tasks take priority over periodic and vica-versa?
I'm trying to read all the documentation I can find but I can’t find anything on the studio 5000 PLC processors and if they have modern processor capabilities such as multithreading. Are up to two events simultaneously threaded though while the main program executes on another thread or is it still the same where each piece of code is executed one by one.
So, the periodic tasks in Studio 5000 seem to be a software interrupt queue or stack where the priority can be set? I'm trying to think of possible errors I can unknowingly induce when needing exactly timing logic when Studio 5000 is stacking/queuing event priorities.
Example: Let’s say a particular periodic task named code1 has a priority of 1, a I/0 tag event task named code2 has a priority of 2 and another periodic task named code3 has a priority of 3 exists in our little program. Thus, we have,
code1 = periodic task = priority =1
code2 = event task = priority 2
code3 = periodic task = priority =3
When code3 triggers and is mid execution, code2 just so happens to trigger which causes the plc to jump to code2. While code2 is in mid execution, code1 just so happens to trigger, causing the plc to jump to code1. Not until code1 finishes will it return to code2 and will return to code3 after code2 finishes. Is this correct as explained in the documentation, or are priority numbers separate from I/O event tasks and priority event tasks where I/O event tasks take priority over periodic and vica-versa?
I'm trying to read all the documentation I can find but I can’t find anything on the studio 5000 PLC processors and if they have modern processor capabilities such as multithreading. Are up to two events simultaneously threaded though while the main program executes on another thread or is it still the same where each piece of code is executed one by one.