Writing to Input registers of Virtual Modbus TCP server

Topics about the Software of Revolution Pi
Post Reply
MaltarLED
Posts: 26
Joined: 24 Feb 2020, 16:14

Writing to Input registers of Virtual Modbus TCP server

Post by MaltarLED »

Is it possible to write to Input registers (Holding registers) of Virtual Modbus TCP server?
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Writing to Input registers of Virtual Modbus TCP server

Post by dirk »

Hi MaltarLED, have a look at the tutorial How to Use RevPi Core as Modbus TCP Master.
The FC "READ_HOLDING_REGISTERS" is implemented (Read an whole 16-bit input/output register).
2021-02-16 15_23_13-PiCtory - 1.4.8.png
2021-02-16 15_23_13-PiCtory - 1.4.8.png (68.51 KiB) Viewed 3437 times
You can write and read to and from the input of the ModbusTCP Master "Input_Word_1" as follows:

Code: Select all

pi@RevPi39627:~ $ piTest -w Input_Word_1,1
Write value 1 dez (=0001 hex) to offset 11
pi@RevPi39627:~ $ piTest -r Input_Word_1,1
2 Byte-Value of Input_Word_1: 1 dez (=0001 hex)
Post Reply