Author Topic: Modbus RTU multidrop via RS485 problem  (Read 2266 times)

AndrejusZ

  • Newbie
  • *
  • Posts: 6
    • View Profile
Modbus RTU multidrop via RS485 problem
« on: August 02, 2021, 11:16:26 AM »
Hello all. I need help, please. I am new in AHMI. My project target is control 16 similar devices via Modbus RTU RS485, so via one hw port. Any device have different PLC address. I begin test with one, test many things, buttons, indicators etc. All work fine, but only before I try to connect second one. I though that enough add one more driver with same com, but different PLC address. But... it not working. When I add communication is very bad and only with one of two devices. I read posts, finding some posts from 2017, where Archie say that this problem is solved. I have 399x version and have this problem. Than I find some post where man write some code to change station address for driver every time when need it. But I don't have experience with vb, so I understand that command some like plcAddressStation=...., but where I must put code I not understood. Please clarify me if it possible how to do it correctly.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #1 on: August 03, 2021, 01:44:51 AM »
You just add a separate driver instance for each device, set all properties with the same value except for StationAddress (which should go from 1 to 16).

Then in each of your controls you set the ComComponent property to the driver of the device it should get the value from.


AndrejusZ

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #2 on: August 03, 2021, 04:30:52 AM »
Thank you Godra. But  as I wrote, it not work for me. May be I need some driver upgrades?

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #3 on: August 03, 2021, 10:00:38 AM »
Try using 3.99y Beta version instead.

AndrejusZ

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #4 on: August 03, 2021, 10:51:50 AM »
Ok, thank you. Where I can download this version.
One more question, is it possible pooling data by time, I think may be some problem with conflict on bus.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #5 on: August 04, 2021, 12:29:39 AM »
You need to spend some time familiarizing yourself with this forum:

   https://www.advancedhmi.com/forum/index.php?topic=2449.msg14752#msg14752


AndrejusZ

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #6 on: August 16, 2021, 12:09:30 PM »
Thanks for the answers, I tried the latest version, but it also does not work correctly. I am an electronic engineer, so I studied this question with an oscilloscope. I have seen that if I use separate drivers with the same COM port and a different station number, either of these drivers works as asynchronous, so there are often conflicts on the bus.
 Is it possible to synchronize the drivers or, alternatively, use one port driver and determine the station address for any element? Please help me how to do this.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #7 on: August 16, 2021, 06:02:20 PM »
I don't have any other suggestions for you.

Communicating with 1 or 2 devices over serial connection is challenging enough, not to mention 16 devices that you have to deal with.

Unless there is someone else with a similar setup to help you then you are out of luck.

bachphi

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #8 on: August 16, 2021, 07:48:44 PM »
How are you connecting your devices?  show a diagram.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

AndrejusZ

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #9 on: August 18, 2021, 05:24:30 AM »
Issue when devices conected via standart RS485 in parallel to one COM port.
It work well if I use  separate port for every device. But it not usable because additional converters need for every device and  every time to reconnect to PC you have new virtual COM port numbering.

profnova

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #10 on: August 18, 2021, 08:25:01 AM »
You could use a separate modbus ip to modbus serial gateway. These are cheap. But you also have to take care of the requests poll, it should be slow enough.

Depending on the time you have, you can also open the port, make a request, close it, change equipment id and so on. It it is just for temperature readings, it may work but anyway, with 16 serial equipments on 1 port, you won't have great performances.

AndrejusZ

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #11 on: August 18, 2021, 12:23:25 PM »
Thank you profnova for answer and understanding my issue. So as I saw that collisions occured when few ModbusRtu is open in same time. Now I try to sinchronise this process enabling/ disabling port with disableSubscription by timer. In first view it work well, but not yet tested fully. I plan to test this with various baud rates and with more than 2 devices. If it interesting I will report about results.

pk

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Modbus RTU multidrop via RS485 problem
« Reply #12 on: August 26, 2022, 01:04:11 PM »
Hi AndrejusZ
Did you get to solve the problem?