Skip to content

SelectorStyleRepCap::ExpandActiveSelector

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

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

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.

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

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.

The following example demonstrates use of the ExpandActiveSelector function.

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
// ...
}