collapse_all When to use the instrument specific interfaces

Top  Previous  Next

 

Boonton55xxx IVI Driver Reference


 

Accessing Instrument-Specific Functionality





As the name implies, the instrument-specific capabilities are those methods and properties that are unique to the instrument. In practice, the instrument-specific portion of the driver exposes the full functionality of the instrument -- including functionality that may also be available in the class-compliant capabilities. Users that do not care about interchangeability or that need to access functionality that is not defined by IVI will use the instrument-specific interfaces in application programs.

When the required functionality is not exposed in the class-compliant interfaces.

When interchangeability is not a requirement.

When performance is critical. Sometimes a driver may perform better using the instrument specific interfaces because they match the instrument functionality more closely than the class-compliant interfaces.

Example

The following example demonstrates accessing instrument-specific function on the driver. Note that instrument-specific function calls are always prefixed with the instrument-specific prefix ("Btn55xxx"). In contrast, calls to IVI-defined class-compliant functions are prefixed with the IVI class name.

C++

Copy imageCopy Code

#include "Boonton55xxx.h"
void main()
{
  ViStatus status;
  ViSession session;
  ViReal64 reading;
  status = Btn55xxx_InitWithOptions("MyLogicalName", VI_TRUE, VI_TRUE, "", &session);
  status = Btn55xxx_ReadEx(session, 2000, 3, &reading);
  status = Btn55xxx_close(session);
}

collapse_all Using both the class driver and specific driver

When programming against the class driver, it is possible to get access to the specific driver session that is used internally by the class driver. This allows the client program to talk directly to the specific driver.

Example

The following client code uses the class driver and the specific driver.

C++

Copy imageCopy Code

#include "Boonton55xxx.h"
#include "IviDmm.h"
void main()
{
  ViStatus status;
  ViSession classSession;
  ViSession specificSession;
  ViReal64 reading;
  status = IviDmm_InitWithOptions("MyLogicalName", VI_TRUE, VI_TRUE, "", &classSession);
  status = IviDmm_Read(classSession, 2000, &reading);
  // Get access to the specific driver session
  status = IviDmm_GetSpecificDriverCHandle(classSession, &specificSession);
  // Call the specific driver
  // ReadEx takes an additional parameter
  // This is available only from the specific driver
  status = Btn55xxx_ReadEx(specificSession, 2000, 3, &reading);
  status = IviDmm_close(classSession);
}

Footer image

Copyright 2013-16 Boonton. All rights reserved.