LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I time my 'write to file'? Difficulty: Complete Newb

Hey everyone, please don't rip me to shreds for being stupid but this is literally my second day working with Labview.  My company just bought this system to read thermocouples and I've been handed the task of making it do two things:  Measure temperature continuously and write the data to a file (with timestamp) about once per minute.
 
I've got my temp up and running with the DAQ assistant express VI and a thermocouple giving me good data.  I also have the 'Write To Measurement File' VI in place and configured so that I am indeed getting an output file.
 
The problem I have is that I need a reading to be recorded once a minute and the temperature readings are coming in at something like 1kHz (when I try to drop the rate very low, it won't do a temp reading but reverts to voltage???) and at 1kHz the file is getting huge quickly.  This is going to eventually run 24 channels for days on end and I can't have too many samples or I'll run out of hard disk space quickly.
 
Is there any way to wire a timed switch to the 'enable' on the WTMF VI so that it records at specific intervals?  With a time stamp?
 
What about adding the other channels later?  I'll need seperate output for each channel.
 
Once again I apologize for the newbness but I have to have this functional by tomorrow evening, no questions asked.  Going back and forth with support may not achieve that goal but I'm hoping that knowledge present here (with a dose of patience) will help.
 
Thanks in advance!
 
Ralph
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 1 of 20
(3,739 Views)
I would (and I don't promise this is the best solution) set a set time for the loop to run, and use a count variable.   Then have a case structure that saves the values in the FALSE case.  Then you can take the modulus of your count variable for the desired multiple of time to sample.  Cast that to a boolean and wire it to the case structure.

Strike that: I just read that your program will be running for long amounts of time, which will overload your variable if it's running at anything faster than maybe once every few seconds.

Let me think about it.

IOW, let someone experienced come in with the right answer.  I've got some other work to do anyway.  Hopefully I at least set you along the right path.


Oh yeah, you can probably extract the second value from the timestamp and use that to determine your case condition.

Message Edited by PiMaster on 05-11-2006 03:06 PM

0 Kudos
Message 2 of 20
(3,729 Views)
Apparently I'm still too newb-ish to pull this together because I honestly don't understand much of what you just said.
 
*sigh*
 
I've attached what I'm already working with...  Any input is greatly appreciated.
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 3 of 20
(3,716 Views)

Hi

I modified your vi a little bit and addes some comments. Hope this is what you're looking for.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 20
(3,710 Views)

That is very close to what I need.  VERY. 

Is the monitoring constant or is the monitoring timed to the 60 second iteration?

Overview of what I'm doing with this:

Three bearing failure test rigs, each with two sets of four bearings and therefore four thermocouples.  Total of 24 channels.

I need to have constant monitoring (at least 1 sample per second) and an error output setup so that I can trigger an emergency shutdown relay if one of the temps goes extremely out of range.  That needs to be fairly constant as catastrophic failures happen rather quickly with little indication.

The data I'm saving here, however, must only happen once a minute or so, will vary and must be adjustable from one test to the next.  That data must be timestamped and across all 24 channels.

Cliffs notes:  Need constant monitoring for shutdown purposes but only send to save file once per minute.

I tried putting a delay and the save file in a loop and that seemed to work as far as timing goes but it didn't acquire temperature readings from my DAQ assistant outside the loop.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 5 of 20
(3,705 Views)
It's not that constant (it may vary a few ms) otherwise you had to use the timed loop, but due to the fact that you just write a value each minute, it's constant enough I'd say. 😉
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 20
(3,697 Views)
Certainly the 'write to file' every 60 seconds is constant enough.  No problem there.
 
When I said 'constant' monitoring what I should have said was 'continuous'.  I couldn't just have the DAQ assistant running every 60 seconds--it had to be acquiring data at least once per second in order to shut down the system in failures.
 
I modified what you did slightly and I THINK this is going to do what I need it to.  Can you look it over and tell me if there's any major obvious flaws?
 
Thanks!!!
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 7 of 20
(3,693 Views)

Firstly, you have to ensure, that the wait interval is longer than the acquisition time (and correct the iterationcounter properly), otherwise you won't write the data in 60sec cycles.

Secondly, what do you mean with "shut down the system"?

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 20
(3,689 Views)

I have to configure an analog output in order to trigger a relay (5v) in case of a bearing failure.  This would shut down the test rigs rather than let them throw belts, etc.  That's why I need the monitoring to be continuous.  The data saving is the only thing that needs to be timed.

What you mentioned about iterations...  Do you notice a problem?

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 9 of 20
(3,686 Views)
If you want to monitor continuously and only write once a minute, you need a place to hold the data between writes.  The Append Signals combined with a shift register can help a lot.




I am not sure how the Append Signals Express vi behaves memory-wise.  There are several articles on the ni site regarding memory management, but they are a bit deep for the two-day newbie. 

Message Edited by jasonhill on 05-12-2006 08:50 AM

0 Kudos
Message 10 of 20
(3,686 Views)