Need a little help with a better way to copy data.
I am saving data in an array and I want to move the data from the second oldest to the oldest, 3rd oldest to the second, 4th to the 3rd....... and so on.
There are 52 data sets to move each week.
I created a user defined data type dint[52] and the current week is stored in [0]. After the end of the week the data is moved like above and the contents are cleared in 0 and it starts all over again. When the last becomes full it rolls off.
Basically, I am storing part count by day, then to week.
Another problem I can foresee is if the PLC is turned off for one day. How can I tell the day of the week to re-sync the data? I am not saving the GSV date to the data stored (maybe I should and forget about the name of the day?)
I am saving data in an array and I want to move the data from the second oldest to the oldest, 3rd oldest to the second, 4th to the 3rd....... and so on.
There are 52 data sets to move each week.
I created a user defined data type dint[52] and the current week is stored in [0]. After the end of the week the data is moved like above and the contents are cleared in 0 and it starts all over again. When the last becomes full it rolls off.
Basically, I am storing part count by day, then to week.
Another problem I can foresee is if the PLC is turned off for one day. How can I tell the day of the week to re-sync the data? I am not saving the GSV date to the data stored (maybe I should and forget about the name of the day?)