LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hourly and Event Data Logging in an Interactive Program

Hello. I have seen numerous similar posts regarding data logging, but none seem to apply to my case.
 
I have a vacuum chamber system with two pressure gauges and two valves. I want to create an hourly log of the pressures and the valve positions. I would also like to log the pressures and valve positions each time a valve position is changed or the chamber is vented (in other words when the the pressure rises above a certain number).  However, I still want to be able to change the valve positions as I wish within the data logging time.
 
I tried implementing the examples I found on here regarding data logging, but they didn't allow me to change the system state as I wished. When adding in the hourly data logging in its own while loop, I was unable to change the valve positions, or at least slowed it down enough where the position did not change within 10 minutes.
 
Do you have any ideas or suggestions on what I could do to properly enable hourly data logging and still be able to interact and change stuff in my application?
 
Thank you for any help you may be able to offer.
0 Kudos
Message 1 of 2
(2,236 Views)

HI,

 

I had a similar situation a little while ago.  I was monitoring temp over 40 hour tests.  The spec called for data logging only if the temp went into the "event" zone.  When that happened I streamed the data as long as the temp was in the "event" zone.  As the project matured, we realized that we wanted the current temp value once per hour if we didn't go into the "event" zone during that hour.

 

To implement this, you will want to use a programming architecture like a state machine (anything other than a massive side scrolling window, or (shudder...) nested sequence structures). 

 

Starting in the middle of the state diagram (acquisition)..., you will acquire a value.  Compare that value to the "event" value.  If "event" then log.  If not an event, check current time vs start time (**).  If current time is one hour since start time (or whatever your time base is) then log the current data, and reset the "hourly log" flag bit (**).  Then acquire another data point and repeat.

 

Looking at the beginning (I used ** to show these items) you will want the: start time, an "hourly log" boolean, and for the file to already be opened before you start.

 

I should flow pretty natuarally once you try it.

 

Let me know if you have any questions.

J

 

Using this you should be able to

0 Kudos
Message 2 of 2
(2,227 Views)