Connecting to PLCsim

Connect to PLCsim

This chapter shows PLCsim instance can be used to execute the code and connect to the digital twin in Simumatik. After doing the configurations in TIA Portal as described in previous chapter, it is now time to start PLCSIM, click on the Start simulation button.

A “Download to device” box will appear. Click Start search first, and then Load.

Press RUN on the PLCsim instance.

Settings in Simumatik

Load a system to the Simumatik Workspace, or create a new system, that contains a PLC component, either one of the generic types (such as PLC 8DIO, PLC 16DIO 4AIO, and PLC Rack Logic Module Generic) or one that is predefined for Siemens (such as s1200 controller).

Click on the PLC component in Simumatik, select plcsim as driver_type in the variables pane, and make sure that the setup_params includes the correct IP address, rack and slot for the PLC.

Rack and slot

Select according to PLC type:

  • S7-300: Rack 0, slot 2
  • S7-400: Rack 0, slot 2 or from HWConfig
  • S7-1200/S71500: Rack 0, slot 1


Select according to PLC type:

  • S7-1200 – mode: “S7comm”
  • S7-1500 – mode: “S7commPlus”

Set the variable names to match the tag defined in the PLC. The plcsim driver uses the tag address as variable name. For instance to access input byte 3 the variable name needs to be IB3. Currently supported data types is as follows.

Now the emulation can be started. Make sure the gateway is connected. Then click the Play button on the toolbar to start the emulation.