moving/copying data

rocksalt

Member
Join Date
Aug 2008
Location
Texas
Posts
102
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?)
 
Edit - this is incorrect, sorry - Cop dint[0] dint[1] 51



You need to re-order your data with the current at dint[51] and the oldest at dint[0]

Then COP dint[1] dint[0] 51 will copy them correctly

If you tried my first suggestion you just end up with all the entries having the same value because of the order of copying.
 
Last edited:
Is there an instruction to do this or do I need to use 53 as new data (I want 1 to be week 1 not week 0) instead of 0?

Bernie, this worked perfect! Thank you.
 
Last edited:
You can use a FFU/FFL Command to move the data through your array. The example I posted is from our brewhouse where I am moving a list of the last 12 flow totals through a display on the HMI. Works pretty well, I'm using a loop starting in line 10 to count up to the end. Everything before line 7 is used to calculate the total of all the runs when they start a cooling mode at a heat exchanger before the flow meter.

Position 12 of the array, "WL_FLO_TOT[]", is the newest/current total with 0 being the oldest. This allows the brewers to keep a running tally how much of a particular brand they have made across the different cycles of the system. Then when a new brand hits to wort line they hit a reset button tied to the Reset_Flo_Total bit, the loops move a 0 sequentially to all the positions of the array.

This saved a bunch of headache from trying to move the data manually.

Just another option.
Adam
 

Similar Topics

I'm a Siemens person, and this is one of my first AB programs. The customer wants everything programmed in Ladder. I have a lot of data (3...
Replies
14
Views
217
Hello, I have a compact Logix plc and I have been task with configuring alarms into our SCADA when an Analog signal stops moving. The analog...
Replies
6
Views
240
Hello, i am a beginner with a Siemens Logo 8 PLC. I would determine the direction of an object if it passes a whole cycle of 2 input sensors. See...
Replies
2
Views
182
Can an AOP be removed from Logix? I seem to have some version weirdness from an E&H AOP and I need to see if reinstalling the AOP will correct it.
Replies
5
Views
971
I'm making a meal of this, my brain's not in gear. Also, I'm new to S7 TIA/WinCC so excuse my ignorance... See redacted pic. Pressing F7 (SAVE...
Replies
10
Views
3,218
Back
Top Bottom