Modbus Master Speed

For general Flowcode discussion that does not belong in the other sections.
seokgi
Posts: 179
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 7 times

Flowcode v10 Modbus Master Speed

Post by seokgi »

I am using Modbus master.

MCU : PIC24FJ512GA606
Device : Serial_1 : Modbus RTU via RS-485(7ea)(Master)
Device : Serial_2 : Modbus RTU via RS-485(5ea)(Master)
HMI : Serial_3 : Modbus RTU via RS-232(1ea)(Slave)

There are 7 devices. One address 40001 is loaded in Modbus RTU mode for each device. The device's program also used FC10. This loads well in the Modbus Poll program.
And other serial lines are connected to HMI by RS-232 Modbus.
However, it does not work well with Modbus RTU Master (RS-485).
Although the device's address is retrieved, the MCU speed is so slow that it does not work on the HMI.
I tried adjusting delay, response time, etc., but the results are not good.

If I disable Modbus Master, everything works fine.

What problem do I need to solve?
Please help.

steve001
Valued Contributor
Posts: 185
Joined: Wed Jan 13, 2021 7:15 pm
Has thanked: 81 times
Been thanked: 30 times

Re: Modbus Master Speed

Post by steve001 »

Hi Seokgi,

Device : Serial_1 : Modbus RTU via RS-485(7ea)(Master)
Device : Serial_2 : Modbus RTU via RS-485(5ea)(Master)
HMI : Serial_3 : Modbus RTU via RS-232(1ea)(Slave)

you cannot have 2 masters on the network, is this a typo or do you have 2 masters ?

seokgi
Posts: 179
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 7 times

Re: Modbus Master Speed

Post by seokgi »

That is different serial port
MCU have 6 serial port

steve001
Valued Contributor
Posts: 185
Joined: Wed Jan 13, 2021 7:15 pm
Has thanked: 81 times
Been thanked: 30 times

Re: Modbus Master Speed

Post by steve001 »

Hi Seokgi,

Can you supply more detailed connection information and your flowchart so we can assist you further.
It is difficult with the information you have provided

seokgi
Posts: 179
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 7 times

Re: Modbus Master Speed

Post by seokgi »

Here my project.

Thank you.
Attachments
230901_Freezer-MCU-Serial.fcfx
(54.9 KiB) Downloaded 100 times

viktor_au
Posts: 18
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 2 times
Been thanked: 4 times

Re: Modbus Master Speed

Post by viktor_au »

Hi
Can I ask you a question seokgi?
What is the reason of using many Masters on one MC?

I would like to use the Modbus but my knowledge is not good enough. That is the reason
to learn as much as possible.
-----------------------------------------------
In 2019 Ben wrote:
I'm assuming this is in a multi master type situation. As the bus gets busy the chance of a master interrupting another master's communications increases. Care should be taken to try and avoid collisions by first checking the bus is not in use and if busy having random wait delays before trying again. You may also need to manually resend messages until you get a correct acknowledge. Again beware as if multiple masters are performing retries then you could get collisions again and again. The random delay would be useful here too. Multi master systems are generally fairly complicated to get right and ideally should be avoided if possible.

seokgi
Posts: 179
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 7 times

Re: Modbus Master Speed

Post by seokgi »

Multiple networks must be operated on one MCU.
In fact, even if only one address is accessed from one device in one master, the MCU becomes very slow and data cannot be accessed. I asked other programmers, but they said this never happened.

Thank you for your interest.

steve001
Valued Contributor
Posts: 185
Joined: Wed Jan 13, 2021 7:15 pm
Has thanked: 81 times
Been thanked: 30 times

Re: Modbus Master Speed

Post by steve001 »

Hi Seokgi,

i Would try the following:

do an update on your flowcode, make sure that you are using the latest component's. (just in case)

Have you tried the 1 second flasher, to check if your clock settings are correct ?

Double check your slave addresses make sure you don't have any duplicated address numbers, as this can cause issues.
Remove all slaves from your system, and then test each one individually
add a device and test again, and keep adding devices

i might even try testing the slaves away from your project to make sure they work.

What RS485 modbus interface are you using ?
i have seen it several times that modbus interfaces cannot drive the loop and fall over at around 5 devices

Are you using a termination resistor at the last device ?
What value is it ? if 120 Ohms try 330 Ohms (the fail safe option)

Steve

seokgi
Posts: 179
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 7 times

Re: Modbus Master Speed

Post by seokgi »

Thanks for your help.
1 second flash confirmed. Timer interrupts are working normally
Slave addresses do not overlap.
Testing every slave individually results in very slow reads.
Two slaves cannot be read.
If I read it with another computer program (Modbus Poll), a Time Out error occurs at the 7th Device, but the value is read.
Two interface ICs were tested: MAX485 and SN75176.
The termination resistance was 120 ohm. I tried connecting it and disconnecting it.
I haven't tried 330ohm. I have a holiday tomorrow, but I will definitely test it out.

Thank you again for your interest and help.

steve001
Valued Contributor
Posts: 185
Joined: Wed Jan 13, 2021 7:15 pm
Has thanked: 81 times
Been thanked: 30 times

Re: Modbus Master Speed

Post by steve001 »

Hi Seokgi,
seokgi wrote:
Sat Sep 02, 2023 11:12 am

Testing every slave individually results in very slow reads.

Two slaves cannot be read.

If I read it with another computer program (Modbus Poll), a Time Out error occurs at the 7th Device, but the value is read.
Are all these tests carried out with your program or away from this ?

was this a different test ?from test 1 & test 2

"If I read it with another computer program (Modbus Poll), a Time Out error occurs at the 7th Device, but the value is read."

another question, how are the slaves connected ?

i.e daisy chain, twisted pairs ?

Steve

Post Reply