Click or drag to resize

ParameterStyleRepCap::GetPhysicalNameAtIndex

Returns full physical name at the specified 1-based index.

static ViStatus GetPhysicalNameAtIndex(ViSession Vi, ViInt32 nIndex, ViInt32 nNameBufferSize, ViChar szName[]);

static ViStatus GetPhysicalNameAtIndex(ViSession Vi, ViConstString parentPhysicalName, ViInt32 nIndex, ViInt32 nNameBufferSize, ViChar szName[]);
Parameters
Vi

[in] ViSession handle for the driver session.

parentPhysicalName

[in] The full physical name of the parent repeated capability. This parameter is only available in the overload for nested repeated capabilities.

nIndex

[in] The 0-based index of the physical name to return. For nested repeated capabilities, this represents the index within the specific parent repeated capability instance's collection of child physical names.

nNameBufferSize

[in] The number of characters allocated in the szName parameter.

szName

[out] The full physical name located at the specified index within the driver's internal list of physical names for this repeated capability.

Return Value

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

Remarks

Only one of the above overloads will be available for a particular repeated capability. The first overload (without the parentPhysicalName parameter) will be available for non-nested repeated capabilities, while the second overload must be used for nested repeated capabilities.

Example

The following example demonstrates use of the GetPhysicalNameAtIndex function.

C++
ViStatus _VI_FUNC acme4321_ConfigureArmCount(ViSession Vi, ViConstString RepCapIdentifier, ViInt32 ArmCount)
{
    // The Trace repeated capability is a child repeated capability of some other repeated capability
    // that defines a "C1" physical name.  The "trace" variable below represents the "T1" Trace instance
    // within the C1 instance of the parent repeated capability.
    // 
    // Assume the following repeated capability physical names are defined in the following order for the Trace repeated capability:
    // 
    //     "C1:T1"
    //     "C1:T2"
    //     "C1:T3"
    //     "C2:T1"
    //     "C2:T2"
    //     "C2:T3"  <-- this is the one we're after
    //     "C3:T1"
    //     "C3:T2"
    //     "C3:T3"
    // 

    // Note that we ask for the physical name at index 2 and not 5
    // 
    char szName[256];
    auto status = Trace::GetPhysicalNameAtIndex(Vi, "C2", 2, _countof(szName), sz);  
    ReturnOnError(status);

    cout << szName;   // prints "C2:T3"
}

Download a complete CHM version of this documentation here.