LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't read voltage from more than one channel (DAQmx read)

 

I have a SCB 68A connector from National Instruments and I want to read out the noise signal (the open voltage - there is nothin  connected to it right now) from it. So I used the example code (voltage1channel.png) provided by National Instruments (https://decibel.ni.com/content/docs/DOC-28502).

 

I got 5 mV which is a reasonable value (I measured the noise signal with an oscilloscope). Now I want to read out the noise signal from few channels. So I sightly changed the VI: voltage2channels.png (according to the documentation I need to create an array of channels and flatten them): 

But now I read out approximately 200 mV on both channels (and one of them is the same as in the first VI). It doesn't make any sense.

What am I doing wrong?

 

I want the user to be able to choose the channels, so I can't just write "Dev1/ai0:4".

Download All
0 Kudos
Message 1 of 12
(3,530 Views)

@user6567 wrote:
I want the user to be able to choose the channels, so I can't just write "Dev1/ai0:4".
 

This shouldn't be an issue, the combination of those using that flatten VI should work.

 


@user6567 wrote:
I got 5 mV which is a reasonable value (I measured the noise signal with an oscilloscope). Now I want to read out the noise signal from few channels. So I sightly changed the VI: voltage2channels.png (according to the documentation I need to create an array of channels and flatten them): 

But now I read out approximately 200 mV on both channels (and one of them is the same as in the first VI). It doesn't make any sense.

What am I doing wrong?

 


I think this points toward a terminal configuration issue. Are you reading in the voltages as differential or single ended? You have your inputs set to "Default" configuration. Have you tried changing between the different selections there to see if that affects anything?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 12
(3,474 Views)

First think you'll want to do is to stop using the DAQ Assistant -- it is OK for doing a quick Demo, but is a little too simple-minded to easily do what you want.  However, you can use it to "teach yourself DAQmx" (or you can read this excellent White Paper).

 

What you are going to want to do is to have a While Loop where the actual sampling takes place.  Before the loop will be some DAQmx code to configure and start the Task, and following the loop will be code to stop the Task.

 

What you want to do before the loop is to call (in a For Loop) DAQmx Create Virtual Channel for each Channel you want, assigning the values appropriate for that channel (you can have an array of parameters that are indexed by the For loop).  To get an idea of what this would look like, open a new blank VI and drop down a DAQ Assistant.  Configure it with a set of channels, say AI0, AI2, and AI5 (you need to have your device connected for this step, though you can also use a simulated device).   Now right-click the Assistant and tell it to generate the DAQmx code for you.  Notice there are three Create Virtual Channel functions, one for AI0, AI2, and AI5, all strung together with the Error and Task wires passed from Task to Task.  If you do this in a For loop, just make sure that the Task (and Error) in and out of the For loop are through Shift Registers.

 

Bob Schor

0 Kudos
Message 3 of 12
(3,471 Views)

Bob, I think you responded to the wrong thread. The above snippets are already in low level DAQmx code.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 12
(3,456 Views)

Oops, you are correct.

 

Still, the point is that once you set up the N channels that you want to use (I've not used Terminal Configuration, myself, but doing it one channel-at-a-time in a For loop should also work), all you need to do is to specify a multi-channel Read to read all the channels "as near simultaneously as the hardware allows".

 

BS

0 Kudos
Message 5 of 12
(3,442 Views)

User6567,

 

Index arrayis exandable, just drag the bottom downwards.  By default, without wiring in any indices, you'd get the values in index 0, index 1,  .....

 

So you can eliminate the 2nd Index array, the wire branch on the array, and also the index constants.

 

0 Kudos
Message 6 of 12
(3,433 Views)

Yes, I tried using different configurations. For most of my tests it was the default configuration, but I also used the rest of them.

0 Kudos
Message 7 of 12
(3,383 Views)

 

0 Kudos
Message 8 of 12
(3,377 Views)

http://digital.ni.com/public.nsf/websearch/4E9B8B3F8FD3A31B862562B5004EA1D9?OpenDocument

 

If you don't have anything connected to the channel, it's not being driven to 0V.  You can't accurately measure the noise in this way.  Essentially, you're expecting a voltage where you don't have anything specific driving the voltage.

0 Kudos
Message 9 of 12
(3,362 Views)

Sorry for my choice of words. As it was pointed out to me, I don't actually want to measure the noise, but the open voltage. My problem is that when I use only one channel, I have approximately 5 mV, but when I use two channels, I have approximately 200 mV on each one of them. And I want to make sene of it.

0 Kudos
Message 10 of 12
(3,308 Views)