I'm affraid I've given-up searching; 1/2 a day in help documents/coding, 1/2 a day online!!! And no obvious solution can I find.
So, sorry for the basic nature of this question, but I'm about to drive over there and bang on your windows! 😛
Ok, I have been following the article in NI-DAQmx C Reference Help
-> Key NI-DAQmx Concepts -> Generic Programming Flows -> Digital Output Flows -> Finite Digital Output.
This seems to cover my requirements; I am trying to write data to a PIC processor, which requires using two logic lines, one to flag a data logic-level, and the other to clock it into the device. No requirement on hardware clocking to get the data synchronised with an outside source, I intend the PCI card/VC++ to clock itself. Done repeatedly, I can send data to configure the PIC from our PCI 6221 card/PC. This all is done in a visual c++ environment using the DAQmx commands.
Initially, I have done this by creating a task, creating a digital output channel, starting a task, writing a byte to a port of the 6221, and then stop/clearing the task - and then repeating the process (that does one bit). Of course this takes ages, so I want to prep my 'bytes' in a buffer that I can then stream down through the port much faster. I understand this can be done (if not only from the document discribed above)
From the document in the C reference help, the process is as follows:
Create Channels
Config the timing (DAQmxCfgTimingSampClk)
Write Samples (DAQmxWriteDigitalLines)
Start (DAQmxStartTask)
wait for complete (DAQmxWaitUntilTaskDone)
Stop (DAQmxStopTask)
Clear (DAQmxClearTask)
So, in pseudo-code I call in order:
DAQmxErrChk ( DAQmxCreateTask( "", taskhandle ) );
DAQmxErrChk ( DAQmxCreateDOChan( taskhandle, "Dev1/PFI0:7","", DAQmx_Val_ChanForAllLines ) );
DAQmxErrChk ( DAQmxCfgSampClkTiming( taskhandle, NULL, 100, DAQmx_Val_Falling, DAQmx_Val_FiniteSamps, number ) );
DAQmxErrChk ( DAQmxWriteDigitalLines( taskhandle, number, FALSE, 10.0, DAQmx_Val_GroupByChannel, data, &written, NULL ) );
DAQmxErrChk ( DAQmxStartTask( taskhandle ) );
DAQmxErrChk ( DAQmxWaitUntilTaskDone ( taskhandle, 20.0 ) );
DAQmxErrChk ( DAQmxStopTask( taskhandle ) );
DAQmxErrChk ( DAQmxClearTask( taskhandle ) );
The error I recieve is no. -200077:
"
Requested value is not a supported value for this property.
Property: DAQmx_SampTimingType
Requested Value: DAQmx_Val_SampClk
Task Name: _unnamedTask<0>
Status Code: -200077
"
This error is thrown when the programme gets to DAQmxWriteDigitalLines; so I think it is either this or the preceeding call to DAQmxCfgSampClkTiming that has caused a problem.
To those that know, this is probably a Very simple fault on my part, but I cannot find it.
If anyone can point out my error, I would be very grateful.
Daniel.