Modbus TCP

Use this section to discuss your embedded Flowcode projects.
Post Reply
pilot123
Posts: 24
http://meble-kuchenne.info.pl
Joined: Fri Feb 26, 2021 1:50 pm
Has thanked: 1 time
Been thanked: 2 times

Modbus TCP

Post by pilot123 »

I have done further tests, I have got a friend to load a trial version of Flowcode 10 0nto his laptop and have managed to simulate the program operation successfully.
When I try running the Programs on hardware BL0080 development boards, the programs do not work correctly.
I have used Wireshark and Microsoft Network Monitoring tool, and it appears that the actual Modbus message consisting of 12 Bytes is never sent, and if I simulate the Master on my PC to a Slave Hardware, the Modbuds 12 Byte message is sent correctly but the H/W Slave never responds with the 12 Byte message back. Vice versa if I simulate the Slave on my PC to a H/W Master the H?W
Modbus_Slave_Test.fcfx
(15.32 KiB) Downloaded 189 times
Master never sends the Modbus 12 Byte message.
it appears the problem could be with the W5500 modules not communicating with the Network Comms module correctly.
I have attached my Master and Slave Programs.
Could someone please help me with this problem?
Attachments
Hardware_ Modbus _ Master_BL0080.fcfx
(13.94 KiB) Downloaded 193 times

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Modbus TCP

Post by BenR »

Hello,

Many thanks for letting us know. I've pushed a change to the v10 library update system that may help. Please can you update and restart Flowcode and see if this makes any difference to the embedded programs being able to send out the TCP traffic.

pilot123
Posts: 24
Joined: Fri Feb 26, 2021 1:50 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Modbus TCP

Post by pilot123 »

Thanks for the reply, but I have Flowcode 9 with a Professional License.
Will this update help me?

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Modbus TCP

Post by BenR »

Hello,

Ok I've applied the same change for v9 too now, Let me know how you get on.

pilot123
Posts: 24
Joined: Fri Feb 26, 2021 1:50 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Modbus TCP

Post by pilot123 »

Hi Ben
I have updated Flowcode Version 9, with the updated Network Comms and reprogrammed my BL0080 development boards.
The Master now appears to send out the correct messages with the 12 Bytes of Modbus Data reliably.
The H/W Slave device never works ie. The LED never illuminates.
If I connect my H/W Master device to a Simulated Slave on my PC running Flowcode Version 9 , I get random results about 10% of the time it works.
The problem appears to be that the Network Comms module does not reliably pass the RX Data onto the Modbus TCP Module. When it does the system works ie. About 10% of the time.
So we appear to be halfway there.

Regards.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Modbus TCP

Post by BenR »

Hello,

It might be worth trying a higher SPI prescaler property value for the TCP_IP_W5500 component for both the master and slave.

Other then that not sure what to suggest. I can try and rig it up and test here but don't think I'll get chance to do this today.

pilot123
Posts: 24
Joined: Fri Feb 26, 2021 1:50 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Modbus TCP

Post by pilot123 »

Hi

Thanks for your reply.
My W5500 module is connected to Port A Software with FOSC/4.
I Have reprogrammed both my Master and Slave with FOSC/16 and FOSC/64, and I get exactly the same results as previously described.
Any help would be appreciated.

Regards.

pilot123
Posts: 24
Joined: Fri Feb 26, 2021 1:50 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Modbus TCP

Post by pilot123 »

Hi Ben

Is there any update on this problem?

Regards.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Modbus TCP

Post by BenR »

Hello, sorry for the delay.

I've been looking into this and hopefully now have pushed a fix to the library update system for v10 that will solve the issue for you.

Please let me know how you get on and if all is ok now I'll roll the fix out to v9 too.

pilot123
Posts: 24
Joined: Fri Feb 26, 2021 1:50 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Modbus TCP

Post by pilot123 »

Hi Ben

Sorry for the delay, could you please push your update to Version 9.

I am unable to run my project in V10 because the W5500 Ethernet module does not work ie unable to ping device.

I had this same problem when I upgraded to V9 from V8.

To get around this issue you suggested using the V8 compiler with the V9 software and this cured the problem.
I have tried using the V8 compiler with the V10 software, but to no avail.
The program will not compile at all, and produces an error message.

So I would be grateful if you could push your update to the V9 software so that I can test it.

Regards.

Post Reply