LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data loss during DAQ Read

Hi,

 

I have built a data logging vi which constantly acquires data until some logic becomes true to save the data to a TDMS file.

 

I am experiencing some problems with my DAQ read functions. In my front panel, the two numeric indicators labeled 'Blower Volts' and 'Coolant Flow' should constantly be displaying values being read in from my CompactDAQ unit, but when my VI runs there are moments when these indicators show 0.00 and then go back to the values that they should be showing.

 

It's as if the data is being lost somewhere. Im am wondering whether it could be a problem with the timing setup of my VI, or the sampling rate (DAQmx Sample Clock) that is set up for each read function.

 

Could someone please advise where the problem could be and how to solve.

 

I have attached my VI and some screen captures.

 

Thanks,

Rhys

0 Kudos
Message 1 of 5
(2,220 Views)

Put some probes or indicators on your error wires.  See if you are getting errors.

 

If I had to guess, you might be getting error -50103.  Since you have 3 different tasks all accessing the same device, you might be getting a conflict when one task is trying to take a reading at the same time another task is.  You may be okay at times because since you are only reading one sample at a time, a task may return quickly making it less likely another task is going to hit at the same time.  But you do have one DAQmx Read that is taking 5 samples before returning.

0 Kudos
Message 2 of 5
(2,211 Views)

I think that the number of tasks is not the issue here. I assume that the issue is created by the settings of the tasks.

Having two tasks running continuous at 500 S/s, but setting "number of samples per channel" to 1 seems rather odd. Adding to this the fact that you read an array of samples per channel and removing all but the first is really..... strange. I wonder why you have configured it to 500 S/s at all (makes no sense at all).

 

Timing the loop by reading 5 temperature values (20 S/s) seems also rather strange, but if you require the "temperature history", it is fine with me.

 

The reason for your issue is that sometimes the array is empty (Blower and/or Cooler). It makes sense to check for errors since it is the most likely explanation.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 5
(2,187 Views)

Thanks for the replies.

 

Could you explain to me how I should be setting up the task with regards to the number of samples and samples per channel. I'm not 100% sure how I should be setting them up.

 

Basically, for the temperature measurements, I do require a history of the values to display on the graph on the front panel. But for the Blower and Coolant display, I only need instantaneous values to be displayed really.

 

The reason I am reading a single value out of the array is because, when I set up the DAQ read to 1 channel, 1sample, the value shown in the numeric display did not seem to change when the physical input to the harware changed. This is something else that I'm not sure about.

 

Thankyou

Rhys.

0 Kudos
Message 4 of 5
(2,184 Views)

Hi,

 

I have managed to sort out this problem. I have used a property node of the DAQ read, which checks that there is data to read before accually reading the data.

 

Looks to be working fine.

 

Cheers Guys

Rhys.

0 Kudos
Message 5 of 5
(2,172 Views)