LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ functions that use twice the expected size...

I have a problem understanding many DAQ functions that seem to need arrays of a size twice what is
expected.

1st example: WFM_Op needs an output vector twice the size necessary for a single channel. Only the
1st half of the array is used for the waveform generation.

2nd example: SCAN_Op needs a receiving buffer, also twice the size. The resulting is an array of
short whose resulting content in single channel is 0,A1,0,A2,0,A3 ('A' being the data on 1st
channel) and in dual channel is 0,A1,0,B1,0,A2,0,B2,0...

Even if I compile some of the sample codes found in ...\Samples\Ao and A1 I need to double the
array sizes or they won't compile. Has the array type been changed from short to int and the
documentation not updated or
am I completely missing the point ?

(Using CVI 7.0 with NI-DAQ 7.2)
--
Guillaume Dargaud
http://www.gdargaud.net/
"Electrical force is defined as something which causes motion of electrical charge; an
electrical charge is something which exerts electric force." - Arthur Eddington (1882-1944),
British astronomer.
0 Kudos
Message 1 of 2
(2,954 Views)
Answering my own post here, I'd missed this:

/* IMPORTANT NOTES FOR DSA devices (Dynamic Signal Acquisition))

DSA devices can format samples in a
left-justified format in 32-bit data words. This means that the most
significant bits of the data word contain the bits generated by the
converter. When allocating data buffers, be sure to account for the
32-bit data width. Even though a number of DAQ/SCAN/WFM functions are
declared to accept pointers to 16-bit data buffers, you should pass
pointers to 32-bit data buffers.
* but you cannot use 'long' directly because the data is in the
MSB, giving wrong results if read as long.
Instead skip every 2nd short: 0A0A0A0A... or 0A0B0A0B... with 2 channel
s

Also, modify the iGain parameter to be in units of dB.
* meaning iGain must be 0 instead of the default 1

Also for DSA devices, remember to call AO_Change_Parameter to enable the analog output.
*/


--
Guillaume Dargaud
http://www.gdargaud.net/
"When all else fails, read the manual."
0 Kudos
Message 2 of 2
(2,954 Views)