Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

double buffered acquisition of multiple channels with NI 4472 and CVI

does anyone have example code showing how to use DAQ_Monitor, SCAN_Demux, and DAQ_VScale in CVI to retrieve data from all 8 channels of an NI 4472 DSA card during a continuous, double-buffered acquisition?
0 Kudos
Message 1 of 2
(6,259 Views)
I think I can help here...
I will attach a couple of examples that show how to use NI 4472 with CVI but before, I would like to give a couple of additional information that may make your life easier

1- NI4472 is a 24 bits board, so that we will need to declare an array of integers (int*) to retrieve binary data. NI-DAQ is expecting an array of short (short*) as its "buffer" parameter. Simply cast your (int*) to (short*) when calling the "SCAN_Start()" function
SCAN_Start (device, (short *)binaryBuffer,(nbOfPoints*nbOfChannels), 0,0, 0, 0);

2- NI 4472 is expecting a gain in dB - More precisely, this board has no gain (+/- 10V input range) so that you will have to use "0" as the gain settings (actually, an array of "0" as the gainList parameter for the Scan_Setup() function)

3- In order to turn ICP excitation On or Off and/or set the coupling to AC or DC, you will need to use the AI_Change_Parameter () function that is located in the "Single point" analog input acquisition palette. This may be confusing since DSA boards are not able to perform single point acquisitions...

4- Scan_Demux() does not work for DSA. The reason for that is related to the use of "array of short" by NIDAQ functions vs "array of integers" for DSA boards
I will make sure to attach a function that shows how to "demux" the channels in my attached examples

5- Using analog trigger...
You will need to call Select_Signal() with the following parameters after you call the Configure_HW_Analog_Trigger() function in order to enable analog trigger :
Select_Signal (device, ND_IN_START_TRIGGER, ND_ATC_OUT,ND_DONT_CARE);

6- Regarding analog trigger, please note that the analog trigger level will be expressed in binary in the Configure_HW_Analog_Trigger() function - You will need to convert a voltage to its 24 bits binary representation.
+10V --> + [(2^24)/2] -1
0V --> 0
-10V --> - (2^24)/2

7- About the examples I attach...
a>Most of these examples have been built using CVI and include a User Interface
b>Some have hardcoded settings, some are more interactive
d>Additional error checking WILL be required (check if malloc()returns valid pointers for instance...)
e>I attach an example that shows how to synchronize 2xNI4472's as well

I only can attach 3 examples to this answer...
Please feel free to contact me directly if you need more examples.
My email address is gerald.albertini@ni.com

I hope this will help !

Best Regards

Gerald Albertini
Message 2 of 2
(6,259 Views)