Greg,
Here is a macro I created to synchronize the time & date from the HMI to the PLC.
In this macro, you are getting data from the HMI and sending it to the PLC.
I have the macro set to Periodic Execution and run it every 30 seconds.
macro_command main()
unsigned int a
GetData(a, "Local HMI", LW, 9021, 1)//MONTH
SetData(a, "Siemens S7-200", VW, 616, 1)
GetData(a, "Local HMI", LW, 9020, 1)//DAY
SetData(a, "Siemens S7-200", VW, 620, 1)
GetData(a, "Local HMI", LW, 9022, 1)//YEAR
SetData(a, "Siemens S7-200", VW, 624, 1)
GetData(a, "Local HMI", LW, 9019, 1)//HOUR
SetData(a, "Siemens S7-200", VW, 628, 1)
GetData(a, "Local HMI", LW, 9018, 1)//MINUTE
SetData(a, "Siemens S7-200", VW, 632, 1)
GetData(a, "Local HMI", LW, 9017, 1)//SECOND
SetData(a, "Siemens S7-200", VW, 636, 1)
GetData(a, "Local HMI", LW, 9023, 1)//DAY OF WEEK
SetData(a, "Siemens S7-200", VW, 640, 1)
end macro_command