LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peel off hourly output value and subtract from previous hours (then write to file)

Here is another problem I have been working with and what I have tried so far.  Right now, my current VI is writing data to an excel file at a point every second.  I would LIKE peel off a point from this datastream once every hour and subtract it from the previous hour's value and write an hourly value to an excel file (same file or different file is ok).  I was working with a guy here at my university who had some ideas to use the Elapsed time function.  I have included a screenshot of the part of the VI containing the function we were working on.  We never could get it to work quite right.  We were having some problems getting the shift registers to work (used to subtract the current hour's value from the previous hour's value).  Let me know if you have any ideas, if maybe we are on a good pathy, or maybe I should try something altogether different.  I'm just looking for a simple solution at this point.

Thanks,
Jeremy


The local variable "Total Consumption" is the data stream off of the hourly values are being taken.  Currently (not shown in this screen shot), the value of "Total Consumption" is combined with the other channels into one signal that is fed into the "Write to Measurement File" VI (shown at the right).
0 Kudos
Message 1 of 3
(2,539 Views)
bump
0 Kudos
Message 2 of 3
(2,527 Views)

You have a true constant wired to your stop button for the loop, which means the loop will only run once.

You may want to consider the positions of the previous and current indicators inside that loop.  It's not clear how you want them to function.  The previous indicator doesn't get updated until right as the elapsed time occurs.  The case structure gets executed, and you will immediately have a new previous value calculated, but you won't see that again until the end of the next hour.  Not sure if you are updating the current value in the false case as well.  Otherwise that would look like stale data for an hour.  If you are updating it in the other case, than you should move the local variable and the indicator completely out of the case structure and only pass in the wire to the subtraction function.

0 Kudos
Message 3 of 3
(2,491 Views)