![]() | SelectorStyleRepCap::ExpandSingleActiveSelector |
Translates the active repeated capability selector into a single physical name.
static ViStatus ExpandSingleActiveSelector(ViSession Vi, PhysicalName<T>& physicalName);
[in] ViSession handle for the driver session.
[out] A PhysicalName object containing the physical name corresponding to the currently active selector for the repeated capability.
Returns a VI_SUCCESS if the operation was successful or a failure ViStatus otherwise. If the currently active selector represents more than one physical name, the the error code IVIC_ERROR_BADLY_FORMED_SELECTOR is returned.
If the currently active selector represents a virtual name, this function translates that virtual name to the corresponding physical name.
This function is useful in scenarios where an operation is only valid for a single repeated capability physical name. For example, attribute getters and functions that have output parameters can only return a single value, so the user can never invoke such operations on more than one repeated capability at a time. Thus, such operations must internally validate that only a single physical name is active when they are called. The ExpandSingleActiveSelector function is provided for this purpose.
The following example demonstrates use of the ExpandSingleActiveSelector function.
ViStatus _VI_FUNC acme4321_ConfigureMeasurement(ViSession Vi, ViReal64 Frequency, ViReal64 Bandwidth) { // ... PhysicalName<Channel> channel; auto status = Channel::ExpandSingleActiveSelector(Vi, channel); ReturnOnError(status); // ... }