Click or drag to resize

PhysicalName::Index

Returns the 0-based index of the physical name.

int Index(ViSession Vi) const;
Parameters
Vi

[in] ViSession handle for the driver session.

Return Value

The 0-based index of the physical name. If the physical name is not defined for the repeated capability associated with the PhysicalName object, then this function returns -1.

Remarks

For nested repeated capabilities, this represents the index within the specific parent repeated capability instance's collection of child physical names.

Example

The following example demonstrates use of the Index 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"
    // 
    PhysicalName<Trace> trace("C2:T3");

    cout << trace.Index(Vi);  // prints "2" (not "5")
}

Download a complete CHM version of this documentation here.