Modbus

Installation Instructions

The Modbus com interface need the libmodbus library to work. Follow the steps below to set up your environment before compiling FORTE.

  1. libmodbus files should be placed in the following folder structure:
  2. When configuring FORTE project with CMake choose as FORTE_COM_MODBUS_LIB_DIR
  3. forte.exe must be able to find the dynamic libmodbus library after build. therefore copy libmodbus.dll/so to folder with forte.exe or add libmodbus.dll/so to library include path

Parameters

Modbus Client (TCP)

Usage of the Modbus Client (TCP):

modbus[(protocol:)ip:port:pollFreqency:functionCode:(slaveId):readAddresses:sendAddresses(:responseTimeout:byteTimeout)]

Example:

modbus[127.0.0.1:502:2000:3:1:0..3]

Modbus Client (RTU)

Usage of the Modbus Client (RTU):

modbus[protocol:device:baudRate:parity:dataBit:stopBit:pollFreqency:functionCode:(slaveId):readAddresses:sendAddresses(:responseTimeout:byteTimeout)]

Parameter meaning:

Example:

modbus[rtu:/dev/ttyS0:19200:E:8:1:2000:3:247:6142,6132,6137:64025..64025,63995..63995]