Skip to content

ValidateSession Macro

Tests the specified session to ensure it represents a valid handle to an existing driver session created via the driver’s init or InitWithOptions function.

#define ValidateSession(Vi)

Vi

[in] ViSession variable to test.

The macro returns from the current function with a ViStatus value of IVIC_ERROR_INVALID_SESSION_HANDLE if the supplied ViSession parameter is not valid.

The following example demonstrates use of the ValidateSession macro.

ViStatus _VI_FUNC acme4321_ConfigureSweep(ViSession Vi, ViReal64 StartFrequency, ViReal64 StopFrequency)
{
ValidateSession(Vi);
// ...
}