05-14-2009 12:55 AM
migrated to DAQmx, unexpected behaviour in acquisition timing and value. uses NI 6013 PCI Card. I have some doubt in the migrated source code. Please verify whether I am correct or not.
Old code:
Select_Signal(DevNo, ND_PFI_2, ND_IN_CONVERT, ND_HIGH_TO_LOW);
Select_Signal(DevNo, ND_SCANCLK_LINE, ND_SCANCLK, ND_LOW_TO_HIGH);
New code:
DAQmxConnectTerms("/Dev1/ai/ConvertClock", "/Dev1/PFI2", DAQmx_Val_DoNotInvertPolarity);
DAQmxConnectTerms("/Dev1/ai/HoldCompleteEvent", "/Dev1/AIHoldComplete", DAQmx_Val_DoNotInvertPolarity)
regards
Praveen.DA
Solved! Go to Solution.
05-17-2009 11:39 PM
Nobody over there to answer a simple question!
I shall explain once again!!!
In the old application two Select_Signal() calls are using.
Please verify whether I am correct or not in migrating Select_Signal()
Old code:
1. Select_Signal(DevNo, ND_PFI_2, ND_IN_CONVERT, ND_HIGH_TO_LOW);
I assume that this is used to output the convert clock to the PFI-2 pin of the card. Is my assumption correct?
2. Select_Signal(DevNo, ND_SCANCLK_LINE, ND_SCANCLK, ND_LOW_TO_HIGH);
I assume that this is used to output the scan clock event to the SCANCLK pin (Pin No 46). Is my assumption correct?
New code:
1. DAQmxConnectTerms("/Dev1/ai/ConvertClock", "/Dev1/PFI2", DAQmx_Val_DoNotInvertPolarity);
2. DAQmxConnectTerms("/Dev1/ai/HoldCompleteEvent", "/Dev1/AIHoldComplete", DAQmx_Val_DoNotInvertPolarity)
Kindly verify whether my assumptions are correct and the new code is also does the same thing.
05-18-2009 05:37 AM
From NI Documentations I assume that,
1. ND_SCANCLK_LINE in the traditional DAQ is "/Dev1/AIHoldComplete" in DAQmx
2. ND_SCANCLK in the traditional DAQ is "/Dev1/ai/HoldCompleteEvent" in DAQmx
Correct me if I am wrong.
05-19-2009 05:04 PM - edited 05-19-2009 05:05 PM
Hi Praveenda,
What you described sounds correct. Note that DAQmxConnectTerms() is not task-based, so the resources used by the route will stay reserved until you call DAQmxDisconnectTerms() or DAQmxResetDevice(). The task-based equivalent would be something like this (untested) and will unreserve the resources used by the route when you clear the task:
DAQmxExportSignal(taskHandle, DAQmx_Val_AIConvertClock, "/Dev1/PFI2" );
DAQmxExportSignal(taskHandle, DAQmx_Val_AIHoldCmpltEvent, "/Dev1/AIHoldComplete" );
What sort of unexpected behavior are you seeing?
Brad
05-20-2009 03:51 AM
Thanks for your help.
Should I call DAQmxSetExportedAIHoldCmpltEventOutputTerm() function before or after calling
DAQmxConnectTerms("/Dev1/ai/HoldCompleteEvent", "/Dev%d/AIHoldComplete", DAQmx_Val_DoNotInvertPolarity)
What is the use of DAQmxSetExportedAIHoldCmpltEventOutputTerm() function?
redards
Praveen.DA
05-20-2009 11:51 AM
Hi Praveenda,
DAQmxExportSignal(taskHandle, DAQmx_Val_AIHoldCmpltEvent, "/Dev1/AIHoldComplete" ) is equivalent to DAQmxSetExportedAIHoldCmpltEventOutputTerm(taskHandle, "/Dev1/AIHoldComplete" ). They are separate functions in order to mimic the NI-DAQmx LabVIEW API, where DAQmx Export Signal is a VI and AIHoldCmpltEvent.OutputTerm is a property in the DAQmx Export Signal property node.
If you use DAQmxExportSignal() or DAQmxSetExportedAIHoldCmpltEventOutputTerm() then you don't need to use DAQmxConnectTerms(). DAQmxConnectTerms() is similar but not completely equivalent to DAQmxExportSignal(); they do roughly the same thing, but DAQmxConnectTerms() doesn't clean up after itself. DAQmxExportSignal() automatically cleans up the resources it uses when you clear the task.
Brad
07-06-2009 08:09 AM
OK, then what about Select_Signal( 1, ND_IN_START_TRIGGER, ND_PFI_0, ND_LOW_TO_HIGH ) code?
Would it be DAQmxExportSignal(taskHandle, DAQmx_Val_StartTrigger, "/Dev1/PFI0" )?