Skip to content

Plcsim driver

Driver to communicate with Siemens PLCSim using S7Onlinx.dll. Compatible with PLCSim Tia Portal. Pending testing it against older PLCSim.

Parameters

Aside from the common parameters described in the communication_driver docs, this driver includes:

  • ip: IP address of the controller. Default = '192.168.0.1'
  • rack: Rack number of the CPU. Default = 0
  • slot: Slot number of the CPU. Default = 1
  • mode: PLCSim version to be used: 'S7comm' for S7-1200 or 'S7commPlus' for S7-1500. Default = S7comm

Setup data

The setup data will give values to the parameters required and will specify the I/O variables info.

{
    "parameters": {
        "ip": "192.168.0.1",
        "rack": 0,
        "slot": 1,
        "mode": "S7commPlus"
    },
    "variables": {
        "IB0": {
            "datatype": "byte", 
            "size": 1,
            "operation": "write"
        },
        "QB0": {
            "datatype": "byte", 
            "size": 1, 
            "operation": "read"
        },
        "IW0": {
            "datatype": "word", 
            "size": 1,
            "operation": "write"
        },
        "QW0": {
            "datatype": "word", 
            "size": 1, 
            "operation": "read"
        }
    }
}

Note

PLCsim driver uses the variable adress as variable name.

Note

The setup_params in the generic PLC components for S7_protocol will need the following format:

{"ip": "192.168.0.1", "rack": 0, "slot": 1, "mode": "S7comm"}

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