OpenPLC Connectivity

ProtoTwin Connect supports the Modbus TCP protocol for connection to OpenPLC Runtime V4.0.5 or later.

Server Configuration

Click the Add Server button in the Servers tab of the IO Browser and configure the server as follows:

  • Protocol: Select Modbus/TCP from the list.
  • Type: Select OpenPLC from the list.
  • Name: Enter a (preferably) unique name, which will be used to identify the server.
  • Host: Enter the static IP address of the PLC.
  • Port: Enter the port number for the Modbus TCP server.
  • Unit ID: Enter the unit/slave ID for the Modbus TCP server (typically 1).
  • Scan Rate: Enter the desired scan rate, which is the interval (in seconds) at which ProtoTwin Connect will read and write tag values.

Note that the scan rate is the desired interval at which tags are read and written. The actual rate will depend on the performance of the PLC and networking latency. You can set the scan rate to zero in order to read/write as fast as possible.

Save the configuration to add the server.

Addressing

OpenPLC segments the memory areas, so that the holding register areas %QW, %MW, %MD and %ML do not overlap. This makes addressing simple. Just use the exact same address that you specified in the OpenPLC Editor. For example:

Sensor : BOOL AT %QX0.0; // Enter %QX0.0 for the address in ProtoTwin
Actuator : BOOL AT %IX0.0; // Enter %IX0.0 for the address in ProtoTwin
MotorTargetSpeed : REAL AT %MD0; // Enter %MD0 for the address in ProtoTwin
MotorCurrentSpeed : REAL AT %MD1; // Enter %MD1 for the address in ProtoTwin