Modbus TCP Slave

For general Flowcode discussion that does not belong in the other sections.
BenR
Matrix Staff
Posts: 1742
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 443 times
Been thanked: 604 times

Re: Modbus TCP Slave

Post by BenR »

Hello,

Looking now. I have the module in front of me and am doing a big overhaul to it to try and get it working properly for Modbus TCP and to add functions like DHCP and DNS lookup. I'll let you know how I get on.

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

Re: Modbus TCP Slave

Post by seokgi »

Thank you very much for your help.
However, too much time has passed and we are receiving criticism from customers.
I know you're busy, but please help me.

Thank you.

Transrate by Google

BenR
Matrix Staff
Posts: 1742
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 443 times
Been thanked: 604 times

Re: Modbus TCP Slave

Post by BenR »

Hello,

Right I've spent the last two days on this and managed to get it so it's now working correctly and reliably. It looks like in the end what made it work was a tiny delay in just the right part of the code. I still want to spend more time on adding DHCP and DNS but for now it at least (fingers crossed) should allow things like the Modbus TCP and the Webserver to function correctly with the W5500 module.

Please let me know how you get on using the latest library updates.

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

Re: Modbus TCP Slave

Post by seokgi »

Thank you for your help.

TCP Connect
Listen
Scoket Open

If I use commands such as, the port will be searched. However, if you do not use the above command,
The port is not searched.
Modbus TCP Slave is not connected.

MCU : Pic18F67K40

Thank you.

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

Re: Modbus TCP Slave

Post by seokgi »

Can you post the project you tested?

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

Re: Modbus TCP Slave

Post by seokgi »

If I unplug the network cable and plug it again, the port not be searched, but if I reset it again, the port will be searched.
After 2~3 minutes after reset, the port does not search.
And in the port searcher, the manufacturers are searched differently for PIC18F67K40 and PIC24FJ512GA606. Is this right?

thank you.

BenR
Matrix Staff
Posts: 1742
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 443 times
Been thanked: 604 times

Re: Modbus TCP Slave

Post by BenR »

Hello,

Here is my test project.

Slave is running on an Arduino Uno and the master is running in the Flowcode sim.

Modbus_TCP_Slave.fcfx
(13.86 KiB) Downloaded 15 times
Modbus_TCP_Master.fcsx
(12.31 KiB) Downloaded 12 times

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

Re: Modbus TCP Slave

Post by seokgi »

I tested it with the program you posted.
However, it does not work properly.
Sometimes it appears to be a normal value.
However, timeout, read error, and write error are repeated. I adjusted all the timings.
It also doesn't work.

If I unplug the LAN cable and re-plug it or after a long period of time, port 502 is not searched.

Sometimes I can't connect.
Please take a look again.

Thank you.

BenR
Matrix Staff
Posts: 1742
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 443 times
Been thanked: 604 times

Re: Modbus TCP Slave

Post by BenR »

Please can you post your project so I can try and replicate your setup.

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

Re: Modbus TCP Slave

Post by seokgi »

I posted my project.

Thank you so much.
Attachments
Hub-240419-18F67K40-TCP -1.fcfx
(127.28 KiB) Downloaded 3 times

Post Reply