Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

ND_SCANCLK_LINE in DAQmx

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(4,164 Views)

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.
 

 

0 Kudos
Message 2 of 7
(4,142 Views)

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.

0 Kudos
Message 3 of 7
(4,134 Views)
Solution
Accepted by praveenda@gmail.com

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

Message Edited by Brad K on 05-19-2009 05:05 PM
---
Brad Keryan
NI R&D
0 Kudos
Message 4 of 7
(4,114 Views)

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

 

0 Kudos
Message 5 of 7
(4,098 Views)

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

---
Brad Keryan
NI R&D
Message 6 of 7
(4,086 Views)

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" )?

I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 7 of 7
(3,982 Views)