LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not obtaining all data due to write to file

I am very new to LabVIEW, as in 3 days, and have not been able to figure out my problem with losing data while trying to write to a .txt file.  I have a load cell that I am attempting to obtain data from, but when I go to the waveform data I am losing approximately 2/3's of my data and am worried that an event will be missed and the data cannot be used.  Because I'm new, I am not good at troubleshooting/debugging and am looking for any help or guidance.  I have attached an image of what I have.

0 Kudos
Message 1 of 6
(2,490 Views)

The best time to learn is when you are learning.

 

A good way to handle this situation is to separate the data acquisition from the file save function.  The standard way to do this in LabVIEW is to use parallel loops.  Look at the design patterns which come with LV: File >> New.. >> VI >> From Template >> Frameworks >>Design Patterns >> Producer/Consumer Design Pattern (Data).  Note that this is NOT File >> New VI.

 

Lynn

0 Kudos
Message 2 of 6
(2,482 Views)

Hi there,

 

I think your basic problem is that you're obtaining your samples in individual lumps by collecting N samples then plotting and writing them to disk. If you change your task to a continuous acquisition say acquiring 10 samples at a time at 10Hz then the loop timing will be handled by the acquisition and the amount of data to be saved will be done easily within 1 second. See sample below. In this way you'll be constantly acquiring data and writing it to disk with no gaps.

 

If you want to run the acquisition faster than say a kHz then I'd follow the suggestion made in the previous reply and stream the data to a separate loop via a queue just in case the disk write takes longer than the loop time.

 

VI.jpg

Regards

Paul

CLD running LabVIEW 2012 32 & 64 bit on Windows 7 64 bit OS.
0 Kudos
Message 3 of 6
(2,445 Views)

Hi

         I think u r replace the data in the file. So change the settings from "Replace or Create ". If u choose this u can view only the last data.

 

Thanks

Sivabalan.V

0 Kudos
Message 4 of 6
(2,425 Views)

Hi,

 

I think this example may help you..Let me know if it was useful..

 

Regards,

 

Nitz..

(Kudos are always welcom;))

0 Kudos
Message 5 of 6
(2,411 Views)

Thank you to all of you who replied.  That was extremely helpful.  You are correct, this is the best time for me to learn.  I'm catching on (slowly, but surely)!

0 Kudos
Message 6 of 6
(2,398 Views)