
tracyfearson (Customer) asked a question.
Is there a way to clear an array?
I have an array that is filled with data every minute for 60 minutes to get an average. I need to have it start the periods at the same time as another PLC. Is there a way to empty the array data to start fresh?
What PLC are you using?
If you are trying to sync the start time for logging arrays in multiple PLCs, you could do so with something like a button to the PLCs inputs, or you may be able to write some code so that once a start button is pushed, it sets a bit on that when the next time a certain minute is reached (assuming both are staying updated on their time via NTP) they both start logging at that exact second.
P2-550
You should be able to use the "Fill Array" instruction and fill it with 0's. Start column and end column would be the first and last column length of the array if you want to completely blank it out, or whatever range you want to for just clearing a portion of the array.
You can also use the CPA (Copy Array Function) instruction. This will copy a block (blank array) of 1 or 2-dimensions into a destination array.
https://accautomation.ca/productivity-1000-series-plc-array-functions-part-2/
Regards,
Garry
https://accautomation.ca/series/productivity-1000-plc/