Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2167

Sample of DAQmxCreateDOChan have error (NI-USB-6211)

$
0
0

Hello,

 

I ran the sample program

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values\Cont Write Dig Port-Ext Clk, but got a message as below:

 

DAQmx Error: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: DAQmx_SampTimingType
Requested Value: DAQmx_Val_SampClk
Possible Values: DAQmx_Val_OnDemand

Task Name: _unnamedTask<0>

Status Code: -200077
End of program, press Enter key to quit

 

 

 

I'm using USB-6211 and nothing is connected to it except usb cable.

Could you give any advice regarding this error?

 

Main program is here:

int main()
{
	int32       error = 0;
	TaskHandle  taskHandle = 0;
	uInt32      data[8] = { 1,2,4,8,16,32,64,128 };
	char        errBuff[2048] = { '\0' };

	/*********************************************/
	// DAQmx Configure Code
	/*********************************************/
	DAQmxErrChk(DAQmxCreateTask("", &taskHandle));
	DAQmxErrChk(DAQmxCreateDOChan(taskHandle, "Dev2/port1", "", DAQmx_Val_ChanForAllLines));
	DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle, "/Dev2/PFI0", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000));

	DAQmxErrChk(DAQmxRegisterDoneEvent(taskHandle, 0, DoneCallback, NULL));

	/*********************************************/
	// DAQmx Write Code
	/*********************************************/
	DAQmxErrChk(DAQmxWriteDigitalU32(taskHandle, 8, 0, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL));

	/*********************************************/
	// DAQmx Start Code
	/*********************************************/
	DAQmxErrChk(DAQmxStartTask(taskHandle));

	printf("Generating digital output continuously. Press Enter to interrupt\n");
	getchar();

Error:
	if (DAQmxFailed(error))
		DAQmxGetExtendedErrorInfo(errBuff, 2048);
	if (taskHandle != 0) {
		/*********************************************/
		// DAQmx Stop Code
		/*********************************************/
		DAQmxStopTask(taskHandle);
		DAQmxClearTask(taskHandle);
	}
	if (DAQmxFailed(error))
		printf("DAQmx Error: %s\n", errBuff);
	printf("End of program, press Enter key to quit\n");
	getchar();
	return 0;
}

 

Thank you.


Viewing all articles
Browse latest Browse all 2167

Trending Articles



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