
Im trying to read from modbus rtu slave on RS485 but cant get any data from the device.
I have followed all the instructions and tried so many things but all fails.
This is my setup, RevPi connnect4, P terminal on RevPi is connected to B on flow meter and N terminal on RevPil is connected to A on flowmeter. Flowmeter address i 098.
Flowmeter manual say: White=Modbus B, Green Modbus - A, so I assume that A is negative.
Manual say: 9600-N-8-1
And:
Address
HEX DEC Data type Description Reading HEX Command Respond Unit
0000 0 INT32 Pos acc energy 0000000D 01 03 00 00 00 02 C4 0B 01 03 04 00 00 00 0D 3B F6 kWh
0002 2 INT32 Neg acc energy 00000024 01 03 00 02 00 02 65 CB 01 03 04 00 00 00 24 FA 28 kWh
0004 4 INT32 Temperature sensor Red 0000096C 01 03 00 04 00 02 85 CA 01 03 04 00 00 09 6C FC 4E 0.01 °C
0006 6 INT32 Temperature sensor Blue 00000970 01 03 00 06 00 02 24 0A 01 03 04 00 00 09 70 FD 87 0.01 °C
0008 8 INT32 Temperature difference 00000009 01 03 00 08 00 02 45 C9
I want to read addres 0 and 8.
I have tried to read address, 1, 2, 3, 4, 5, 6, 7, 8, 9 but all fails with the same info:
modbus rtu action device: /dev/ttyRS485, slave address: 98 function: 0x03, address: 4 failed -1/110/-112345568
I have set values in PICtory as:
piModbusMaster OUT Master_Status_Reset 0 BYTE
MEM device_path /dev/ttyRS485 STRING INFO: value modified to adapt base device type
MEM baud_rate 9600 DWORD
MEM parity None BYTE
MEM data_bits 8 BYTE
MEM stop_bits 1 BYTE
When I read piTest I get this:
pi@RevPi136442:~$ piTest -v Input_Word_4
variable name: Input_Word_4
offset: 243
length: 16
bit: 0
pi@RevPi136442:~$ piTest -r Input_Word_4
2 Byte-Value of Input_Word_4: 0 dez (=0000 hex)
2 Byte-Value of Input_Word_4: 0 dez (=0000 hex)
2 Byte-Value of Input_Word_4: 0 dez (=0000 hex)
^C
pi@RevPi136442:~$
Can someone give me some advice on how to get this to work on Connect4, all the info and guides are for older RevPis. To me its unclear if I need to terminate the terminals on RevPi (have tried with and without external 120 ohm resistor) and if I need to terrminate the flowmeter (have tried with and without resistor). I have the flowmeter attached directly to the RevPi connect4 with a short cable (2 m). No other devices are attached.
Thank you
