I am perplexed by the current situation. Everything functions seamlessly when I upload a new project and restart the HMI. However, an unexpected issue arises when the hmi_started_flag is turned ON. Instead of remaining unchanged, the current screen should switch based on certain conditions. Despite setting it to OFF, the screen still changes. Even after confirming the hmi_restarted_flag is ON, the screen switches. Further investigation reveals the hmi_just_started variable is set to 1, yet the screen continues to change. This has left me puzzled. I have experimented with setting bits ON and OFF using macros. Upon realizing I could enhance security by disabling macros when the bit is ON, I attempted to do so. Surprisingly, the macros continue to run even when the bit is ON after restarting. Any insights on why this could be occurring?
To optimize the performance of your "Macro," you have it set to run every 1500 ms. This means that the Macro will automatically run at intervals of 1500ms. If you prefer the Macro to only run under specific conditions, deselect the "Periodic" checkbox and include the necessary conditions in your code. This will ensure that the Macro executes based on the criteria you have specified.
The Old Man explained that the "Macro" is set to run every 1500 ms, meaning it will execute at that interval regardless of any other factors. If you want the Macro to only run under specific conditions, uncheck the "Periodic" box and include the conditions in your code. I need the Macro to run periodically to check for modbus data and display an error screen when the connection with the PLC is lost. However, I need to delay the execution momentarily when the HMI is restarted. The main concern is why the Macro functions perfectly after loading a new project but fails to work after subsequent restarts. It should ideally operate consistently, but there seems to be a discrepancy. I suspect that the periodic executions start after a timeout following an HMI restart, rather than immediately. It's possible that in some cases, the first run occurs before setting the HMI restarted flag, leading to issues in applying conditions or security settings for the Macro. This could result in prematurely changing the screen before indicating a restart.
After adjusting the interval to 2000ms, the functionality has been flawless in all tested scenarios. The previous issue with 1500ms has been resolved.
Thank you for sharing this valuable information. It's great to have this knowledge at hand.
In a statement attributed to Edvard Munch, the need for periodic execution of a process that checks for Modbus data and displays an error screen when the connection with the PLC is lost has been expressed. However, there is a requirement to delay the execution slightly when the HMI is restarted. The primary question arises as to why the process works perfectly after loading a new project but fails to work after subsequent restarts. It is expected that the process should function consistently in both scenarios. There is a query regarding whether the periodic executions start immediately after an HMI restart or after a specified timeout. It is likely that the executions commence after the timeout period. There is a possibility that in some instances the process runs before the HMI restarted flag is set, causing conditions or security settings for the macro to remain unapplied and resulting in a change in the screen prematurely. To delay the execution of the macro, the suggestion is to include "DELAY()" at the beginning of the code. There is a concern that even if the HMI screen is not fully loaded, the macros are still being executed, although this has not been confirmed through testing.
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: Answer: The unexpected behavior may be caused by a malfunction in the code that handles the screen switching based on conditions. It is advisable to review the code logic to identify any errors or conflicts that might be overriding the flag settings.
Answer: Answer: If the macros are not being disabled as intended, it could be due to a problem with the macro configuration or execution sequence. Double-check the macro setup to ensure that the conditions for disabling them are correctly defined and triggered.
Answer: Answer: The persistence of the hmi_just_started variable value could indicate an issue with how the variable is initialized or updated within the project. Check the code related to this variable to ensure it is being handled correctly during the restart process.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.