Skip to content

The Driver Info Object

The Nimbus Template Library supplies a special object called the Driver Info object for controlling the standard Nimbus implementation of various IVI-defined functions. Previous versions of Nimbus relied upon virtual functions that the driver developer needed to override separately to customize the NTL default behavior. The Driver Info object simplifies this customization.

The Driver Info object is an instance of the CDriverInfo class defined in NtlDriver.h. A single instance of this class is created and managed by Nimbus. The table below explains each of the members and the role they play in controlling the Nimbus implementation of various functions. It is important to note that some of these members are controlled via various settings in the Driver Settings Editor, while other members can be directly set in the OnFinalConstruct or the OnFinalInitialize methods.

MemberData TypeHow to SetDefaultDescription
m_strSoftwareModuleNameCStringManual OR , if IVI-C is enabledName of the software module in the [IVI Configuration Store](/ivibackgrounders/ivi-shared-components/). This value should not be changed directly. Rather the project should be renamed or the IVI-C prefix should be modified.
m_strDriverIdentifierCStringManualUsed to implement the IIviDriver::Identity property.
m_strDriverVendorCStringDriver SettingsSpecified in wizardUsed to implement the IIviComponentIdentity::Vendor property.
m_strDriverDescriptionCStringDriver SettingsSpecified in wizardUsed to implement the IIviComponentIdentity::Description property.
m_strDriverRevisionCStringDriver Settings1.0Used to implement the IIviComponentIdentity::Revision property.
m_strGroupCapabilitiesCStringDriver SettingsAll groups in selected classesUsed to implement the IIviDriverIdentity::GroupCapabilities property.
m_strSupportedModelsCStringDriver SettingsUsed to implement the IIviDriverIdentity::SupportedInstrumentModels property.
m_strDefaultSimulatedModelCStringDriver SettingsFirst supported modelUsed to determine which model is assumed when simulating and no Model option is passed to Initialize.
m_lSpecificationMajorVersionlongDriver SettingsMajor version of class specUsed to implement the IIviDriverIdentity::SpecificationMajorVersion property.
m_lSpecificationMinorVersionlongDriver SettingsMinor version of class specUsed to implement the IIviDriverIdentity::SpecificationMinorVersion property.
m_bInterchangeCheckSupportedboolManualfalseIndicates if the driver supports [interchangeability checking](/ivibackgrounders/what-all-ivi-drivers-do-inherent-capabilities/#interchangeability-checking-optional). A runtime error will be generated in Initialize if the user tries to enable interchangeability checking and this member is set to false.
m_bResetSupportedboolManualtrueIndicates if the driver supports the Reset function. A runtime error will be generated in Initialize if the user tries to reset the device and this member is set to false.
m_bSelfTestSupportedboolManualtrueIndicates if the driver supports the IIviDriverUtility::SelfTest function.
m_bRevisionQuerySupportedboolManualtrueIndicates if the driver supports querying for the driver version number.
m_bIdQuerySupportedboolManualtrueIndicates if the driver supports querying the instrument for its identification information.
m_lSelfTestTimeoutlongManual2000Specifies the I/O timeout value (in milliseconds) to use when executing the IIviDriverUtility::SelfTest function.
m_lDisableTimeoutlongManual2000Specifies the I/O timeout value (in milliseconds) to use when executing the IIviDriverUtility::Disable function.
m_lResetTimeoutlongManual2000Specifies the I/O timeout value (in milliseconds) to use when executing the IIviDriverUtility::Disable function.
m_lCoercionLogSizelongManual1000Specifies the size of the internal buffer used to store coercion log entries. The size is indicated in terms of the number of entries. Once the coercion log is full, entries are overwritten starting with the oldest.

The Driver Info object is accessed via the GetDriverInfo function. Typically settings that need to be overridden are set in the OnFinalConstruct function. This function executes only once over the lifetime of the driver (NOT once per Initialize call) and since the settings available on the Driver Info object typically do not depend upon the specific instrument connection (for instance, the specific model connected), the OnFinalConstruct function is the typical choice for customizing the Driver Info object settings.

If the desired Driver Info object settings depend upon some aspect of the specific instrument connected (such as the specific model), then the OnFinalInitialize function can be used to customize the Driver Info object settings. This function executes at the last stage of driver initialization so all of the model identification information is available.

The example code below demonstrates changing the timeout values used for the Reset and Disable functions.

CoAcme4321.cpp
HRESULT Acme4321::OnFinalConstruct()
{
HRESULT hr = S_OK;
GetDriverInfo().m_lSelfTestTimeout = 5000;
GetDriverInfo().m_lDisableTimeout = 5000;
return hr;
}