Page 1 of 1

Writing to Input registers of Virtual Modbus TCP server

Posted: 29 Jan 2021, 09:47
by MaltarLED
Is it possible to write to Input registers (Holding registers) of Virtual Modbus TCP server?

Re: Writing to Input registers of Virtual Modbus TCP server

Posted: 16 Feb 2021, 15:26
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 3436 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)