LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6211 Simultaneous I/O

Hello all,

Im currently working on a VI aimed to restrict sleep stages in mice through stimulation.   To accomplish this, I've been working on a VI that records EEG and EMG (via a headmount electrode), activity data (via a piezo film and accelerometer on the floor of the cage), and outputs one analog output (to a stimulator) and two digital outputs (to mark detection and stimulation in external software respectively). In order to detect sleep states, we compute features of the signals, and compare them to determined thresholds.  Stimulation is T if: Detect is T AND a "Stimulate?" switch is T

 

To summarize, I have:

    4 analog inputs:  EEG,EMG,Piezo,Accel

    1 analog output : Stim waveform

    2 Digital outputs: Detection T/F, Stimulation T/F

 

We control these experiments through remote desktop, so I am unable to connect the 6211 to my local machine, so I have been testing the VIs capability to run without crashing using a USB-6218.  Using the 6218, I do not see any errors.  However, when I run the code over remote desktop, through the USB-6211, I receive the following error:

 

Capture.PNG

 

I have a 500 sample buffer (initialized with 500 0s) prior to a while loop, then I am reading 100 samples of data from my AI channels (at 500 Hz) and writing 100 samples of stimwaveform if stim is T or 100 0s if stim is F.  The digital outputs are created through DAQ assistant with the setting (1 Sample on Demand) within the loop.

 

So what I'm trying to get at is, does the 6211 have the ability to do what I am trying to do?  Or is it more likely that it is an error in my code that is causing the problem?

 

Thanks.

 

0 Kudos
Message 1 of 6
(3,797 Views)

The hardware, to me, looks very capable.  The biggest worry I would have would be the speed of USB transfers.  Earlier today, I did a test where I asked a USB 6009 (not nearly as capable as the 6211) to read a single Analog sample or a single Digital sample and timed how long it took to sample 1000 points -- it took about a half second, which I attribute mostly to USB speed (but that might be wrong ...).

 

I notice you are also doing single-sample output.  If the problem isn't Hardware, it might be Software.  How about posting your code?  Might there be some inefficiencies?

 

Bob Schor

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

Have you tried increasing the buffer size? In many cases this error happens because the buffer size is too small. 

0 Kudos
Message 3 of 6
(3,710 Views)

I have tried playing with the buffer some.  After discussing with a colleague, I think the issue may be the need for Parent/Child loops to handle heavy tasks.  Thanks for the input!

0 Kudos
Message 4 of 6
(3,682 Views)

Had you posted your code, we would have saved you time by suggesting parallel loops, with acquisition "by itself" in its own loop.  It is a good thing that you have knowledgable colleagues around.

 

Bob Schor

0 Kudos
Message 5 of 6
(3,674 Views)

I understand.  I'm avoiding posting due to ownership (it's a collaboration with a company).  It's actually the same code you had messaged me about a few weeks ago, Bob.  But it is getting somewhere. I just posted this before I consulted him.

0 Kudos
Message 6 of 6
(3,662 Views)