Prefix_self_test

IVI Library

Prefix_self_test

ViStatus Prefix_self_test (ViSession vi, ViInt16 * testResult, ViChar testMessage[]);

Purpose

Causes the instrument to perform a self-test. Prefix_self_test waits for the instrument to complete the test. It then queries the instrument for the results of the self test and returns the results to the user.

Parameter

Input
Name Type Description
vi ViSession Unique identifier for an IVI session.
Output
Name Type Description
testResult ViInt16 Numeric result from self-test operation
0 = no error (test passed)
testMessage ViChar array Self-test status message

Return Values

Contains the status code that the function call returns. IVI engine functions can return error and warning values from several sets of status codes. Some status codes are unique to the IVI engine. Other status codes are the same codes that VISA Library functions return. Still others are error or warning values that functions in specific instrument drivers return. Each set of status codes has its own numeric range.

Regardless of the source of the status code, 0 always indicates success, a positive value indicates a warning, and a negative value indicates an error.

Related Topic

IVI Status Codes

Implementation Requirements

Report an error if the user passes VI_NULL for either of the output parameters.

Call Ivi_LockSession to lock the IVI session.

If simulation is disabled, send the self-test command to the instrument. On IEEE 488.2 instruments, you do this by sending the *TST command. Then read the results from the instrument into the testResult and testMessage output parameters.

If simulation is enabled but Ivi_UseSpecificSimulation returns VI_TRUE, set the testResult output parameter to 0, and copy "No error." into the testMessage output parameter.

Call your internal Prefix_CheckStatus function.

Finally, call Ivi_UnlockSession to unlock the IVI session.

If the instrument cannot perform a self-test operation, you should still include the function in the driver and return the warning VI_WARN_NSUP_SELF_TEST.