LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Differential Measurement

Hi, I'm trying to make a voltage differential measurement with USB6211 and can't seem to get it:


/*------------------------------------------------------------*/

DAQmxCreateTask("",&InHandle4);

DAQmxCreateTask("",&OutHandle4);  

DAQmxCreateAIVoltageChan (InHandle4, "Dev2/ai11,Dev2/ai12", "condAmp1, condAmp2", DAQmx_Val_Diff, -10, 10, DAQmx_Val_Volts, "");
DAQmxCfgSampClkTiming (InHandle4, "OnboardClock", SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 262144);
DAQmxCreateAOVoltageChan (OutHandle4, "Dev2/ao0", "", -10, 10, DAQmx_Val_Volts, NULL);
DAQmxCfgSampClkTiming (OutHandle4, "OnboardClock", SampleRate, DAQmx_Val_Rising, DAQmx_Val_ContSamps , 8192);


/*------------------------------------------------------------*/

 

 

please see attached LabWindows error message. I have another Task that is running along side with this one, could that be the source of the error? Could anyone point out the mistake? Thanks!

0 Kudos
Message 1 of 2
(2,870 Views)

Hi concordian,

I have a few suggestions and comments to make.  First off, you will only be able to read differentially from channels 0 through 7.  This is because 0 through 7 use channels 8 through 15, respectively, as the negative terminal for a differential measurement.  In the DAQmxCreateAIVoltageChan you should only need to specify one channel and if differential is chosen it will automatically look at it corresponding negative channel.  For example, if you would like to read differentially with the positive end at channel 1 then DAQmx will assume that you have the negative end connected to channel 9.  I would also recommend that you take a look at the DAQmx examples in CVI which can be found by selecting Help>>Find Examples and then navigating to Hardware Input and Output>>DAQmx>>Analog Measurements>>Voltage.  These are some great examples that you may be able to base your work off of. 

0 Kudos
Message 2 of 2
(2,844 Views)