TRB145 - Modbus Serial Server Configuration

After successfuly creating a modbus serial server, adding a register will require creating and enabling a modbus serial client.

I have conntacted the first line support but to no avail.

I need to setup a configuration so that:

  • TRB145 works like a modbus rtu slave.
  • PLC sets the registers of a TRB145
  • If the register value is set to 1 then send an sms.

I am looking for a working solution. If there is a different way of achieving this via rs485, please proivde me with the details.

That is my configuration

Note: TEST2 is enabled because it had the ModbusClient Enabled and assigned previously!

Note: It is impossible to select the register source as it must be CLIENT!

Device TRB14500300
Firmware version TRB1_R_00.07.20.3
Firmware build date 2026-01-21 12:28:12
Internal modem firmware version EC21EUGAR06A07M4G
Kernel version 5.4.301

Greetings,

I hope this message finds you well,

I am currently testing this setup and will post an update once I have more information.

For now your patience is very much appreciated.

Best regards,
V.

Greetings, @Julian ,

I am coming back with an update on your setup.

  1. Set Up the Modbus Serial Server (TRB145 as Slave)
  • Log into the WebUI → Services → Modbus → Modbus Serial Server
  • Enable the server
  • Set: Slave ID: 1 | Port: RS485 | Baud: 9600 | Data bits: 8 | Stop bits: 1 | Parity: None
  • Enable Custom Register Block:
    • Register file path: /tmp/regfile
    • First register: 1025 | Count: 32
  • Save & Apply
  1. Set Up the Modbus Serial Client (required for alarms)

Note: Even though TRB145 is acting as a slave, a Serial Client must also be configured. This is a firmware limitation - the alarm/SMS trigger only works on the Client side. The client simply loops back and reads the register from the server (itself).

  • Go to Services → Modbus → Modbus Serial Client
  • Enable the client
  • Under Server Devices → Add:
    • Name: loopback | Port: RS485 | Slave ID: 1 | Baud: 9600 | Data/Stop bits/Parity: same as Step 1
  • Under Requests → Add:
    • Name: reg1025 | Function: Read Holding Registers (FC3)
    • First register: 1025 | Count: 1 | Data type: 16-bit UINT | Frequency: 5s
  • Save & Apply
  1. Configure the SMS Alarm
  • Go to Services → Modbus → Modbus Serial Client → Alarms → Add
  • Configure:
    • Enable: ON
    • Server: loopback | Request: reg1025
    • Condition: Equal to | Value: 1
    • Action: Send SMS
    • Phone number: +[your number] | Message: Register 1025 triggered!
  • Save & Apply

Let me know if you run into any issues!

Best regards,
V.

Hi Vilius,

I tried following your instructions until I ran into a problem: the TRB145 device doesn’t allow you to activate both the Modbus Serial Server and the Modbus Serial Client at the same time.

Do you know any solution?

Regards,

ivju

Greetings, @ivju ,

Apologies for a delayed response,

Please disregard the previous information regarding the possibility of using the TRB145 simultaneously as a Modbus Serial Client and Modbus Serial Server on the same RS485 interface. After further testing and verification, we can confirm that this configuration is not supported due to the limitation of the serial interface.

However, the requested functionality can still be achieved by configuring the TRB145 as a Modbus RTU Slave (Server) and using a custom script to monitor the Modbus register value and trigger an SMS notification.

The intended setup would be:

PLC (Modbus RTU Master)
        |
        | RS485 Modbus RTU
        |
TRB145 (Modbus RTU Slave / Server)
        |
        |
Custom script monitors register value
        |
        |
SMS notification

In this configuration:

  • The PLC writes values to the TRB145 Modbus register block.
  • The TRB145 stores these values in the configured Modbus register file.
  • A custom script running on the TRB145 monitors the register value.
  • When the predefined condition is met (for example, register value = 1), the script triggers an SMS notification.

Configuration Guide:

  1. Configure TRB145 as Modbus RTU Slave

Navigate to:

Services → Modbus → Modbus Serial Server

Configure the RS485 Modbus parameters according to the PLC configuration:

  • Serial interface: RS485
  • Baud rate
  • Data bits
  • Stop bits
  • Parity
  • Slave ID

Enable the custom register block.

Example configuration:

Slave ID: 1

Register file:
/tmp/regfile

First register:
1025

Register count:
32

With this configuration, the PLC can write values to the TRB145 register range.


2. PLC Configuration

The PLC should operate as the Modbus RTU Master and write the required value to the TRB145 register.

Example:

Register 1025 = 1

This value change will be detected by the monitoring script.

  1. Custom Script Logic

A custom shell script running on the TRB145 monitors the configured Modbus register.

The script performs the following actions:

  1. Periodically reads the Modbus register value.
  2. Checks whether the configured trigger condition is met.
  3. Sends an SMS notification using the TRB145 SMS command interface.
  4. Optionally resets the register value after the SMS has been sent.

Example logic:

WHILE TRUE

    Read Register 1025

    IF Register 1025 = 1 THEN

        Send SMS notification

        Reset Register 1025 to 0

    END IF

END WHILE

This allows the PLC to trigger an SMS alert by writing a specific value to the TRB145 Modbus register.

Important Limitation

The TRB145 cannot operate as both:

  • Modbus RTU Client (Master), and
  • Modbus RTU Server (Slave)

on the same RS485 interface simultaneously.

The following configuration is not supported:

TRB145 (Modbus RTU Client)
        |
        | RS485
        |
PLC

while also acting as:

External Modbus Master
        |
        | RS485
        |
TRB145 (Modbus RTU Server)

The RS485 interface can only be assigned to one Modbus role at a time.

Therefore, the supported configuration for your application is:

PLC (Modbus RTU Master)
        |
        |
TRB145 (Modbus RTU Slave)
        |
        |
Custom script
        |
        |
SMS notification

During testing, we confirmed the following:

  • The TRB145 Modbus Serial Server successfully communicates with a Modbus RTU Master.
  • The PLC/Modbus Master can write values to the configured register block.
  • The TRB145 register file reflects the written values.
  • A custom script can monitor the register value changes.
  • The TRB145 SMS functionality can be triggered through the device command interface.

The final script implementation can be adjusted according to the required application logic, including:

  • Different trigger register address.
  • Different trigger values.
  • Multiple alarm conditions.
  • Different SMS recipients.
  • Register reset behavior after sending the notification.

Please note, that custom script writing is beyond our technical support scope. However, if you have any additional questions, please let me know.

Best regards,
V.