LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loosing data while writing to a spreadsheet

Hello everyone. Im new here and to Labview and I am currently having trouble with my program. The purpose of my program is to read continuous samples from a load cell with respect to time, display it on a chart, and write to a spreadsheet. The problem is that I loose data based on whatever value I set the samples per channel (labeled buffer). So if I have a rate of 1000 and 1000 samples per channel, it will write to a spreadsheet every 1ms and skip 250-300ms after each 1000th sample. I am fairly new to Labview and have tons to learn. If anyone can point me in the right direction I would greatly appreciate it.
0 Kudos
Message 1 of 6
(2,534 Views)

Hi Omar,

               I can't open your VI as Iam using LV2009.Anyway there is a link handling similar problem.please go through it

               And don't forget to post if the issue is solved.

 

               see here

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 2 of 6
(2,526 Views)

One problem you have is that you are creating the DAQmx task and closing it on every iteration of your while loop.  That is wrong.  You need to create the task before the loop and close it after the loop.  What is happening is that you aren't even collecting the data that is occurring during the portion of time where your DAQ task is closed.

 

You also have some odd code segments in there.  Why do you AND a boolean with a True constant?  The result is always going to be what is on the boolean wire.   Why do you use a select statment where you output a true if the incoming wire is true and a false if the incoming wire is false?  The output of the select function is going to be exacting what is on the incoming wire.  Both of these are Rube Goldberg Code.

0 Kudos
Message 3 of 6
(2,512 Views)

My original vi was written using LV2011. I build the exact code on LV2010 and the problem went away, so I think the newer version is causing some type of glitch.

@Raven: Thanks for your input. I'm taking your words of wisdom and applying them to my existing code today.

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

Since you are not looking at any errors that might be generated, your 'loss of data' could have been due to an error. With continuous sample mode, it is not a good idea to write text files in the same loop since it is possible that you cannot do that fast enough. Much better to use a producer/consumer architecture. And be sure to wire up an error indicator.

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

I tried doing the producer / consumer method going off the example vi but I could not get it to work. So instead I went with what I have. Learning that is on my to-do list. Thanks for your input.

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