LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine number of active channels

Hello,

 

 I am writting an adapter that allows the user to select a number of channels and then write a buffer out to the channels.  I do not know how many channels will be used apriori and cannot tell the system, instead just allow them to send the channel string and then send the buffer.  Is it possible to poll the system to see how many channels were created?

 

Here is the example code:

 

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,Device_,"",(float64)minVolts_,(float64)maxVolts_,DAQmx_Val_Volts,NULL));
DAQmx  Get Number of created channels...

 

DAQmxErrChk (DAQmxWriteAnalogF64(taskHandle,length/ ( Number of active channels ),0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL));   

 

Thank you

0 Kudos
Message 1 of 2
(3,019 Views)

Ok I got it

 

 DAQmxErrChk(DAQmxGetTaskAttribute(taskHandle, DAQmx_Task_NumChans,&numChannels));

 

Thanks

 

 

0 Kudos
Message 2 of 2
(3,006 Views)