Programming Examples

Mapping pins and pin groups

Switch Easy allows users to assign names to physical pins. These names can later be used in place of the physical pin designation when calling commands that make or break connections.  Switch Easy also allows users to define pin groups, which are collections of assigned pin names.

The following is an example of assigning the name Data1, Data2, Data3, and Data4 to the physical Mac Panel pins located at Slot 3, Tier A, Row2, Column A, B, C, and D respectively:

SwitchExec Setup Pin Map("Data1", 0, aSeMpSlot3, aSeLfA_A02) ! Slot3 Tier A, Column A, Row 2

SwitchExec Setup Pin Map("Data2", 1, aSeMpSlot3, aSeLfA_B02) ! Slot3 Tier A, Column B, Row 2

SwitchExec Setup Pin Map("Data3", 2, aSeMpSlot3, aSeLfA_C02) ! Slot3 Tier A, Column C, Row 2

SwitchExec Setup Pin Map("Data4", 3, aSeMpSlot3, aSeLfA_D02) ! Slot3 Tier A, Column D, Row 2

 

Note that the second (optional) parameter is the unique numerical ID that is associated with the particular mapping.

The following is an example of creating a pin group called Data Pins that contains Data1, Data2, Data3, and Data4.

SwitchExec Setup Pin Group("Data Pins", {"Data1", "Data2", "Data3", "Data4"})

The name Data Pins can now be used in other commands to reference the group of four pins.

Making a connection

Switch Easy provides the user with the ability make connections between pins and instruments. The connection commands use a mapped name or a physical location (slot, tier, column and row) to specify a pin. The pin is referred to as a UUT pin when using a mapped name, and a Mac Panel pin when using a physical location.

Switch Easy can make the following types of connections:

Instrument to UUT pin

A predefined instrument resource is connected to a pin which has been previously mapped to a name.

The following is an example of making a connection between the instrument named Arb1 and a mapped pin named Data1:

SwitchExec Connect Instrument Pin(aSeInstrumentArb1, "Data1")

Instrument to Mac Panel pin

A predefined instrument resource is connected to a pin using its phyiscal location (slot, tier, column, and row).

The following is an example of making a connection between the instrument named Arb1 and the pin physically located in slot 3, on Tier A, Column A, Row 2:

SwitchExec Connect Instrument MpPin(aSeInstrumentArb1, aSeMpSlot3, aSeLfA_A02, , aSeRuleAllowMultiConnect)

Note that this particular example specifies a rule (allow multiple connections) when making the connection.

Multiple Instruments to UUT pin

Multiple instrument resources can be connected to the same pin concurrently. This can be accomplished when using the Allow Multiple Connections rule.

The following is an example of creating connections required for a 4-wire measurement resistance measurement:

SwitchExec Connect Instrument Pin(aSeInstrumentDmmHi, "Data2")

SwitchExec Connect Instrument Pin(aSeInstrumentDmmSenseHi, "Data2",, aSeRuleAllowMultiConnect)

SwitchExec Connect Instrument Pin(aSeInstrumentDmmLo, "Data3")

SwitchExec Connect Instrument Pin(aSeInstrumentDmmSenseLo, "Data3",, aSeRuleAllowMultiConnect)

The instrument resources DmmHi, and DmmSensesHi are both connected to the Data2 pin. The instrument resources DmmLo and DmmSenseLo are both connected to the Data2 pin.

Differential Instrument to Mac Panel pin

Instruments that use differential channels (such as a DMM) can be connected to two pins using only one command.

The following is an example of connecting the DMM's differential inputs (DmmHi and DmmLo) to the pin located at Slot 10, Tier A, ColumnA, Row 2, and Slot 10, Tier A, Column B, Row 2:

SwitchExec Connect Instrument Differential(aSeInstrumentDmm, aSeMPSlot10, aSeLfA_A02, aSeMPSlot10, aSeLfA_B02)

UUT pin to UUT pin

One pin can be connected to another pin, without having to connect to an instrument resource.

The following is an example of connecting the Data4 pin to the Data3 pin:

SwitchExec Connect Pin Pin("Data4", "Data3", , aSeRuleAllowMultiConnect)

Note that the Allow Multiple Connections rule must be specified when connecting one pin to another.

Mac Panel pin to Mac Panel pin

One pin can be connected to another pin, without having to connect to an instrument resource.

The following is an example of connecting the pin located at Slot 11, Tier A, Column A, Row 3 to the pin located at Slot 12, Tier A, Column A, Row 3:

SwitchExec Connect MpPin MpPin(aSeMPSlot11, aSeLfA_A03, aSeMpSlot12, aSeLfA_A03, aSeBus3)

Disconnecting

Switch Easy allows the user to disconnect pins from instruments, and instruments from all connections.

The following is an example of disconnecting the Data1 pin from the instrument resrouce Arb1:

SwitchExec Disconnect Instrument Pin(aSeInstrumentArb1, "Data1")

The following is an example of disconnecting the Arb1 instrument resource from all pins:

SwitchExec Disconnect Instrument(aSeInstrumentArb1)

All connections can be removed while still maintaining the current pin mapping by using the following command:

SwitchExec Reset All()