LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multi-channel sampling with NaN on some channels

Hi All,

 

I am having an issue with on an NI USB 6289 DAQ. I am trying to collect EMG (differential), load cell data (differential) and 3 accelerometer (RSE) inputs. For the EMG I want to sample the data at 5000 Hz using the Analog 1D Wfm Nchan Nsamp vi. If I let the sample to read default to -1 I do not get any buffer issues but the data from the load cells & accelerometer aren't generated when I read so I get NaN and it affects other parts of my program. 

 

If I specifiy 1 as the samples to read, or if I change to Nchan 1Samp I get buffer issues when I try to clear the task. It says that data is missing. 

 

I've tried increasing the buffer size to really high numbers and that doesn't seem to help. Does anyone have a suggestion on how I can collect data at different rates using this DAQ or how I can make it wait to read for only the load cells and accelerometers while still collecting EMG data? 

 

Thank you for any help 

0 Kudos
Message 1 of 10
(3,583 Views)
You are going to have to show your code. You cannot read channels at different rates. You must read all channels with a single task. This should be a pretty straight forward program based on your brief description.
0 Kudos
Message 2 of 10
(3,570 Views)

Hi Dennis,

 

I have attached the vi. It does a few more things that what I described. The vi is used to control a tilt platform where we put animals. It sends digital outputs to an arduino that controls a servo. The program decides the different kinds of tilts and gets feedback from the arduino.

 

In addition to that we need to collect the load cell and accelerometer data ( they are part of the tilt platform). The animals get implanted with EMG. 

 

 

Thank you again.

 

0 Kudos
Message 3 of 10
(3,556 Views)
Sorry, I'm posting from phone. Can you attach an image?
0 Kudos
Message 4 of 10
(3,543 Views)

I posted a screenshot of the section that acquires the data from the DAQ. I can't get a screenshot of the whole vi. 

0 Kudos
Message 5 of 10
(3,538 Views)
Aside from some sloppy wiring and the array to cluster instead of a simple indexv array, I don't see anything that would cause NaN results. Have you tested all of the channels in the MAX test panels?
0 Kudos
Message 6 of 10
(3,510 Views)

I'm still not very proficient with labview I didn't think find a better way at the time instead of array to cluster. I only get NaN when I sample the data at 5k Hz. When I bring that down to 1k I don't have the issue with NaN. Am I sampling data faster then it's being generated for the accelerometer and load cells? 

 

0 Kudos
Message 7 of 10
(3,446 Views)

I tested all the channels in NI Max and they do produce data. 

 

I am re-attaching the vi after clicking ctrl + u. It looks less sloppy. I added a property node for DAQmx Read the sayd "ReadAllAvailSamp" and set it to False. 

 

I collected about 32MB of data and didn't get an error when I got to clear task at the end. I am worried that since I am holding up the data collection this is effectively downsampling. Can you confirm if this would be the case? 

 

Sorry for the double post.

0 Kudos
Message 8 of 10
(3,433 Views)

I thought this was resolve but the issue not resolved. I am still getting NaN for the readings of the accelerometer and load cells if I try to collect at 5k Hz and a buffer over run error if I specify -1 for the read vi. 

0 Kudos
Message 9 of 10
(3,410 Views)

Do you consistently get NaN for the readings of the accelerometer when you try to collect at 5kHz or just intermittently?  

0 Kudos
Message 10 of 10
(3,372 Views)