How Can We Help?
How to set and synchronize the ACE PLC clock with the HMI using a macro
In this post, we will show you how to synchronize the HMI clock with the ACE PLC clock.
As the HMI has a saved clock, we use it to update the ACE PLC clock.
With vBuilderFirst of all, it is necessary to define in the Modbus register these UI8 tags that will be written by the HMI. Address 4×900 to 4×905. Don’t forget to set them to “Writable” : “Y” You will get the clock of the HMI in your ACE PC. |
|
With HMI-ToolIn the Macro Editor, add a new macro and copy it. You don’t have to use all the tags, if you need, for example, only the hours and minutes.
And create the list of these tags. BDCSec, BCDMin,.. come from the HMI clock. Sec, Min,.. are for the ACE PLC. |
The Script editor:
Below the window script, the varaiables settings: Example of variable seeting: |
Compile the program The program must move to the “Success” branch | |
Add the macro in “global Macro” list And set its frequency of execution to 1000 ms for update the clock every seconds. You can download here the HMI and ACE project if you wish to test it. |
|
The script converts the HMI clock data from BCD format to decimal format.
After this, the HMI clock variables are present in decimal format in registers LW900 to LW905. In “Data forward” > “Word address”, add the right word address forward for copy the LW900 to LW905 to the right network link and PLC id. |