LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

log data when signal is for at least one hour stable / different block's

I have a VI (please see attached) that log data and write it to a measurement file when it is between two values for more than one hour. After one hour it will keep writing the data to a measurement file if still stable.

 

What I want to do now and what I can not figure out how to is;

When the signal is not stable anymore, it will reset the index of the array to zero and overwrite all data from the previous hours when it was still stable. How can I make sure the index will not be set to zero but will reset to the last stable index point?

I have to append the new stable data block (more than 1h between two values) to the old stable data block. And this for several block’s, depending of the instability of the data.

 

Thank you for helping me out. I hope my question is clear.

0 Kudos
Message 1 of 4
(1,998 Views)

Your use case would be better served by using a state machine. This will enable you to write the collected data immediately after the time has elapsed, and then write each new succeeding value to the file (using Append) while it remains stable.  Currently you are overwriting the entire file each time with all the old data and only one more piece of new data, very inefficient. The state machine will also help take care of the case when the data goes out of limits.

Also, you don't have the file path wired to the Write to Spreadsheet File VI which will give you a file dialog prompt for every iteration!

0 Kudos
Message 2 of 4
(1,989 Views)

Thank you for the feedback.

I will try to use a state machine, alltough I never worked with it. But I can imagine this will be more efficient.

0 Kudos
Message 3 of 4
(1,979 Views)

There are examples both here in the forum, on the NI website and in LabVIEW itself.

0 Kudos
Message 4 of 4
(1,964 Views)