# TestStand Integration

URL: https://irs.systems/en/docs/switching-platform/teststand-integration

## Initialize a Switching Platform

To initialize a Switching Platform, use the dotNET Adapter and insert an action step:

- Navigate to the “`SwitchingPlatform.dll`” (installation folder)
- Choose the Root Class “`IRS.SwitchingPlatform.SwitchingPlatform`”
- Choose the .NET Invocation “`SwitchingPlatform()`” (Constructor for Switching Platform Object)
- Save the Object Reference in a Variable

![TestStand step settings for Create Switching Platform with the .NET invocation SwitchingPlatform()](/docs/assets/switching-platform/images/sp-teststand-init.png)

## Connect to SP-Mainframe / Rack

- Use the dotNET Adapter, insert an action step and navigate to the “`SwitchingPlatform.dll`”
- Choose the Root Class “`IRS.SwitchingPlatform.SwitchingPlatform`” and the .NET Invocation “`Use Existing Object(IRS.SwitchingPlatform.SwitchingPlatform).Connect(System.String, Int32)`”
- Refer to the Variable with the Switching Platform Object Reference
- Type in the path to your Project File (use “`\\`” for path masking “`C:\\TS\\Project`”)
- Type in Connection Timeout (recommended: “use default”)

![TestStand step settings for Open Connection with the parameters projectFile and timeout](/docs/assets/switching-platform/images/sp-teststand-connect.png)

## Disconnect SP-Mainframe / Rack

- Use the dotNET Adapter, insert an action step and navigate to the “`SwitchingPlatform.dll`”
- Choose the Root Class “`IRS.SwitchingPlatform.SwitchingPlatform`” and the .NET Invocation “`Use Existing Object(IRS.SwitchingPlatform.SwitchingPlatform).Disconnect()`”
- Refer to the Variable with the Switching Platform Object Reference

![TestStand step settings for Close Connection with the .NET invocation Disconnect()](/docs/assets/switching-platform/images/sp-teststand-disconnect.png)

## Switch Relay via Request

- Use the dotNET Adapter, insert an action step and navigate to the “`SwitchingPlatform.dll`”
- Choose the Root Class “`IRS.SwitchingPlatform.SwitchingPlatform`” and the .NET Invocation “`Use Existing Object(IRS.SwitchingPlatform.SwitchingPlatform).Request(System.String, System.String, System.String)`”
- Refer to the Variable with the Switching Platform Object Reference
- Type in the Path to the chosen relay “`/192.168.111.0-0/2/Relay/KL30`”, the command “`Switch`” or “`Read`” and the parameters

![TestStand step settings for Request with the parameters path, command and parameters](/docs/assets/switching-platform/images/sp-teststand-request.png)
