LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading voltages into a USB6210 using CVI

Solved!
Go to solution

I have had this board working ok until I connected it to some other equipment.

the first 3 inputs are connected to load cell amps and the fourth to measure the output of the test machine appling load to the load cells.

Its when I conect to this test machine the voltages go all over the place.

I have the inputs wired in differential mode.

I got into Test panels and selected differential then ran the program, then selected create a task so I could select four inputs and all the channels read ok.

So what I think I need is some way to configure my code to set the USB6210 to be in differential mode.

I have searched the NI examples and can not find an example.

 

this is the code I use to set up the USB6210

 

 int32       error=0;
 TaskHandle  taskHandle=0;
 char        chan[256];
 float64     min=-10.0,max=10.0,rate=10000;
 uInt32      sampsPerChan=100;
 int32       numRead,a;
 uInt32      numChannels;
 float64     *data=NULL;
 int         log;
 char        errBuff[2048]={'\0'};
 uInt32      i;
 float  Floatnum;
 char NumString[30]; 

   /*********************************************/
  // DAQmx Configure Code
  /*********************************************/
  
  DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
  DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai1,Dev1/ai2,Dev1/ai3,Dev1/ai4","",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
  DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,sampsPerChan));
  DAQmxErrChk (DAQmxGetTaskAttribute(taskHandle,DAQmx_Task_NumChans,&numChannels));

  if( (data=malloc(sampsPerChan*numChannels*sizeof(float64)))==NULL )
   {
   MessagePopup("Error","Not enough memory");
   goto Error;
      }
  /*********************************************/
  // DAQmx Start Code
  /*********************************************/
  DAQmxErrChk (DAQmxStartTask(taskHandle));
  

0 Kudos
Message 1 of 2
(2,766 Views)
Solution
Accepted by topic author redgumturner

You may have to use:

 

DAQmxSetChanAttribute (taskHandle, "", DAQmx_AI_TermCfg, DAQmx_Val_Diff, 0);

 

This will affect all channels in the task.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,761 Views)