Optimize Application
Every calculation requires a certain computation time. This can lead to problems when very large projects or larger operations are realized. The total cycle time can be displayed by switching the system monitor at the top right.
Note the data carrier queue. The queue is only used if the data can no longer be read and written simultaneously. This becomes particularly apparent in large projects or with incorrect hardware. The queue should never exceed 1% during normal operation.
Application Functionality
To understand the performance test, the functionality of the application must first be explained. In addition to the basics of Cycle Time, there are also advanced methods that have only been implemented in the PLC by Antcas:
- If no changes are detected in an element, the entire element is parked and no longer calculated.
- When changing global values, a double cycle is driven. The PLC then waits for one millisecond.
- Timeouts are set for calculating time-critical values.
- The outgoing communication (sending or storing values) takes place asynchronously and not only after the calculation has been completed.
- Every variable is remanent and is saved before parking or at the latest after two seconds.
Analyzing a Project
To find out which elements of the application require very high computational power, the Performance Test can be used.
Optimization Tips
- Do not use the output ET of a timer TON, TOF, TP. Instead, you can work with UPTIME.
- The input SET of VISUSET and VISUDTSET should never remain active on multiple function blocks at the same time.
- If possible, perform larger or more complex calculations in a separate element.
- Calculate mathematical operations using CALCULATE.
- Use loggers with the largest possible interval. Ten minutes is completely sufficient for a temperature. The interval can also be set dynamically.
- Use higher intervals PT in the function blocks CTRL_PID, SHUTTER, DIMMER etc.
- When changing dynamic time inputs, ensure that they do not change constantly. This can be the case with RGB sequences using the function block FADE.
- Simplify more complex tasks. In particular, searching in strings is very computationally intensive. Use the function block EXPLODE or PREG_SPLIT instead of FIND and SUBSTR. The values are stored accordingly in between.
- Processing HTTP queries can use a lot of memory.
- Reduce the received telegrams. For example, when dimming a value, depending on the bus system, the feedback may be delayed.
- Increase the Cycle Times of the PLC.