NI instrument drivers refer to sessions and channel lists rather than to sites and pins. When you take a measurement using an NI instrument driver, you must first perform a pin query to look up the associated instrument sessions and channel lists.

To conduct a pin query, you must first know the type of instrument to which the pins are connected. Each instrument type has a corresponding pin query VI or .NET method.

The following figure and code snippet shows how to use the Pin(s) To NI-DCPower Session(s) polymorphic VI or the GetNIDCPowerSessions .NET method to obtain the associated sessions and channel lists for a set of pins using an NI-DCPower instrument.

LabVIEW

.NET (C#)
public static void ExampleCodeModule(ISemiconductorModuleContext semiconductorModuleContext, string dcPowerPins)
{
   NIDCPower[] dcPowerSessions;
   string[] dcPowerChannelStrings;
   semiconductorModuleContext.GetNIDCPowerSessions(dcPowerPins, out dcPowerSessions, out dcPowerChannelStrings);
}

The Semiconductor Module context provides information to the VI about which sites the subsystem includes. The pin query returns an array of instrument sessions and channel lists. Each element with the same index in each array is associated. The pin query returns the order of the sessions and channels in a deterministic manner based on the active sites and pins.

Different instrument types might return different outputs depending on the information required to control the instrument. For example, some instruments do not have channels and thus do not return a channel list. Other instruments might return multiple session arrays.

LabVIEW Polymorphic Instances of Pin(s) to Session(s) VIs

The Pin(s) to Session(s) VIs offer a subset of the following polymorphic instances:

  • Multiple Pins - Multiple Instruments or Sessions
  • Single Pin - Multiple Instruments or Sessions
  • Multiple Pins - Single Instrument or Session
  • Single Pin - Single Instrument or Session

Depending on the instrument type, some of these options might not be available. If you operate on multiple pins, you must select the Multiple Pins options. If you operate on a single pin, select the Single Pin options. You can build the pin name into an array of strings and use the Multiple Pin options if a Single Pin option is not available for an instrument type.

You can use different instances of the same VI in multiple locations of a code module. For example, if you want to set the voltage of all pins to 0, you can use the Multiple Pins - Multiple Sessions instance to access the instrumentation. If you then want to force a current on a single pin, use the Single Pin - Multiple Sessions instance of the VI.

Note NI does not recommend deconstructing the outputs of the VI to obtain information about each site or pin. Instead, use the Get Session and Channel Index VI to obtain the sessions and channel lists.

.NET Method Overloads

The .NET API provides overloads for the pin query methods. The overloaded parameters allow you to specify a single pin or an array of pins and output a single instrument session or an array of instrument sessions. The type of the return value depends on which overload you use and provides a publish method that matches the pin query method overload. Depending on the instrument type, some method overloads might not be available.

You can use different method overloads in multiple locations of a code module. For example, if you want to set the voltage of all pins to 0, you can use the overload that takes an array of pins and outputs an array of sessions to access the instrumentation. If you then want to force a current on a single pin, use the overload that takes a single pin and outputs an array of sessions.

Note NI does not recommend deconstructing the outputs of the method to obtain information about each site or pin. Instead, use the GetSessionAndChannelIndex .NET method on the pin query context object returned from the pin query method to obtain the sessions and channel lists.

Single Sessions or Multiple Sessions

Select a Single Session VI instance or the .NET method overload that outputs a single session only under the following conditions:

  • You are using a NI-Digital Pattern pin query and all NI-Digital Pattern instruments belong to the same group in the pin map file. By default, TSM groups all NI-Digital Pattern instruments together.
  • You are using a NI-SCOPE pin query and all NI-SCOPE instruments belong to the same group in the pin map file. By default, TSM groups all NI-SCOPE instruments together.
  • You are using a NI-DCPower pin query and all NI-DCPower channels belong to the same group in the pin map file. By default, TSM groups all NI-DCPower channels together.
  • You use only a single session of a given type for the tester.
  • You know that the instruments of that type are and will always be the limiting factor when creating a subsystem.

Select a Multiple Sessions VI instance or use the .NET method overload that outputs an array of sessions if you are not sure whether to return multiple sessions or a single session. Using this technique helps you avoid having to modify code modules if a pin map changes or if you convert a test program to run on other testers or with other pin maps. Using a Single Session VI instance or the .NET method overload that outputs a single session with a set of pins and sites that returns multiple sessions results in a run-time error.