CRC error, rc = modbus_read_registers returns -1 .. etc ..

瀏覽次數:130 次
跳到第一則未讀訊息

Astrid Lindstedt

未讀,
2022年3月21日 上午9:40:222022/3/21
收件者:libmodbus
Dear libmodbus community, 

I am trying to configure a libmodbus rtu with rts: 

Screenshot from 2022-03-21 14-37-48.png

These are the printouts of the terminal: 


Opening /dev/verdin-uart1 at 19200 bauds (E, 8, 1)
Bytes flushed (0)
[3C][03][00][00][00][01][80][E7]
Sending request using RTS signal
Waiting for a confirmation...
<00><3C><03><00><00>
ERROR CRC received 0x0 != CRC calculated 0x20C1
 Value of rc = modbus_read_registers  -1
something failed: Invalid CRC
reg[0]=4 (0x4)
reg[1]=0 (0x0)
reg[2]=0 (0x0)
reg[3]=0 (0x0)
reg[4]=2016 (0x7E0)
reg[5]=52334 (0xCC6E)
reg[6]=43690 (0xAAAA)
reg[7]=0 (0x0)

When I measure the RX signal:

rx.png

Hence, 0x02 is the number of bits and  <00><3C> is the ones I am interested in and D590 is the CRC, not 0x20C1. Why do I get rc = modbus_read_registers  -1, how could I access the <00><3C> values that are printed in the terminal? 


Thanks for your support, 
回覆所有人
回覆作者
轉寄
0 則新訊息