Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

Hardware timed single point DAQ with PXI-6143 uisng LabWindowsCVI

$
0
0

Hello,

 

I am trying to measure analog signal using PXI-6143 in a hardware timed single point manner using CVI.

It is said here that for for doing hardware timed DAQ using PXI-6143 you have to have even number of channels.

Though we only need one channel, we have create the second channel to have even number of channels.

 

The following is the part of the code that create the channels.The problem is that the DAQmxErrChk issues an error when the code tries to start the Analog input data acquisition.

 

 

 

//creating the tasks

DAQmxErrChk (DAQmxCreateTask("",&gAItaskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(gAItaskHandle,gAIchan,"",DAQmx_Val_Cfg_Default,gAImin,gAImax,DAQmx_Val_Volts,NULL));

DAQmxErrChk (DAQmxCreateTask("",&gAItaskHandle2)); 
DAQmxErrChk (DAQmxCreateAIVoltageChan(gAItaskHandle2,gAIchan2,"",DAQmx_Val_Cfg_Default,gAImin,gAImax,DAQmx_Val_Volts,NULL));


// sampling configuration

DAQmxErrChk (DAQmxCfgSampClkTiming (gAItaskHandle, "", gRate, DAQmx_Val_Rising, DAQmx_Val_HWTimedSinglePoint, DAQ_SpC_in));
DAQmxErrChk (GetTerminalNameWithDevPrefix(gAItaskHandle,"ai/SampleClock",trigName));

DAQmxErrChk (DAQmxCfgSampClkTiming (gAItaskHandle2, "", gRate, DAQmx_Val_Rising, DAQmx_Val_HWTimedSinglePoint, DAQ_SpC_in));
DAQmxErrChk (GetTerminalNameWithDevPrefix(gAItaskHandle2,"ai/SampleClock",trigName));

// start task
DAQmxErrChk (DAQmxStartTask(gAItaskHandle)); // here is where the code issues an error
DAQmxErrChk (DAQmxStartTask(gAItaskHandle2));
	

I wonder why the DAQ task wouldnt start, although two channels are made. Any idea is highly appreciated.


Viewing all articles
Browse latest Browse all 5339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>