
EthernetJP (Customer) asked a question.
I have been trying to diagnose what I consider unexpectedly high scan times with the Productivity 2000 PLC, specifically the P2-550, though based on specs I suspect nothing in the Productivity family will perform much differently.
I'm not blaming the User-Defined Instruction. I will not be surprised to learn that this is operator error. Either way, what I can say with certainty is that my use of the UDI results in drastically slower scan times when compared to the same logic just running in a task.
CPU: P2-550 running firmware version 1.3.0.6
Productivity Suite Programming Software, version 4.6.0 (37)
I have 24 instances of the same UDI in one of my Tasks.
With the "UDI Task" in the Run Every Scan folder, my average CPU scan time is 73 ms. With only 12 instances of the UDI in that same task, average CPU scan time drops to 38 ms. With the entire Task moved to the Disable Task folder, average CPU scan time is 3.6 ms.
First idea: split UDIs into groups and conditionally enable each group so that every scan only a subset of the UDI instances are executed.
This improved scan time but hosed up the timers in the UDI.
*Skip past some ideas that didn't bear fruit.
Latest idea: recreate the UDI ladder in a Run Every Scan folder.
Directly address array indices e.g. DataArray(1)
Scan time increased from 3.6 ms to 3.8 ms.
Now create 10 copies of this task and place them in the Run Every Scan folder.
Scan time increased from 3.8 ms to 5.1 ms.
Now modify task to leverage indirect addressing e.g. DataArray(Index).
Scan time increased from 5.1 ms to 8.6 ms.
Now increase number of Task copies from 10 to 24, still using indirect addressing.
Scan time increased from 8.6 ms to 14.8 ms.
Is anyone else seeing performance hits with the UDI instruction?
We are currently testing new firmware intended to address the lag observed in Data View and while monitoring tasks.
The increase in scan time depends on several factors, including the number of UDI instances, the depth of nested calls, and the number of parameters being assigned. The use of indirect addressing for communication instructions within UDIs can further increase scan time.
To help minimize scan time growth, we recommend limiting the number of assignable UDI parameters, reducing the use of nested calls, and avoiding large structures as parameters wherever possible.
Because scan time is especially important in your application, it may be best to avoid using UDIs at this time. We will continue investigating and share additional updates as they become available.