Hi,
I'm porting a Windows/NIDAQmx program to Linux/NIDAQmxBase, using a PCIe NI-6259 card. I'm receiving error 200284 on the example code below (distilled from the original program).
I do get a 4 MHz clock on the relevant external pin (P2.4) when specifying NULL as the source terminal in CfgSampClkTiming (though I know that the M series does not have an onboard clock), but when using PFI12 (which should be the ctr0 output) the program stops after the timeout specified in WriteDigitalU32 with "Some or all of the samples requested have not yet been acquired (etc)". What I am doing wrong?
#include <NIDAQmxBase.h>
#include <stdio.h>
void ErrChk(int32 status)
{
char buf[2048];
if (DAQmxFailed(status)) {
DAQmxBaseGetExtendedErrorInfo(buf, 2048);
printf("DAQmxBase Error: %s\n", buf);
}
}
int main()
{
TaskHandle clkTask = 0;
TaskHandle ddoTask = 0;
uInt32 data[10000]; /* pulse train */
ErrChk(DAQmxBaseCreateTask("SystemClock", &clkTask));
ErrChk(DAQmxBaseCreateCOPulseChanFreq(clkTask,"Dev1/ctr0","", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, 4000000, 0.50));
ErrChk(DAQmxBaseCfgImplicitTiming(clkTask, DAQmx_Val_ContSamps, 1000));
ErrChk(DAQmxBaseCreateTask("Dynamic Digital", &ddoTask));
ErrChk(DAQmxBaseCreateDOChan(ddoTask, "Dev1/port0/line9:0", "", DAQmx_Val_ChanForAllLines));
ErrChk(DAQmxBaseCfgSampClkTiming(ddoTask, "/Dev1/PFI12", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000));
ErrChk(DAQmxBaseWriteDigitalU32(ddoTask, 10000, 0, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL));
ErrChk(DAQmxBaseStartTask(clkTask));
ErrChk(DAQmxBaseStartTask(ddoTask));
sleep(1000);
return 0;
}
Built with gcc -I/usr/local/natinst/nidaqmxbase/include -L/usr/local/natinst/nidaqmxbase/lib -lnidaqmxbase test.c -o test.
I read the knowledge base article on error 200284, and either it doesn't apply here since I'm not doing any reading, or things happen behind the scenes that I'm not aware of.
Thanks in advance,
Orjan
Message Edited by Support on 10-06-2008 08:50 AM