The GxSmu driver contains a set of functions for the GX3104 board. The GxSmu functions are designed with consistent set of arguments and functionality. The function library initializes the GxSmu driver for a specific board, resets the board, and displays the virtual panel. All the functions use handles to identify and reference a specific board and all functions return status and share the same functions to handle error codes.
The GxSmu driver supports two device drivers HW and VISA which are used to initialize, identify and control the board. The user can use the GxSmuInitialize to initialize the board ‘s driver using HW and GxSmuInitializeVisa to initialize using VISA. The following describes the two different methods used:
1. Marvin Test Solutions’ HW – the default device driver that is installed by the GxSmu driver. To initialize and control the board using the HW use the GxSmuInitialize(nSlot, pnHandle, pnStatus) function. The function initializes the driver for the board at the specified PXI slot number (nSlot) and returns a board handle. The PXI/PCI Explorer applet in the Windows Control Panel displays the PXI slot assignments. You can specify the nSlot parameter in the following way:
A combination of chassis number (chassis # x 256) with the chassis slot number, e.g. 0x105 for chassis 1 and slot 5. Chassis number can be set by the PXI/PCI Explorer applet.
Legacy nSlot as used by earlier versions of HW/VISA. The slot number contains no chassis number and can be changed using the PXI/PCI Explorer applet: 23 in this example.

PXI/PCI Explorer
2. VISA – this is a third-party library usually provided by National Instruments (NI-VISA). You must ensure that the VISA version installed supports PXI and PCI devices (not all VISA providers support PXI/PCI). GxSmu setup installs a VISA compatible driver for the GxSmu board in-order to be recognized by the VISA provider. Use the GxSmu function GxSmuInitializeVisa (szVisaResource, pnHandle, pnStatus) to initialize the driver board using VISA. The first argument szVisaResource is a string that is displayed by the VISA resource manager such as NI Measurement and Automation (NI_MAX). It is also displayed by Marvin Test Solutions PXI/PCI Explorer as shown in the prior figure. The VISA resource string can be specified in several ways as the following examples:
Using chassis, slot: “PXI0::CHASSIS1::SLOT5”
Using the PCI Bus/Device combination: “PXI9::13::INSTR” (bus 9, device 9).
Using alias: “COUNTER1”. Use the PXI/PCI Explorer to set the device alias.
Information about VISA is available at http://www.pxisa.org.
The GxSmuInitialize function returns a handle that is required with other driver functions to program the board. This handle is usually saved in the program in a global variable for later use when calling other functions. The initialize function does not change the state of the board or its settings.
The board handle argument, nHandle , passed (by reference) to the parameter pnHandle of the GxSmuInitialize or the GxSmuInitializeVisa functions is a short integer (16 bits) number. It is used by the GxSmu driver functions to identify the board being accessed by the application. Since the driver supports many boards at the same time, the nHandle argument is required to uniquely identify which board is being programmed.
The nHandle is created when the application calls the GxSmuInitialize function. But there is no need to destroy the handle. Calling GxSmuInitialize with the same slot number will return the same handle.
Once the board is initialized the handle can be used with other functions to program the board.
The Reset function causes the driver to change all of the board's settings to their default state. See the GxSmuReset function for more information.
All GxSmu functions pass a fail or success status - pnStatus - in the last parameter. A successful function call passes zero in the status parameter upon return. If the status is non-zero, then the function call fails. This parameter can be later used for error handling. When the status is error, the program can call the GxSmuGetErrorString function to return a string representing the error. The GxSmuGetErrorString reference contains possible error numbers and their associated error strings.
The GxSmuGetDriverSummary function can be used to return the current GxSmu driver version. It can be used to differentiate between the driver versions. See the Function Reference for more information.
Calling the GxSmuPanel will display the instrument’s front panel dialog window. The panel can be used to initialize and control the board interactively. The panel function may be used by the application to allow the user to directly interact with the board.
The GxSmuPanel function is also used by the GxSmuPanel.exe or GxSmuPANEL64.EXE panel programs that is supplied with this package and provides a stand-alone Windows application that displays the instrument panel.