(0)| 1/2/2021 9:18 PM | |
|
Posts: 13 Rating:
|
Greetings, Im having an issue with Modbus RTU addressing. My setup is an S7-1212 with a CB1241. The data sheet for the device I am trying to communicate with gives all the Modbus registers as Hex values. I am currently trying to read 3 16 bit registers starting at 0x331A. The function code required is 04. In my MB Master call I have entered Mode 0, Data_ADDR 413082 (function code 4 with decimal 13082 for 0x331A) and DATA_LEN 3. In response I get error 16#80C9. Blocked_Proc_Timeout was 3.0 and I changed it to 10 with no effect. I have attached the protocol description if someone could please help direct me on this addressing issue. My Bad, I had the wires swapped and I need to pad 1 place. SO, now with the 413082 value for DATA_ADDR my Modbus packet is as follows 01 (dev addr), 03 (I assume modbus command so this should be 04), followed by 33 1A (register address) then 00 03 (number of registers requested) and lastly 2B 48 (CRC). This is returning a status though of 16#8383 "Error in the data address or address outside the valid range of DATA_PTR" At least that error is as a response from the slave! Update: Now it really gets weird! Decided to try to read the RTC. This is 3 registers starting at 0x9013. The protocol manual says its a MB code 3 to read and a 10 to write. I entered 336884 and error. Just out of frustration I tried 4336884 and success! If I look at the previous packet catch, it was putting in a MB command 3 when I explicitly told it a 4.Looks like it might be some sort of issue with the Modbus mode, but I cant make heads or tails of how to change it except the leading number in the DATA_ADDR and even that seems to have no effect. On top of that I dont even see a mode "10" listed if I want to try to write the RTC. AttachmentMODBUS-Protocol-v25.pdf (467 Downloads) |
Last edited by: Frazzled at: 01/02/2021 22:07:12Last edited by: Frazzled at: 01/02/2021 23:57:39Last edited by: Frazzled at: 01/03/2021 03:20:19 |
|
Follow us on