MODBUS Gateway Module RS232

Topics about the Software of Revolution Pi
Post Reply
Leylan
Posts: 1
Joined: 09 Nov 2020, 11:15
Answers: 0

MODBUS Gateway Module RS232

Post by Leylan »

I am trying to run a MODBUS Master from my PC that is connected to the Gateway Module. DR = 3, FR = 3 and MD = 0. I can connect sucessfully to the port but when I send modbus commands the messages timeout ? I have RX connected to pin 3, GND to pin 4 and TX to pin 5. The RevPi is connected to the gateway and at some point the PWR light on the gateway module flashes. I am trying to find the cause of this so I want to connect a Modbus master to the gateway module and read and set the 4096 resgister.
User avatar
dirk
KUNBUS
Posts: 1947
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: MODBUS Gateway Module RS232

Post by dirk »

Hi Leylan, your configuration means
DR = 3 : 9600 kBit/s
FR = 3 : Even Parity 8 Bit 2 Stop-Bit
MD = 0 : RS-232Mode (V.24 ) +- 10V to Ground Rx/Tx

The pinning for RS232 from the user manual:
Pinning
Pinning
2020-11-13 15_50_49-Gateway Component Serial.jpg (9.35 KiB) Viewed 1819 times
So your connections alr looking perfect.
I have
RX connected to pin 3,
GND to pin 4 and
TX to pin 5.
What happens in case you use a USB-RS232 interface with QModbusMaster?
Could you use an Oscilloscope?

In the user manual the register 4096 is used for restarting the device.
Register 4096
Register 4096
2020-11-13 15_57_16-Gateway Component Serial.gif (14.31 KiB) Viewed 1818 times
So the registers for input and output data are as follows:
IO Data
IO Data
2020-11-13 15_59_49-Gateway Component Serial.jpg (56.82 KiB) Viewed 1817 times
I hope that I could clarify the things here a bit.

Which RevPi Module are you using?

The RevPi works as follows - you configure the module in PiCtory.
Then you can write to the Input and Output data.
I.e. the command "piTest -w Output_1,123" writes 123 to the register 1 of the Modbus-RTU slave so the Master can read register 1 and receives the value 123.
Post Reply