martinav (Customer) asked a question.

Operating a simple Modbus RTU Relay via RS232

I am asking if it is fundamentally possible to operate a Waveshare Modbus RTU Relay that has RS485 input from a simple device that can send ascii or HEX from an RS232 interface.

 

I ahve this setup now. Currently using a simple COM port on my PC to an RS232 -> RS485 -> Relay setup. Everything I do I get nothing from the relay. No TX/RX traffic lights either. I would think something would wiggle. Yes, I'm confident of the basic settings.

 

The device I will be using to send the commands will not know anything about what modbus is. But, it can send the ascii or hex strings no problem.


  • martinav (Customer)

    Well after messing with all of the variables, it was swapping rx/tx between my source device, and my converter. As well as adding CF/LF to the commands. THere are just way too many variables in comms to get things working in any rational amount of time.

    Selected as Best
  • kewakl (Customer)

    Are the RS-485 RX/TX wires landed in the correct locations on the relay and the sending device.

    Some manufacturers still get the labeling incorrect for the signal naming.

  • g.mccormick (Customer)

    Are you confident in your rs232 to rs485 converter?

  • martinav (Customer)

    @g.mccormick (Customer)​ Absolutely sure. I used it for another device that was working fine. However it was not modbus.

     

    @kewakl (Customer)​ Yes, I'm sure of this too. In fact, I use a VOM to verify 3.5v is present and with the correct polarity.

    • kewakl (Customer)

      Not sure what the 3.5V is.

      RS-485 is differential signaling at roughly +/-200mV level from [Rx/Tx] [A/B] [+/-] --whatever signal naming conventions used.

  • martinav (Customer)

    So, my answers thus far are troubleshooting. However, my initial question is if it is even possible to do what I am attempting. I know there are modbus programs for PC use, but I have a simple rs232 tx/rx device that can only send/receive ascii or hex. I need to send commands to open/close relays. I do not need any information back from the device.

  • Tinker (Customer)

    Fundamentally a serial communication is only a series of bits, if your device can send HEX it can probably send pretty much any arbitrary series of bits. However for a MODBUS device to recognize it is being spoken to the bits must be a in a very specific pattern including an error checking field, if your device won't calculate that for you, you will have to do it yourself.

  • martinav (Customer)

    I was able to control a UART device through an RS232 interface successfully. I did have to add 0D 0A to the end of the command string, but then it worked flawlessly.

     

    Now, using an RS232->RS485 i'm not having such luck. Is there a voltage I can read that can tell me at least if my converter is alive or dead?? I get a 3.5V on the RS232 side, and 5.5V out of thr RS485 side. I dont know if thats worth anything, but it does mean that its conecteed. So, its not a connectivity problem.

     

    I have swapped RX/TX and A-/A+ on both sides and this didnt give me anything.

    Expand Post
  • mjkuwp94 (Customer)

    RS485 is differential signaling and is sometimes half duplex so you have to set a gpio pin to control the direction or with some devices there is some kind of auto-switching. I use FTDI cables a lot for USB to RS-485. If you want to confirm the signals you may need an oscilloscope and set up your display to read differential. (Channel B - Channel A) for example.

     

    Modbus has some very confusing conventions for the register numbers. Maybe you have the register number wrong? You may have to calculate a CRC algorithm correctly for the command to be acknowledged. Did you hook the GND wire for your bus as well? you should.

    Expand Post
  • mjkuwp94 (Customer)

    You have not said what your hardware is. Maybe you need a simpler connection like UART (~TTL) to RS-485. This would be something that takes uart input at 3.3V or 5.0V logic levels and has a transceiver to convert to RS-485 differential signalling. Are you sure that your device is RS232 electrical signalling? that would be much higher signal levels. Your scope should able to tell you what your device asserts on the TX line.

    try searching for ' MAX485 RS485 Transceiver' as this might be what you need.

    Expand Post
10 of 11