Announcement

Collapse
No announcement yet.

Problems establishing a Modbus RTU connection

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems establishing a Modbus RTU connection

    Hello all,

    I am in the process of establishing Modbus RTU communication with a gen4-uLCD-24DT display and a MOTG-RS485. The display should work as master and a PC with a USB to RS485 adapter as slave. The software running on the PC is "pyModSlave".
    As program for the display I use a program from the forum with which the input contacts can be read (https://forum.4dsystems.com.au/node/65013). This program was adapted for the gen4-uLCD-24DT display.
    However, I do not receive any data when touching the display. I tried to measure with an oscilloscope at the RX/TX Pin of the display, but I could not measure a signal here either. I am not sure if the display sends a command to read the input contacts.

    I have attached the adapted code. Does anyone have an idea where the error is or what I am doing wrong?

    Thanks for your help!

    Greetings
    Richi
    Attached Files

  • #2
    Hello Richi,

    Sorry for the delay in reply.

    Have you had a look at what pins the MOTG-RS485 connects to the Diablo processor on the gen4-uLCD-24DT with? I assume you are using the gen4-MOTG-AC1 board to interface between the gen4-uLCD-24DT and the MOTG-RS485 module?

    Have you had a look at the MOTG datasheet to see where the TX/RX lands up on the display module? TX goes to PA3, and RX goes to PA2. Please see page 59/60 of the MOTG datasheet.
    So with the jumpers set on the MOTG-RS485 board to RX/TX, they end up on PA2 and PA3. If the jumpers are set to GPIO1 and GPIO2, then they end up PA1 and PA0.
    Also see pages around 37 for the MOTG-RS485 board specifics. There are some notes there which likely apply to your board too.

    You then also need to consider the TURN pin on the MOTG-RS485, which is what determines if the module is sending or receiving, that is tied to GPIO5, which is PA6 on Diablo (assuming you are using the gen4-MOTG-AC1 board). PA6 high means the module is transmitting, PA6 low means the module is receiving. It can only do 1 at a time, so you need to program it to determine its state.

    Take a look at the datasheet and flow the pinout through the various modules you are connecting together to see where it ends up on Diablo, to double check.

    Hopefully this is of some help

    Regards
    James

    Comment

    Working...
    X