Click or drag to resize

SelectorStyleRepCap::ExpandActiveSelector

Expands the currently active selector into a list of PhysicalName objects.

static ViStatus ExpandActiveSelector(ViSession Vi, PhysicalNameList<T>& physicalNames);
Parameters
Vi

[in] ViSession handle for the driver session.

physicalNames

[out] The PhysicalNameList containing the physical names resulting from the expansion of the active selector set by the most recent call to the SetActiveSelector function.

Return Value

Returns a VI_SUCCESS if the operation was successful or a failure ViStatus otherwise.

Remarks

This function is equivalent to calling GetActiveSelector and passing that result to ExpandSelector. Further information on those operations can be found in their respective help topics.

Important note Important

Unlike the SetActiveSelector function, this function does not store the physical names resulting from the expansion in the driver's internally maintained list of active physical names. The active physical name list is unaffected by calling this function. Thus, the ExpandActiveSelector function can safely be used to interrogate the currently active list of physical names without affecting the state of the driver.

Example

The following example demonstrates use of the ExpandActiveSelector function.

C++
ViStatus _VI_FUNC acme4321_ConfigureMeasurement(ViSession Vi, ViReal64 Frequency, ViReal64 Bandwidth)
{
    // ...

    // Assume a Channel repeated capability is defined and the active selector is "CH1-CH4"
    // 
    PhysicalNameList<Channel> channels;
    auto status = Channel::ExpandActiveSelector(Vi, channels);
    ReturnOnError(status);

    for (const auto& channel : channels)
    {
        cout << channel.FullName();
    }

    // The above loop prints the following:
    // 
    //    CH1
    //    CH2
    //    CH3
    //    CH4

    // ...
}

Download a complete CHM version of this documentation here.