MHJ-SoftwareMHJ WikiOnline manuals PLC-Lab 3D Studio v1

Testing the PLC Connection

2 min readUpdated 2026-06-01

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:

Export variable list
Export variable list

Numbers in the image:

  1. Select the desired device.
  2. Click the settings button.
  3. The connection settings for the device are displayed.
  4. Use this button to export the variables in different formats. Windows Explorer will open automatically and display the generated files.
Note

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:

SCL
"ToMax" := "S1";
"P1" := "ToMax";
"SliderValueOutput" := "SliderValueInput";

Without quotation marks, e.g. for Allen Bradley controls:

SCL
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

Selection of the device
Selection of the device
  1. Open the plc-test project.
  2. Select the device that corresponds to your PLC in the device list. See figure (1).
  3. Export the variable list as described above.
  4. Click on the device settings button and configure the connection parameters. See picture (2) and (3).
  5. Create a PLC project in your development environment (e.g. TIA Portal).
  6. Import the variable list as a file or via copy&paste.
  7. Implement the PLC program (see SCL code above).
  8. Transfer the program to the PLC and switch the PLC to the RUN state.
  9. Switch PLC-Lab 3D Studio to Run mode.
  10. If the connection has been successfully established, you can create a cube with S2.

Verification

Make sure the following actions work correctly:

  1. Does the cylinder extend when S1 is pressed?
  2. Does P1 light up when S1 is activated?
  3. 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.