Testing the PLC Connection
This page is relevant for ✅Studio ✅Player
In your documents, you will find the folder PLC-Lab-3D-Studio. Inside it, there is a folder named plc-test, which contains a 3D simulation specifically created for testing a connection with a PLC:
A cylinder pushes a cube onto a slide.
Video
This example uses only a few inputs and outputs, making it ideal for testing a basic PLC connection.
Variables
The necessary variable list for the control program can be exported using this function so that it does not have to be created manually:

Numbers in the image:
- Select the desired device.
- Click the settings button.
- The connection settings for the device are displayed.
- Use this button to export the variables in different formats. Windows Explorer will open automatically and display the generated files.
For tag-based controllers, the address of the symbol does not have to match the table above. This is the case with these devices: AllenBradleyPlc, OpcUa, MQTT, CSharpScript.
PLC Program
Below is the PLC program written in Siemens S7 SCL code:
"ToMax" := "S1";
"P1" := "ToMax";
"SliderValueOutput" := "SliderValueInput";Without quotation marks, e.g. for Allen Bradley controls:
ToMax := S1;
P1 := ToMax;
SliderValueOutput := SliderValueInput;If you prefer to write the program in another language or representation, you’ll need to adapt it accordingly.
Procedure

- Open the plc-test project.
- Select the device that corresponds to your PLC in the device list. See figure (1).
- Export the variable list as described above.
- Click on the device settings button and configure the connection parameters. See picture (2) and (3).
- Create a PLC project in your development environment (e.g. TIA Portal).
- Import the variable list as a file or via copy&paste.
- Implement the PLC program (see SCL code above).
- Transfer the program to the PLC and switch the PLC to the RUN state.
- Switch PLC-Lab 3D Studio to Run mode.
- If the connection has been successfully established, you can create a cube with S2.
Verification
Make sure the following actions work correctly:
- Does the cylinder extend when S1 is pressed?
- Does P1 light up when S1 is activated?
- Is the value in SliderValueOutput the same as in SliderValueInput?
If you can answer Yes to all of the above, the connection is working correctly.