02-02-2011 02:58 AM
I am trying to create a reference trigger to sample analog inputs. However I get the following error :
DAQmxBase Error -200452: <err>Specified property is not supported by the device or is not applicable to the task.
And here is the code ( which is actually taken from one of the sample codes)
.
// Triggering parameters
char triggerSource[] = "/Dev1/PFI0";
uInt32 triggerSlope = DAQmx_Val_RisingSlope;
uInt32 triggerSamples = 100;
.
.
.
DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxBaseCfgSampClkTiming(taskHandle,clockSource,sampleRate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,samplesPerChan));
DAQmxErrChk (DAQmxBaseCfgDigEdgeRefTrig(taskHandle,triggerSource,triggerSlope,triggerSamples));
DAQmxErrChk (DAQmxBaseStartTask(taskHandle));
DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByChannel,data,bufferSize,&pointsRead,NULL));
printf ("Acquired %d samples\n", pointsRead);
// Just print out the first 10 points
for (i = 0; i < 10; ++i)
printf ("data[%d] = %f\n", i, data[i]);
Is reference triggering not supported on the 6215 ? I m using the following :
OpenSuse 11.2
NI DAQ mx base 3.4.0
Labview 10.0
I m basically just making use of the C APIs in my own program and dont use any other software to configure the DAQ.
Solved! Go to Solution.
02-03-2011 10:50 AM
Hi there,
You will find the fowllowing KnowledgeBase helpful:
Why Do I Get "Error -200452" When I Use Certain DAQmx Properties With My DAQ Board?
02-04-2011 01:40 PM - edited 02-04-2011 01:41 PM
Unfortunately, reference triggering is only supported in DAQmx Base 3.4 for PCI, PCIe, and PXI M Series (see the DAQmx Base 3.4 readme).
One possible workaround would be to sample the AI lines continuously and implement the reference trigger yourself in software.
Best Regards,
02-04-2011 02:16 PM
Thank you John and Efrain.
I sampled all the trigger lines and ultilmately implemented the triggering in software. A small script and it works like a charm!
In future, can NI devices be more universal in their functionality? I mean if reference triggering can be supported on PCI devices, how hard can it be to support the same on USB?
02-04-2011 04:11 PM - edited 02-04-2011 04:15 PM
The hardware itself does support reference triggering, but the feature has not been implemented in DAQmx Base. The full version of DAQmx does offer support for reference triggering on USB Devices such as the 6215, but you're probably aware that the full version of DAQmx does not provide support for USB devices on Linux.
I'm not a developer for the DAQmx Base group, but I do know that the USB streaming code is different from the PCI version and so including support for reference triggering in the driver is not as straightforward as one might think. I am of course glad to hear the software reference trigger is working out for your application.
Best Regards,