Click or drag to resize

SelectorStyleRepCap::ExpandSingleActiveSelector

Translates the active repeated capability selector into a single physical name.

static ViStatus ExpandSingleActiveSelector(ViSession Vi, PhysicalName<T>& physicalName);
Parameters
Vi

[in] ViSession handle for the driver session.

physicalName

[out] A PhysicalName object containing the physical name corresponding to the currently active selector for the repeated capability.

Return Value

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.

Remarks

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.

Example

The following example demonstrates use of the ExpandSingleActiveSelector function.

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

    PhysicalName<Channel> channel;
    auto status = Channel::ExpandSingleActiveSelector(Vi, channel);
    ReturnOnError(status);

    // ...
}

Download a complete CHM version of this documentation here.