SoftPLC
 
Font size:      

Overview

Introduction

This document describes the installation, usage, and functionality of a TLM (TOPDOC Loadable Module) for SoftPLC version 3.x and later. This TLM implements the slave side of the Modbus Master/Slave Protocol using a serial line. See here and here for definitions of this protocol.

The TLM described by this document is called MODBSLAV. The Modbus Slave TLM is used to add Modbus slave capabilities to a SoftPLC runtime and to allow it to participate in master-slave communications between intelligent devices on a serial RS-232, RS-485, or RS-422 communications link.

SoftPLC offers other TLMs in support of Modbus TCP/UDP, as well as Modbus RTU/ASCII Master. This TLM only implements the serial line form of the protocol and only the slave side of it.


Four types of Modbus TLMs
Media TypeMasterSlave
Serial LineMODBMAST*this TLM*
TCP and UDPModbusIPmasterModbusIPslave

TLMs may be developed by any competent C/C++ programmer who has access to the SoftPLC C/C++ Programmer's Toolkit, a product readily available from SoftPLC Corporation. There are a number of Systems Integrators who are SoftPLC Partners who possess the requisite expertise. End users may also have this capability.

Features

The Modbus Slave TLM operates as a SoftPLC driver and may be configured with TOPDOC NexGen. Modbus RTU and ASCII protocols are supported in SoftPLC version 4.6.160608 and later. For earlier versions only Modbus RTU protocol is supported.

Modbus protocol was originally developed to talk to Modicon PLCs, and therefore devices that implement the slave side of the protocol must recognize references to Modicon memory locations. This TLM maps SoftPLC datatable files into virtual Modicon PLC memory locations. This mapping is controlled in the configuration file of the TLM.

Up to 8 serial ports are supported. Possible baud rates are 2400, 4800, 9600, 19200, 38400 or 115200. Hardware handshaking is not supported, and this may make it difficult for slaves of this type to participate in a multi-drop bus without special RS-232 to RS-485 converters which would do the hardware handshaking. Hardware handshaking is not required for a single slave bus.

The TLM supports the following Modbus Functions:

Function NumberDescription
0x01Read Coils
0x02Read Input Discretes
0x03Read Multiple Registers
0x04Read Input Registers
0x05Write Single Output
0x06Write Single Register
0x07Read Exception Status
0x08Diagnostics
0x0FForce Multiple Coils
0x10Write Multiple Registers
0x16Mask Write Registers

Requirements

  • Version 3.x SoftPLC and TOPDOC NexGen version 1.3 or later.
  • For Modbus ASCII, version 4.6.160608 SoftPLC and TOPDOC NexGen version 1.6.160608 or later.