LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

log data when signal is for at least one hour stable

Solved!
Go to solution

All, can you please help me out with the following;

 

I have data to log when one signal is for at least one hour between two values. If this is the case, all the data can be kept. If this is not the case, let's say after 30min that one signal is out of spec, previous measured data in those 30min may not be displayed in the log file. Does somebody have a solution for this?

 

Thanks in advance

0 Kudos
Message 1 of 8
(2,497 Views)

How do you say the signal is stable?. Do you have a min and max limit for the signal. please explain more specifically

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 8
(2,496 Views)

Yes, I have a min and max value. It is a pressure that needs to be between 8 and 12 bar. Out of this range, logged values are of no interest.

0 Kudos
Message 3 of 8
(2,493 Views)

So, it means, you want to log data if pressure is between 8 and 12 bar. Else, discard data and continue monitoring of data. Monitor only value

Right?

 

you can compare the pressure value using an In Range function and put a case structure to log data only when the value is in range. use timestamps to know when the data was in range. so the file only contains data when the pressure is in range

 

 

Or, if you want to log data ONLY IF the presusre was between 8 and 12 bar AND for an hour or more, then, put a timer to check time elapsed since the last value change and then log if timer has counted an hour. Then instead of inrange, use a shift register to see the last value which changed and then turn on a timer. When the value changed next, update the shift register. when the timer is up, reset the timer and log data.

 

I will take time to put these two logics on code and post. instead, you can make a code of either of the two options and post back. we can review your progress.  

 

Almost forgot two questions: How are you reading the data? hardware used and data type? which file format do you plan to use?

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 4 of 8
(2,491 Views)

I want to log data ONLY IF the presusre IS between 8 and 12 bar AND for an hour or more. Can you follow my logic? Logging does not have to start after this requirements are fullfiled. If requirements are fullfiled for an hour or more, the data can be used.

I will try to work further on code and post it for review.

 

Regards

Filip

0 Kudos
Message 5 of 8
(2,484 Views)

I'm reading the data with an USB-6009. Except the pressure, I also have to log two other channels when requirements are fulfilled. Those 3 channels are all 0-10V. I wanted to use a .txt file to log.

0 Kudos
Message 6 of 8
(2,482 Views)
Solution
Accepted by topic author No_use_for

This may be of help. Sorry, the code is a bit untidy!!

log data.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 7 of 8
(2,468 Views)

Thank you .aCe, this is very usefull.

One more question; now the logfile is limited to 1.25x the measurement time. What can I do to make the data after an hour also logged (as long as pressure still is in specification). Now I solved it by putting in a large number at the array size, but in my opinion this is not a good and clean solution.

Greetings

0 Kudos
Message 8 of 8
(2,425 Views)