Programming Examples

Defining a Domain

The GX6188 has an eight-signal global bus that can be used to connect multiple cards together, adding more switching points and/or resources. In this example, connecting three GX6188 boards  creates a 312x8x24 switching system configuration.

The following example creates a switching domain of 312x8x24:

! Card 0: Chassis 1, Slot 6, Channels 1-104, Resources 1-8

lCardNumber = SwitchExec Setup Card Map (0x106)

! Card 1: Chassis 1, Slot 7, Channels 105-208, Resources 9-16

lCardNumber = SwitchExec Setup Card Map (0x107)

! Card 2: Chassis 1, Slot 8, Channels 209-213, Resources 17-24

lCardNumber = SwitchExec Setup Card Map (0x108)

The Connect and Disconnect commands of the SwitchEasy driver are designed to use either the index number of a channel within the domain or to use the logical name that was assigned when mapping UUT channels or resources.

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 pins located cards 0 and 1 at channels 1 and 2, respectively:

SwitchExec Setup Pin Map ("Data1", 1)   ! Card 0, Channel 1

SwitchExec Setup Pin Map ("Data2", 2)   ! Card 0, Channel 2

SwitchExec Setup Pin Map ("Data3", 105) ! Card 1, Channel 1

SwitchExec Setup Pin Map ("Data4", 106) ! Card 1, Channel 2

 

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 (channel index number) to specify a pin. The pin is referred to as a UUT pin when using a mapped name, and a channel when using a physical location.

Switch Easy can make the following types of connections:

Resource to UUT Pin

A predefined 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 Resource Channel ("Arb1", "Data1")

Resource to UUT Channel

A predefined instrument resource is connected to a pin using its physical location (channel number).

The following is an example of making a connection between the instrument named Arb1 and the pin physically located on card 2, channel 10:

SwitchExec Connect Resource Channel ("Arb1", 218, , aSeRuleAllowMultiConnect)

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

Multiple Resources to a UUT pin

Multiple 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 Resource Channel ("DmmHi", "Data2")

SwitchExec Connect Resource Channel ("DmmSenseHi", "Data2", , aSeRuleAllowMultiConnect)

SwitchExec Connect Resource Channel ("DmmLo", "Data3")

SwitchExec Connect Resource Channel ("DmmSenseLo", "Data3", , aSeRuleAllowMultiConnect)

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

UUT pin to UUT pin

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

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

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

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

UUT Channel to UUT Channel

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

The following is an example of connecting the pin located at Card 0, Channel 1 to the pin located at Card 1, Channel 104:

SwitchExec Connect Channel Channel (1, 208, aSeBus3)

Note that in this example, the connections is made on Bus 3, if possible.

Disconnecting

Switch Easy allows the user to disconnect channels from resources, and resources from all connections.

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

SwitchExec Disconnect Resource Channel ("Arb1", "Data1")

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

SwitchExec Disconnect Resource("Arb1")

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

SwitchExec Reset All ()