ProDAQ 3411 24-Ch. ADC Function Card User Manual
3411-XX-UM
Copyright,
1998-2009 Bustec Production Ltd.
Page 23 of 40
5. Programming the ProDAQ 3411
This chapter shows how to program the ProDAQ 3411 function card using the VXI
plug
&
play
driver.
Complete examples can be found in the “Examples” subdirectory of the driver. All functions are
explained in detail in the help file coming with the driver.
5.1. Connecting to the Function Card
To initialize the driver and connect to the ProDAQ motherboard, the standard VXI
plug
&
play
initialization function
bu3411_init()
is used (see Figure 12, ). (Please refer to the VXI
plug
&
play
standard VPP-4.3, section 4.3 for a detailed description of the address string used.)
After initializing the driver and connecting to the motherboard, the driver must be told which one of
the eight possible function cards on a ProDAQ motherboard to work with. This is done by the
function
bu3411_fcSelect()
. It takes as an argument the session established via the function
bu3411_init()
, the function card number and a boolean value specifying whether to reset the
selected function card (see Figure 12, ).
Figure 12 - Opening a Session
For your convenience, the driver contains a new function called
bu3411_paramInit()
, which
combines the functionality of the
bu3411_init()
and
bu3411_fcSelect()
functions by extending
the argument list of the standard initialization function with a parameter specifying the function card
number (see Figure 12, ).
#include <visa.h>
#include <bu3411.h>
main (int argc, char **argv)
{
ViStatus status;
ViSession session;
ViChar descr[256];
if ((status = bu3411_init(“VXI0::2::INSTR”, VI_TRUE, VI_TRUE, &session)) != VI_SUCCESS)
{
viStatusDesc (rm_session, status, descr);
printf (“Error: bu3411_init() failed due to %s\n”, descr);
return -1;
}
if ((status = bu3411_fcSelect(session, 1, VI_TRUE)) != VI_SUCCESS)
{
viStatusDesc (instr_session, status, descr);
printf (“Error: bu3411_fcSelect failed due to %s\n”, descr);
return -1;
}
/* OR: */
if ((status = bu3411_paramInit(“VXI0::2::INSTR”, 1, VI_TRUE, VI_TRUE, &session)) != VI_SUCCESS)
{
viStatusDesc (rm_session, status, descr);
printf (“Error: bu3411_paramInit() failed due to %s\n”, descr);
return -1;
}
/* ... */