LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to Measurement File at certain time interval

Hello,


I'm having trouble figuring out how to write to measurement file at a certain time interval. Meaning, I don't want to record every single point of data, but rather, only at say every 1 second. I'm using the Write to Measurement File IV and sending in a signal to it. The signal is a AC signal at 1K, but I only want to record the output value at every 1 second, rather than every 0.001 or whatever.

 Thanks so much.

Brian

0 Kudos
Message 1 of 9
(7,078 Views)

Simple way is to use the Elapsed Time function. Wire the time has elapsed output to a case statement with your write inside the true case.

0 Kudos
Message 2 of 9
(7,073 Views)

Hey Dennis,

 

The problem I'm getting is that the data is not being recorded ONCE every specifed elasped time. It's doing the recording like 50 times after the enabled time since the signal is running at 1k Hz

0 Kudos
Message 3 of 9
(7,059 Views)

Then you've programmed something incorrectly. The default behavior of the elapsed time function is to reset after the time target. That means that the case statement will only be true once until the next time interval. It does not matter what the sample rate is. Post your code.

0 Kudos
Message 4 of 9
(7,057 Views)
here it is. I'm getting a AC signal and retrieving the output, converting it to resistance, and then recording it into a file. I want to be able to control interval at which I collect data. Thanks so much!
0 Kudos
Message 5 of 9
(7,052 Views)
Sorry. This is updated
0 Kudos
Message 6 of 9
(7,049 Views)

You haven't even tried to use the elapsed time function. Smiley Surprised It's even an express VI so it would feel right at home with everything else you have.

 

p.s. It's on the Timing palette.

 

edit - ok so that one will run once a second and save the 100 samples you are taking.

Message Edited by Dennis Knutson on 01-22-2010 03:47 PM
Message 7 of 9
(7,042 Views)
I'm sorry. Is ther ea way to save only 1 sample that I am taking per second?
0 Kudos
Message 8 of 9
(7,031 Views)
Sure. You could take the mean of the data. You could index the array and get any single element you wanted. You could use the Convert From Dynamic Data and convert to a scalar. I think this gets the last element.
0 Kudos
Message 9 of 9
(7,010 Views)