beautypg.com

Geterror, Geterrorlist – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 342

background image

III. COMMAND REFERENCES - 15. Command References

15B. Driver488/SUB, W31, W95, & WNT

Personal488 User’s Manual, Rev. 3.0

III-327

GetError

SYNTAX

ErrorCodeT pascal

GetError(DevHandleT devHandle, char *errText);

devHandle

refers to either the IEEE 488 interface or the external device that has

the associated error.

errText

is the string that will contain the error message. If

errText

is non-null,

the string must contain at least 247 bytes.

RETURNS

-1 if error,

otherwise, it returns the error code number associated with

the error for the specified device.

MODE

Any

BUS STATES

None

SEE ALSO

Error, GetErrorList, Status

EXAMPLE

errnum = GetError(ieee,errText);

printf(“Error number:%d;%s \n”errnum,errText);

The

GetError

command is called by the user after another function returns an error indication. The

device handle sent to the function that returned the error indication, is sent to

GetError

as its

devHandle

parameter.

GetError

finds the error associated with that device, and returns the error

code associated with that error. If a non-null error text pointer is passed,

GetError

also fills in up to

247 bytes in the string. The application must ensure that sufficient space is available.

GetErrorList

SYNTAX

ErrorCodeT pascal GetErrorList(DevHandlePT devHandles, char

*errText, DevHandlePT errHandle);

devHandles

is a pointer to a list of external devices that was returned from a

function, due to an error associated with one of the external devices in the list.

errText

is the text string that contains the error message. The user must ensure

that the string length is at least 247 bytes.

errHandle

is a pointer to the device handle that caused the error.

RETURNS

-1 if error

otherwise, it returns the error number associated with the

given list of devices.

MODE

Any

BUS STATES

None

SEE ALSO

Error, GetError, Status

EXAMPLE

char errText[329];
int errHandle;
int errnum;
result = ClearList(list);
if (result == -1) {
errnum=GetErrorList(list,errText,&errHandle);
printf(“Error %d;%s,at handle %d\n”, errnum, errText,
errHandle);
}

The

GetErrorList

command is called by the user, after another function identifying a list of device

handles, returns an error indication. The device handle list sent to the function that returned the error
indication, is sent to

GetErrorList

.

GetErrorList

finds the device which returned the error

indication, returning the handle through

errHandle

, and returns the error code associated with that

error. If a non-null error text pointer is passed,

GetError

also fills in up to 247 bytes in the string.

The application must ensure that sufficient space is available.