2 wires Modbus Control - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10) +--- Thread: 2 wires Modbus Control (/showthread.php?tid=4081) |
2 wires Modbus Control - Hadeel - 06.06.2022 Good day! We would like to use Modbus with LM light RS485 port. However, the device we want to control has 2 wires Modbus only. Can we use 2 wires Modbus with LM5 RS485? If yes how is the wiring diagram should be like? LM light has A, B, and GND. Thanks in advance. RE: 2 wires Modbus Control - admin - 06.06.2022 Provide a datasheet of the device you want to connect. You can try connecting just A/B but GND is recommended for more robust operation. RE: 2 wires Modbus Control - Hadeel - 06.06.2022 Thank you admin, the engineers of the device we want to connect can adjust the communication protocol for the convenience of LM....so there is no offiial documents. We will ask if they can do with A/B and GND. LM will be master, the device we want to connect will be the slave and the following is what they suggest as our protocol. Interface RS-485(2 wires) Protocol Modbus ASCI Data rate 19200Bps Data length 8bit Parity None Stop bit 1bit Modbus ASCI will be structured by the following elements Start Code : (3AH) Slave Address Length 1byte Function Code 1byte Resister Address Number of Resisters LRC End Code We might need to calculate checksum. Do you see any difficulity in LM composing message in this kind? RE: 2 wires Modbus Control - admin - 07.06.2022 Only Modbus RTU/TCP is supported via profiles and luamodbus library. Modbus ASCII is not supported directly. One of our customers made a library for Modbus ASCII it but we haven't tested it: https://github.com/lucapalazzo/luamodbus-native RE: 2 wires Modbus Control - Hadeel - 07.06.2022 Oh! Okay ... that is good to hear. I will ask if they can change the protocol to Modbus RTU or Modubs TCP. If it's not modbus, just RS-485 with ASCII codes, will we have a problem? RE: 2 wires Modbus Control - admin - 07.06.2022 What protocol is used over RS-485 does not matter. If your Modbus device has a DC power supply you can connect power supply negative pole to GND on LM. You can read why GND connection is recommended here: https://store.chipkin.com/articles/rs485-rs485-cables-why-you-need-3-wires-for-2-two-wire-rs485 RE: 2 wires Modbus Control - Hadeel - 07.06.2022 Thank you admin That is a good article. Except for the Modbus case, LM RS485 supports ASCII character encoding or it should be HEX or Binary? RE: 2 wires Modbus Control - admin - 07.06.2022 You can transmit any kind of data over RS485. For Modbus ASCII the serial port should be set to 7-bit mode in some cases. |