LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data in first column of saved file is not continuous


Hi,

I have a .vi that reads the voltage from my instrument and then converts the voltage to a temperature.  There are several statistics that are performed as well.  I have the mean temperature and the temperature reading into a .txt file.  When I view this file, the first column (which I thought was Time), is not continuous, but starts over and over again.  My sampling rate is 100 samples at 1000 samples/sec, which is 100 milliseconds.  My data Time (?) (i.e. the first column of data) starts over again at 101, 201, 301, etc. 
I have attached my VI and the data file so you can see what I'm talking about. 

If you have any thoughts, I would greatly appreciate them!

Sherri

0 Kudos
Message 1 of 16
(3,381 Views)
0 Kudos
Message 2 of 16
(3,379 Views)

Hello,

I believe that the problem here is that the "Simulate Signal" VI has a timestamp from 0 to (x-1) where x is the number of samples you are acquiring.  Each time your loop iterates it generates x new samples.  When I run the test using real data from my DAQ card it does not roll over each x samples.  I would try simulating a DAQ card (available with NI-DAQmx 7.4 or higher) and running the DAQ assistant exactly like you plan to do in the lab. 

I hope this helps, if you have any other questions feel free to let us know, and for questions regarding seting up your actual acquisition our Engineers and customers in the Multifunction DAQ Forum may be a great resource.

Thanks for posting and have a great afternoon!

Regards,

Travis M
Applications Engineer
National Instruments

Travis M
LabVIEW R&D
National Instruments
Message 3 of 16
(3,366 Views)

Great!!!  Thanks so much!  I've been trying to figure this out for a while............

Also, what is NI DAQmx 7.4 ?

Thanks again-

Sherri

0 Kudos
Message 4 of 16
(3,360 Views)

Hi Travis-

I just checked my VI using my DAQ card and it still has the same problem.  I'm not sure what to do now........

Sherri

0 Kudos
Message 5 of 16
(3,350 Views)

Hi Travis-

If I remove the Formula Express VI, all is well.  I probed the data at the beginning (i.e. near the DAQ VI) and after the data has run through the Formula Express VI and I noticed that the "dt" was different for each of them:  dt = 0.001 at the beginning and dt = 1.000 after the Formula Express VI.  The time stamps are also different.  Hpw can I change the "dt" for the Formula Express VI?

Thanks-

Sherri

0 Kudos
Message 6 of 16
(3,346 Views)

Hello Sherri,


I'm not exactly sure what you mean by the dt is changing in the formula node.  I don't really see any place where dt is being directly used by the formula node.  If you extract the waveform components of your simulated signal and examine the value for dt, it does not appear to deviate (see the simplified VI attached).

With regards to NI-DAQmx, if you are using one of our National Instruments Data Acquisition (DAQ) cards, this is most likely the driver software that you are using in LabVIEW to control the parameters of your acquisition.  Beginning with NI-DAQmx 7.4 and now with 7.5 as well, you have the ability to simulate a DAQ card and are no longer just limited to simulating a signal.

Again, thanks for posting, and let us know if we can help out further.


Travis M
NI

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 7 of 16
(3,340 Views)

Hi Travis-

Thanks for your reply.  I can't open the .vi that you posted b/c I have Labview 7.0.  Coudl you re-post it?

Thanks!

Sherri



0 Kudos
Message 8 of 16
(3,324 Views)

Hi Travis-

yes, you are right.  When I extract the waveform components of the Simulate Signal, the "dt" does not deviate.  But, if I extract the waveform components of the Formula Express VI, the "dt" is different from that of the Simulate Signal.  I'm wondering if this is my problem.  I just want to read in a voltage, take the mean of the voltage and then convert the voltage to a temperature and have that data saved in a file.  But, for some reason, the data (i think the Time) is not continuous. 

I hope this is clearer.

Thanks!

Sherri

0 Kudos
Message 9 of 16
(3,319 Views)

Good afternoon Sherri,

The first question I have for you is about your acquisition system.  I understand that you are reading voltages and converting these to temperatures.  If you are using thermocouples or RTDs for this you can use some VIs in a LabVIEW library which I will attach in the zip file.

With regards to the dt being changed, this is because of your Formula VI.  The Formula express VI operates on only one datatype, and all other datatypes wired to it will be converted to that datatype in some way.  Since you are wiring a datatype of type "signals" into the formula node, LabVIEW is converting the other parameters to a datatype of type "signals".  When this conversion takes place it will essentially construct a constant waveform.  The formula node appears to attempt to be "smart" about how it constructs this waveform -- that is, it seems to try to construct any new waveforms with the same dt values as the one wired to it.  This does not seem to always happen.  When this does not happen you can essentially just replace the dt value in the resulting waveform with the one that was in the original.   Also in the zip file attached here is a VI which demonstrates the formula node working correctly, strangely, and a workaround for when it behaves strangely.  I would use the workaround for now.  In the meantime I am going to look further into why the formula node sometimes appears to unnecessarily change the dt values of its inputs.

Hope this helps.

Regards,

Travis M
Applications Engineer
National Instruments

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 10 of 16
(3,302 Views)