Home > Forum > Operator terminals (Weintek) > Modbus codes used for communication from the panel
- This topic has 3 replies, 3 participants and was last updated 4 years, 9 months ago da Sergio Bertana.
-
AuthorPost
-
December 9, 2013 at 8: 08 am #35459RobertoParticipant
I am using your Weintek panel with ethernet port connected in Modbus TCP / IP with a Panasonic PLC, to perform a connection test I have inserted an object of Numerical introduction which refers to register 399 of the PLC. I have defined the 3x code in the drop-down menu followed by the register address but connecting to the PLC with the program being simulated on the PC I get a communication error.
I tried to capture Modbus TCP packets with Wireshark and I saw that the panel sends the Modbus query packet with code 04 despite having defined 3x in the drop-down menu. The PLC does not manage the Modbus 04 command. How can I solve?
December 9, 2013 at 8: 29 am #37917Sergio BertanaAdministrator ForumThe codes shown in the object settings drop-down menu on the terminal (Screenshot) are just a convention they do not correspond to the actual Modbus codes used in the communication protocol. As reported in the PLC connections manual, here is a table with the correspondences between the code defined in the object and the relative Modbus code.
(0x) Modbus codes: Read 0x01 Read coil, Write 0x05 write single coil
(0x_multi_coils) Modbus codes: Read 0x01 Read coil, Write 0x0F Write multiple coils
(1x) Modbus codes: Read 0x02 Read discrete input, Does not handle writing
(3x) Modbus codes: Read 0x04 Read input register, Does not handle writing
(4x) Modbus codes: Read 0x03 Read holding register, Write 0x10 Write multiple registers
(5x) Modbus codes: Read 0x03 Read holding register, Write 0x10 Write multiple registers
(6x) Modbus codes: Read 0x03 Read holding register, Write 0x06 Write single register (Only one register)
(3xbit) Equivalent to the 3x command
(4xbit) Equivalent to the 4x commandJuly 19, 2019 at 6: 05 am #48595ManuelParticipantI resume this discussion since I am trying to communicate with an MT8070iE with a modbus TCP / IP device, I have to use the command 0x05 write single coils and write on the address 10010 put it to one. If I use an external free software it works if I use the panel I can't or rather I don't understand the command to use as a bit button.
In theory I set modbus zero address set bit with a button and use the 0x command but how do I tell it to use the 0x05 and to point the 10010.
PS: I bought several panels from you and I am fine.
July 19, 2019 at 6: 12 am #48598Sergio BertanaAdministrator ForumIf you look at the previous post you will see that using the 0x command the panel will automatically use the Modbus 01 code to read the bit value and the 05 code to write the value, so the use of the 0x code is correct.
But in the meantime I would raise doubts on the use of Zero-based Addressing sure that it is not better to use standard Modbus TCP? try both because if your device is Modbus compliant you have to use standard Modbus TCP.
Sure that the address to use is 10010, in many application nodes (And in Modbus emulators) the modbus code is added at the top of the address, and 10010 indicates to use the Modbus 01 command to read the address 10. So I would try to use command 0x with address 10.
-
AuthorPost
- You must be logged in to reply to this topic.