[in] ViSession handle for the driver session.
DriverSession::DriverSetupOptions
Retrieves a map of all name-value pairs parsed from the DriverSetup string during initialization.
Syntax
Section titled “Syntax”virtual const DriverSettingsMap<std::string>& DriverSetupOptions() const;
const DriverSettingsMap<std::string>& DriverSetupOptions(ViSession Vi);Parameters
Section titled “Parameters”Vi
Return value
Section titled “Return value”Returns a map of all name-value pairs parsed from the DriverSetup string during initialization.
Remarks
Section titled “Remarks”This function allows all name-value pairs from the DriverSetup string to be retrieved at once. To retrieve individual values, use the GetDriverSetupOption function.
The DriverSettingsMap is simply an alias for a standard std::map with case-insensitive name lookup.
Example
Section titled “Example”The following code demonstrates how to use the GetDriverSetupOption function:
///////////////////////////// Client code initializes the driver.//ViSession session;ViStatus status = acme4321_InitWithOptions("GPIB0::13", VI_FALSE, VI_FALSE, "Cache=VI_TRUE, DriverSetup= Model=ModelA, MyOption=Foo, YourOption=Bar", &session);
/////////////////////////// acme4321.cpp//// Driver implementation access the parsed DriverSetup name-value pairs.//ViStatus _VI_FUNC acme4321_ConfigureSweep(ViSession Vi, ViReal64 StartFrequency, ViReal64 StopFrequency){ auto options = DriverSetupOptions(Vi); auto it = options.find("MyOption");
if (it != std::end(options)) { printf(it->second.c_str()); // prints "Foo" }
it = options.find("YourOption");
if (it != std::end(options)) { printf(it->second.c_str()); // prints "Bar" }
// ...}