3411-XX-UM
ProDAQ 3411 24-Ch. ADC Function Card User Manual
Page 24 of 40
Copyright,
1998-2009 Bustec Production Ltd.
For the driver functions to work properly, you will either have to use the function
bu3411_paramInit()
to open a session with the device, or you will have to call the function
bu3411_fcSelect()
after calling the function
bu3411_init()
and before any other driver function
is called.
To close a session with the ProDAQ 3411 24-Ch. ADC function card, the standard VXIplug&play
function
bu3411_close()
must be used.
5.2. Setting Gain and Filter
The filter and gain stages on the ProDAQ 3411 function card are configured using the function
bu3411_setFEconf()
. It takes as arguments the session to the instrument, a value for the gain
setting, a value for the filter setting and a flag, which switches on or off the OTD (Open
Thermocouple Detection). The gain can be set to 1, 10, 100 and 1000 using macros predefined in
the include file
bu3411.h
. The filter can be set to 10 Hz, 100 Hz, 1000 Hz and bypass. Again,
macros predefined in
bu3411.h
should be used (see Figure 13, ).
5.3. Acquiring single Samples
The VXI
plug
&
play
driver for the ProDAQ 3411 24-Ch. ADC function card provides two functions for
acquiring single samples from the inputs. For acquiring a sample from a single channel, the
function
bu3411_sampleChannel()
is used. It takes a channel number and returns the measured
value in volts. The function
bu3411_sampleChannels ()
can be used to acquire a single sample
from more then one channel at a time. It takes a channel mask as parameter and returns the
measured values in an array (see Figure 13, and ).
Figure 13 – Acquiring single Samples
/* ... */
/* set the gain to 10, the filter to 10 Hz and disable OTD */
if ((status = bu3411_setFEconf (session, bu3411_GAIN_10, bu3411_FILT_10HZ, 0)) < VI_SUCCESS)
{
bu3411_error_message (rm_session, status, descr);
printf (“Error: bu3411_ setFEconf () failed due to %s\n”, descr);
return -1;
}
/* measure channel 1 */
if ((status = bu3411_sampleChannel (session, 1, &val)) != VI_SUCCESS)
{
bu3411_error_message (rm_session, status, descr);
printf (“Error: bu3411_sampleChannel failed due to %s\n”, descr);
return -1;
}
/* measure channels 1, 2, 4 and 8 */
if ((status = bu3411_sampleChannels (session, 0x8B, arr_val)) != VI_SUCCESS)
{
bu3411_error_message (rm_session, status, descr);
printf (“Error: bu3411_ sampleChannels () failed due to %s\n”, descr);
return -1;
}
/* ... */