ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read multiple AI channels correctly using the USB-6009?

I am using the NI USB-6009 for analogue data input recording in a lab course I teach.  The data should be collected at high bandwidth (10 kS/second x 3 channels), ideally with different voltage ranges for each input channel (RSE).  The problem I am encountering is that the channels are not always read correctly.  They are either read correctly (values x, y, z for the three channels), or else they are read incorrectly (approximate values z, y, z).  By stopping and restarting the data collection, I can eventually get the read-out of the channels in the correct order, with the correct values, which is maintained until I stop the data collection.  Upon restarting, I either get the correct values or else the swapped values, which again persist until the sampling is stopped and restarted.

 

I coded this using DAQmx commands in LabVIEW8.6 and thought the problem lay with my code.  However, today I tried using Measurement & Automation Explorer 4.5.0f0 to set up the sampling task and I have the same problem.  Thus, the problem appears to lie with the way the computer interfaces with the DAQ card. 

 

Here are a few of the trouble-shooting things I have tried:

 

1) reducing the sampling rate to 1 kHz per channel - no change

 

2) changing all of the channels to have the same input voltage range - no change

 

3) reading only two channels rather than three - results in consistent, correct readings at all times, independent of which two of the three I sample.

 

Based on 3), I thought this might be an issue of data sampling.  However, implementing 1) did not solve the problem.

 

Does anyone have any ideas of what could be going on, or other things to try?

 

 

0 Kudos
Message 1 of 13
(5,254 Views)

Follow-up comment:  I have just tried swapping the USB-6009 for another one (same model) in the lab.  The same problem occurs, so it is not that I have a bad card (unless I have extremely bad luck and have two that work improperly in exactly the same way, giving the same readings).

 

0 Kudos
Message 2 of 13
(5,250 Views)

Hi nforde,

 

I have a few questions regarding the setup and application:

 

1) What are the voltage ranges of the three signals?

 

2) What channels are the three signals coming into and have you tried separating them by multiple channels?

 

3) Are you actually seeing the same signal on two of the channels or is it something similar?

 

4) Do each of the signals sample properly when you acquire them individually, just one at a time, instead of multiplexing through all of them?

 

5) You should review this KB to make sure that we are not running into a ghosting issue.

 

 

 

Ryan T
National Instruments
Applications Engineer
0 Kudos
Message 3 of 13
(5,219 Views)

Hi Ryan,

 

Here are some answers to your questions:

 

1) channel 1:  +/- 1V

    channel 2:  +/- 1V 

    channel 3:  +/- 10V

 

2)  I had the channels coming into AI1+ (screw terminal 5); AI2+ (8) and AI3+ (11), respectively.  Based on your question, this morning I tried changing channel 1 to AI0+ (2), with no difference in the results.  Input terminals 1,4,7 and 10 are tied together as ground.  I read the inputs as RSE.  No other wires are attached to the device (apart from the USB out cable, of course).

 

3)  I see values of either (0.003, 0.004, 0.07) OR (0.06, 0.003, 0.003) (or similar values).  When I have my laser turned on (this is used to measure signal from a quadrant photodiode), the signal levels are higher, with channel 3 giving values between 1 and 10 V, hence the choice of voltage ranges in answer to question 1).  For trouble-shooting, I am just using ambient light levels and hence the lower read voltages.

 

4)  The signals read consistently when I sample only one of the channels at a time, or even two of the channels at a time.  It is only when I sample all three that I run into this bimodality of output.

 

5)  I have read the article on ghosting, but I don't think this is what I am seeing.  If I understand it correctly, ghosting should appear as a consistent response in the output when the channels are being read, i.e., each time the task is run, the same output occurs (though perhaps not the correct output).  I have the problem that I cannot read the signals consistently.

 

I hope this helps you to help me troubleshoot.

 

Cheers,

Nancy

 

0 Kudos
Message 4 of 13
(5,212 Views)

Hi Nancy,

 

This sounds very unusual.  Some further follow-up questions...

1.  Could you provide the code you are using?

 

2.  How many runs does it typically take for the behavior to demonstrate itself?

 

3.  Does the data ever swap mid-run or is it always when a new task is started?  Once the swap takes place does it stay that way until the task is restarted?

 

4.  This might be a long shot... but what OS are you running?  If XP, could you try installing this hotfix from Microsoft?  The particular bug can cause weird behavior and the hotfix is specifically recommended in our more recent DAQmx Readmes.

 

