GxSWGetErrorString

Purpose

Returns the error string associated with the specified error number.

Syntax

GxSWGetErrorString (nError, pszMsg, nErrorMaxLen, pnStatus)

Parameters

Name
Type
 Comments
nError
SHORT
Error number as returned by the pnStatus of any of the driver functions. See table below for possible values. The error number should be a negative number, otherwise the function returns the "No error has occurred" string.
pszMsg
LPSTR
Buffer to contain the returned error string (null terminated string).
nErrorMaxLen
SHORT
Size of the buffer pszMsg.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function returns the error string associated with the nError as returned from other driver functions. This function also returns error values, or 0 on success.

The following table displays the possible error values; not all errors apply to this board type:

Resource Errors

-1
Board does not exist in this slot
-2
Unable to open the HW device/Service
-3
Different board exist in the specified PCI slot
-4
PCI slot not configured properly. You may configure it by using the PXI/PCIExplorer from the Control Panel
-5
Unable to register the PCI device
-6
Unable to allocate system resource or memory for the PCI device
-7
Too many boards
-8
Unable to create panel
-9
Unable to create a Windows timer

 

Parameter Errors

-20
Invalid parameter
-21
Invalid PCI slot number
-22
Invalid board handle
-23
Invalid channel number
-24
Invalid bus number
-25
Invalid mode
-26
Invalid group number
-27
Invalid string length
-28
Invalid row number  
-29
Invalid column number

 

Board Errors/Warnings

-50
BIT error: Adapter not connected
-51
BIT error: Comparator Error
-52
BIT error: Unable to open/close a relay in Group x, Row y Column z
-53
VI in Error  
-54
Memory mapping error  

 

Miscellaneous Errors

-99

Invalid or unknown error number

 

Example

The following example initializes the board at slot 3. If the initialization failed the following error string is printed:

 

CHAR    sz[256];

SHORT   nStatus, nHandle;

 

GX6196Initialize(3, &Handle, &Status);

if (nStatus<0)

{   GxSWGetErrorString(nStatus, sz, sizeof sz, &nStatus);

    printf(sz);        // print the error string return;