Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

VScale Problem

Hi,
after waiting for a week for a call of NI germany, maybe I can get some help
in here.

I'm develloping a System with VC 6 SP4 on a NT 4 SP6 System.
There are 3 NI cards installed in the system.

PCI 6032E as device #1
PCI DIO 96 as device #2
PCI 6703 as device #3

I':m using NI-DAQ 6.9.1.

The problem is about AI with PCI 6032E

I'm using the card in diff mode, when I read 8 channels (0,1,2,3,4,5,6,7)
VScale returns an error -10007 (badChanError). If I'm using 7 channels
everything is ok with channels (0,1,2,3,4,5,6) and channels (7, 0,1,2,3,4,5)
the parameters are calcualted and work with every combination of up to 7
channels, I don't think they are wrong.
The previous calls (SCAN_Op, SCAN_Demux) return no error.

any suggestions ?

regards Rolf Behrens
0 Kudos
Message 1 of 3
(2,330 Views)
Rolf,

You've given a good description of your system (hardware, NI-DAQ version, etc.). However, it's not clear how you are using the DAQ_VScale function. Also, I assume it is that one and not the AI_VScale function. DAQ_VScale takes its channel parameter as a 16-bit integer. So, I assume you mean that you are specifying "0, 1, 2, 3, 4, 5, 6, 7" for the SCAN_Op function only. You can use the NI-DAQ Help file to see the descriptions of these functions and verify those input parameters.

You seem to have a good understanding that if you are configured for differential mode, accessing any channel above 7 will give this particular error message. However, channels 0-7 should not give this error.

Just in case, there is a KnowledgeBase 23DF9ILS: "Error -10007 Wh
en Configuring a DAQ Board for Single-ended Mode Programmatically" that warns about how one could accidentally be changing from the differential mode in the program.

The best thing to do is to start with the SCANsingleBufSync example. This uses SCAN_Op, SCAN_Demux, and DAQ_VScale to scan 2 channels. Make the device number appropriate. Then, to be able to scan 8 channels, you only need to change the following parameters:

i16 iNumChans = 8;
i16 iChan = 0;

static i16 piChanVect[8] = {0, 1, 2, 3, 4, 5, 6, 7};
static i16 piGainVect[8] = {1, 1, 1, 1, 1, 1, 1, 1};

Later on, you can change the scan rate, buffer size, and gain settings, but for purposes of eliminating the error, that's all you really need to do.

Regards,
Geneva L.
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 3
(2,330 Views)
Thanks Geneva,
....
> The best thing to do is to start with the SCANsingleBufSync example.
> This uses SCAN_Op, SCAN_Demux, and DAQ_VScale to scan 2 channels.
> Make the device number appropriate. Then, to be able to scan 8
> channels, you only need to change the following parameters:
>
> i16 iNumChans = 8;
> i16 iChan = 0;
>
> static i16 piChanVect[8] = {0, 1, 2, 3, 4, 5, 6, 7};
> static i16 piGainVect[8] = {1, 1, 1, 1, 1, 1, 1, 1};
....
I did the changes and the difference to my calls is

numChannels = 8;
....
DAQ_Vscale(1,
numChannels, // it has to be 0 !!!!!!!!!! ...

I'd used this class before but not with E-Series. On other than E-Series
cards this parameter is ignored, so the class works fine wit the other
devices.

In the NI DAQ Help file I can
read the following

....
> chan is the onboard channel or AMUX channel on which the binary data was
acquired.
> For devices other than E Series and DSA devices, this parameter is ignored
because the
> scaling calculation is the same for all of the channels. However, National
Instruments
> recommends you pass the correct channel number.
....

In my case I got an array of channels which is the "correct channel number"
? With every number < 8 it works fine with and the values were ok for every
channel. This confuse me a bit.

Regards
Rolf Behrens
0 Kudos
Message 3 of 3
(2,330 Views)