Click or drag to resize

CheckForUnsupportedModel Macro

Checks to see if the driver is executing against any of the models specified and returns from the current function with an appropriate ViStatus error code if an unsupported model is detected.

#define CheckForUnsupportedModel(Vi, unsupportedModels)
Parameters
Vi

[in] ViSession handle for the driver session.

unsupportedModels

[in] A comma-separated list of model names that are not supported by the current function.

Remarks

If the InstrumentModel function indicates that the driver is connected to any of the models specified by the list in the unsupportedModels parameter, then this macro will return from the current function with either an IVIC_ERROR_FUNCTION_NOT_SUPPORTED or IVIC_ERROR_ATTRIBUTE_NOT_SUPPORTED error code. It will also compose an error message of the form: "Function is not supported for instrument model 'ModelA'". and associate the error code and error message with the driver session so that the caller can use the GetError function to retrieve both.

Example

The following example demonstrates use of the CheckForUnsupportedModel macro.

C++
ViStatus _VI_FUNC acme4321_ConfigureSweep(ViSession Vi, ViReal64 StartFrequency, ViReal64 StopFrequency)
{
    CheckForUnsupportedModel(Vi, "ModelA, ModelC");

    // ...
}

Download a complete CHM version of this documentation here.