Click or drag to resize

DriverSession::GetConfigSetting

Retrieves the value of a configurable initial setting associated with either the driver session or the software module in the IVI Configuration Store.

virtual bool GetConfigSettingBoolean(const std::string& strName, bool& bValue) const;
virtual bool GetConfigSettingInt32(const std::string& strName, int& nValue) const;
virtual bool GetConfigSettingReal64(const std::string& strName, double& dValue) const;
virtual bool GetConfigSettingString(const std::string& strName, std::string& strValue) const;

bool GetConfigSettingBoolean(ViSession Vi, const std::string& strName, bool& bValue);
bool GetConfigSettingInt32(ViSession Vi, const std::string& strName, int& nValue);
bool GetConfigSettingReal64(ViSession Vi, const std::string& strName, double& dValue);
bool GetConfigSettingString(ViSession Vi, const std::string& strName, std::string& strValue);
Parameters
Vi

[in] ViSession handle for the driver session.

strName

[in] Name of the configurable initial setting to return. This name is case insensitive.

bValue, nValue, dValue, strValue

[out] Strongly typed value of the setting corresponding to the strName parameter. If the named value is not found, this parameter value is undefined.

Return Value

Returns true if the named value was loaded from the IVI Configuration Store and false otherwise.

Remarks

The IVI Configuration Store supports arbitrary name-value pairs that can be associated with either a driver session or a software module. These name-value pairs are called configurable initial settings and can be set by the driver installer or they may be added or modified by an end user. The IVI specifications do not prescribe any particular use for configurable initial settings. They are intended as a means to store driver-defined data in a standard location that other drivers, tools, and application can readily access.

Nimbus automatically loads any configurable initial settings associated with the driver's IVI Configuration Store session or software module. Four different functions are provided to access the settings loaded during driver initialization -- one function for each of the four data types supported by the IVI Configuration Store.

These functions are used to retrieve the settings individually. See the ConfigSettings functions to retrieve all loading settings at once.

Example

The following code demonstrates use of the GetConfigSettingInt32 function:

C++
ViStatus _VI_FUNC acme4321_ConfigureSweep(ViSession Vi, ViReal64 StartFrequency, ViReal64 StopFrequency)
{
    std::string strMySetting;
    auto bFound = GetConfigSettingInt32(Vi, "MySetting", strMySetting);
    assert(bFound);

    printf(strMySetting.c_str());

    // ...
}

Download a complete CHM version of this documentation here.