![]() ![]() or a smart RS485 interface able to encode and decode by itself the MODBUS messages, such as the Yocto-RS485.or a simple RS485 interface with a programming library which encodes and decodes MODBUS messages.either a specific program provided by the device vendor, with a compatible interface.To exchange MODBUS messages, you must therefore use: You cannot easily craft MODBUS messages "by hand", as you would have done with ASCII protocols used on RS232: each MODBUS message ends with a checksum code, computed from the full content of the message. ![]() On the way, check also communication speed and parity (same principle as RS232). So, in order for the MODBUS communication to work, you must check in the device configuration its Slave ID and change it if necessary. Each MODBUS request starts with the Slave ID of the intended device, each answer starts with Slave ID of the slave sending it. The slave doesn't sent any message before the host requests it.Īs there can be several devices connected in parallel on the RS485 bus, each slave device must use a unique MODBUS Slave ID on the bus. The host systematically initiates the exchange and the "slave" device answers. MODBUS messages correspond to relatively simple operations to read and write 16 bit words and binary registers (often called "coils"). MODBUS is a protocol between a host (master) and devices (slaves) to access the configuration of the devices and to read the measures. You must therefore know a minimum of MODBUS to interface an RS485 device. While with RS232 many devices simply use text (ASCII) protocols, with RS485 most devices use the MODBUS protocol. The main particularity when using RS485 is in the format of the exchanged data. It's cheaper and it's one less component in the system. There are indeed RS232 to RS485 gateways, but they are not interesting nowadays: it's as easy to use an RS485 to USB, to Ethernet, or to GSM directly. RS485 and RS232 are not directly compatible: you must use the correct type of interface, or the signals won't go through. Sometimes this means that you must screw a small resistance on a terminal, or simply move a switch in the adequate position.Īn RS485 bus is often made of just two wires and a resistor at the extremities. However, there is a small trick to do so: at each end of the bus, you must put a bus terminator. Therefore, you don't have to multiply RS485 interfaces on the host to question several devices. An important advantage of RS485 is that you can put several RS485 devices on the same bus. RS485 is a serial transmission standard, a little bit like RS232, but using other electric signals. While exchanging with our customers on the best ways to interface industrial controllers, we noticed that nowadays the small secrets enabling you to use an RS485 interface were sometimes unknown from engineers implementing computer or internet based automation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |