LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to measurment file

Hi,

I use NI-Daq 9237 to measure with strain gauge. In Labview I take the acquisition with 'Daq Assistant' and save the data with 'Write to measurement file': here i save in TDMS. The file have three columns: in the first I can read the Time given by the clock, in the third the strain values and in the second i should read the intervals between the measurments in second, but here, where for examples i should read intervals of 0,1 seconds, I read always 0,1,2,3 and so on, even if I change Rate and Number of Samples for the acquisition. Someone know how to solve this problem?

0 Kudos
Message 1 of 7
(3,124 Views)

I would not even use the Write To Meaurement File function.  In the DAQ Assistant is a tab for logging.  You can just have the data stream straight to a TDMS file for you.  It is a lot more efficient.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 7
(3,073 Views)

Hi Pietro,

 

my suggestion is to use the low level TDMS functions, they are more fast than the "Write to measurement file". However, you can also use it without problem.

For setting the interval to your desired one you can try to build a waveform with the desired dt based on the acquisition rate. Then you pass the waveform to the "Write to measurement file".

 

I hope my answer helped you.

 

Kind regards.

Message 3 of 7
(3,033 Views)

I attach my LabView Code here: I can't find something I could change. I set frequency and number of samples, so I can't undeerstand why in the TDMS file I generate I can't see the right time interval of 0,1 s.

 

Thank you for your answer, I hope you can help me solving my problem!

0 Kudos
Message 4 of 7
(3,022 Views)

Hey Pietro,

 

check out the modified vi taht you can find attached.

 

Kind regards

Message 5 of 7
(3,004 Views)

1. No need for the wait in your loop.  The waiting for DAQ samples to come in will limit the loop rate.

2. The DAQ Assistant is giving you 160 samples.  Yet, you only use 1 of those samples and only from 1 channel.  Configure the From DDT VI to convert to a 1D Array of Waveforms.

3. Similarly, your To DDT VI should be configured to take in a 1D Array of Waveforms.

4. Your Stop Acquisition button should be wired to the Stop input of the DAQ Assistant.  Then the Stopped output should be wired to your loop conditional terminal.  This will allow the DAQmx task to be properly closed out.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(2,998 Views)

Thank you very much to both! I will verify your correction as soon as possible!

0 Kudos
Message 7 of 7
(2,970 Views)