5.  What computer/USB Host Chipset are you using?

 

Sorry to just give another string of questions.  I'm still trying to get a grasp on what could be happening.  For now I would try the Microsoft hotfix (if you are running XP)--it's the only explanation I could think of for channels inexplicably swapping places unless there is something specific in the code.

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 13
(5,189 Views)

Hi John,

 

Thanks for the follow-up.  Here are answers to your questions: 

 

1.  I can provide the code,* but since the problem occurs even in Measurement & Automation Explorer, it seems to me not to be a problem with my code but with something more fundamental.  In M&AE, I read channel 1 with+/-1V, RSE; channel 2 with +/-1V, RSE; channel 3 with +/-10V, RSE, where channels are as I've previously specified.  I acquire data continuously at 10kHz, 10ksamples at a time.

 

2.  The behaviour can exhibit itself at any time.  Sometimes the first run, sometimes it reads "correctly" four times in a row and on the fifth restart will switch to the "incorrect" readings.  It switches back and forth randomly between runs, so there is no predicting which outcome I will see before I hit the start button.

 

3.  It never switches midrun.  It is always consistent within a run.  Only after stopping and restarting (in M&AE or LabVIEW) does it have the potential to switch.

 

4.  We are using XP.  We installed the Hotfix that you suggested this morning, but sadly, this did not solve the problem.

 

5.  We are using a USB2.0 onboard (motherboard built-in) Intel chipset.  It is an Intel motherboard (Dell computer).

 

This is a complete puzzle to us, too.  Any suggestions of other things to try are most welcome.  I need to get on to aligning the instrument but would really like to fix this problem first so I can have readings I can rely on for alignment.  I am completely stumped as to what else to try.


Cheers,

Nancy

 

 

*This portion of the code is buried within a much larger LabVIEW program.  We use the identical code on a different computer with the PCI6052E board in a different lab and it works just fine, never having given us problems.

 

0 Kudos
Message 6 of 13
(5,172 Views)
I should follow up that the measurements in Measurement & Automation Explorer are done as a defined task, whereby all three channels are read "simultaneously".  If I read only one or two, the output values are consistent, as I also observe within LabVIEW.
0 Kudos
Message 7 of 13
(5,165 Views)

Did this ever get resolved?  I am having a very similar problem.

 

Using 3 channels of a USB6009 at 15kHz, it seem to randomly assign the channel order.  This happens if the vi is restarted.  It will also happen when using the DAQ assistant /properties /run to test the channels.

 

-Ben

Message 8 of 13
(4,515 Views)

Hi Ben,

 

The Microsoft issue that was fixed in the patch mentioned earlier in this thread is one possible cause of channel swapping, so if you are using XP and you have not installed it yet I'd strongly recommend doing so.

 

I'm glad you brought this thread back to my attention though, becuase I do have new information to give.  It was recently discovered that a previously resolved issue within the 6008/6009 driver itself (CAR 178589) can cause channel swapping in some circumstances.  This particular issue was fixed in DAQmx 9.1 so if you're on an earlier version you should upgrade:

 

If using LabVIEW 8.2, you can only upgrade as far as 9.1.1.  This version of DAQmx has a patch available that you should install as well if you need to use 9.1.1.

If using LabVIEW 8.5, you can upgrade as far as 9.3.

The latest version of DAQmx is 9.4 -- it supports LV 8.6 up to LV 2011.

 

 

I have also seen data integrity issues when using the USB implementation available on some virtual machine software, but that is more of a corner case and I'm assuming that if you were using a Virtual Machine you would have mentioned it.

 

 

So, assuming you're not on a virtual machine, I'd make sure you are using DAQmx 9.1 or later and make sure that you have applied the Windows EHCI hotfix (if you are on XP).

 

 

If you still observe any form of channel swapping or data integrity issue after following the above suggestions, please let me know as this is a topic that NI takes very seriously.  I would need to know more information about the exact hardware and software you are using (Computer make and model, USB Host Controller, OS, NI Software versions, etc.) so I could attempt to reproduce the problem.

 

 

Best Regards,

John Passiak
0 Kudos
Message 9 of 13
(4,499 Views)

Another thing... When configured RSE, the range is fixed at ±10V regardless of what you plug into the min/max terminals.  Only by using differential do you get the 8 voltage ranges.

 

If you're getting the values you expect as RSE, just configure everything as 10V and read them all in one shot.

0 Kudos
Message 10 of 13
(4,491 Views)