Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Initializing DA/AD once or not at all? (NI6025e)

 

I have a NI6025e PCI card. While upgrading to new computers and operating systems we need to rewrite some C++ code to function with the NIDAQmx.

 

In the old code we initialized the card to have (similar to ex.  DAQmxCreateAOVoltageChan):

- 8 AD out, with +/-10V

- 8 DA in, differential and +/-10V

 

When I look at the example files (for NIDAQmx) I see that they use the same TaskHandle when creating the cannels and writing to the device. The same goes for reading (setting the sample rate). The TaskHandle should also be released as not to hold memory unnecessarily.

 

So I wonder what is best:

- Initialize the AD and DA once in a separate function?

-Skip the initialization and instead do the Create each time I need to read or write. That would also mean that I allocate and deallocate memory for the TaskHandle each time.

 

I read and write to the card at about 10-20 timer per second.

0 Kudos
Message 1 of 1
(3,478 Views)