Hello,
i would like to write a number of samples. A sample should be aquired every second. For Example on port 0 should be written. Data should come out of a data array like:
data[10]={0x000f00f, 0xffffffff,......}. Each Element of this array should be written to the port 0 one time. So the complete session should last 10 seconds.
And the other way round i would like to do it, too. Do a sample from port 0, store it into an array, wait a second....
i tried it this way but it wouldn't work:
uInt32 data[2]={0x000f00f, 0xffffffff;...};
int32 written;
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"OnboardClock",1.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,10));
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
/*********************************************/
// DAQmx Write Code
/*********************************************/
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle,10,1,10.0,DAQmx_Val_GroupByChannel,&data,&written,NULL));
Documentation says if i want to use the internal clock of the device i should use OnboardClock or NULL. Both doesn't work.
Thanks forward for every information
Greetings
Andreas