Modbus tcp/ip master/slave simulation problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Hello,
Once again I come here humble to ask for your kind help :D.
I started to play around with Modbus...my final target will be to have a pc as master and read various PICS loaded with sensors, so far so good!
So as a flowcode 8.1 user I searched flowcode website and found

Modbus TCP Master component
https://www.matrixtsl.com/wiki/index.ph ... s:_System)
Great, so I start trying to make it work I simulation but nothing the 2 instances of flowcode don't communicate with each other...
I also tried adding network comms for Modbus TCP to make the communication but...nothing.
Now I am thinking that I have a few pic18f46k80 and a few enc28j60 maybe I can try real time??
The main question is, is there a Modbus TCP/IP master/slave example using the simulation or enc28j60 that is tested and works?
Because I searched a lot and couldn't find anything!
Thank you very much!!!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

Hello,

The master and slave examples should work fine together in the simulation.

Please can you check if you are using at least 8.1 release.

Once you have done this please also use the "Help -> Check for updates" menu to get the latest versions of the components.

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

:mrgreen: :mrgreen: :mrgreen: once again you are right!!!
Unbelievable how i didnt do that first!!
Well thats why you are the boss!
Thanks again for the great support
Ps. How embarrassing :shock:

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

As per your recommendation it works in simulation but when i try to implement it in reality i have a pic24fj256ga106 and a esp01 wifi module i doesnt work!
I first connect the wifi to the network and then impementt your modbus slave example but nothing...
Is there any example using esp01 and enc26j60 with modbus tcp master and slave?
I test with my pc using modbus poll.
Thanks for the great support!!

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

I attach my test code also may it is a bit more helpfull!! :D
Attachments
tcp modbus slave (1).fcfx
(17.7 KiB) Downloaded 272 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

Hello,

The Network Comms component states that the ESP8266 is not yet supported. This could be the cause of the problems.

I'll have a play and see if I can make the network comms and ESP components play nicely together.

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Thank you Benj!!
I look fwd for your reply!!

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Dear Benj any updates on the esp8266?
And also i would like to request if possible a simple example using the encj2860 and modbus tcp slave.I struggle for weeks now but no result.I use pic24fj256ga106.
I tried the encj2860 example for webpage and it works well.
I just cannot make them work together....a simple example would be great.

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

I attach my last attempt also which doesn't work...
I do not understand why or it is extremely difficult or too easy.
If anyone has any working example it will be much appreciated! :mrgreen:
Attachments
pneumatic troobleshooter.fcfx
(21.27 KiB) Downloaded 230 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

Hello,

The ENC28J60 component is not supported by the Network Comms component at the moment. Just looking into this now for you but it looks like it may be hard to impossible to support the ENC28J60 module with the Network Comms component as the ENC28J60 module exposes a lot of the lower layers that would need servicing.

I'll keep on it and chat to Leigh and see if we can get anywhere.

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Thank you very much Benj!
Ok i understand.
Which modules are compatible so i can purchase them and proceed with the project?
W5500 is compatible?and how about wifi?any recommendations?
Thanks again for the support!!!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

Hello,

I beleive the W5500 is fine and also the ESP8266 should be ok too. I'll double check these now.

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Ok thats perfect!!!i already ordered a few w5500 so i will try in a few days!!
Esp8266 i already have so i can try today!!!
First i initialize second i connect to network and then implent the tcp slave example if i understand correctly!!!
I am on it!!!but if you have an example with the esp8266 easy ly available it would be highly appreciated!!
Thanks so much for your support!!!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

I'll put together an ESP8266 example for you.

In fact I might do various examples as this will allow me to proove to myself that things are well supported and working.

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Thank you very much Benj!for all your efforts!!
And i from my side i will test and check and return with my feedbacks to you!thanks again!!and i look forward for your news!!!
Many many thanks!

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Hello again,
So i was running some tests with the esp8266(esp01)...
well, it looks like I can send data from the pc but strangely the controller doesn't respond..like it doesn't read the data.
I confirm that wifi and controller are working well because when the wifi is connected to the internet the controller takes the response and blinks an led...
But there is no more transaction after that but adding a USB to serial in wifi tx I can see data coming to the controller but nothing..... I use Modbus poll by the way for the simulation!
Attachments
Untitled.png
(20.14 KiB) Downloaded 2489 times
pneumatic troobleshooter.fcfx
(17.8 KiB) Downloaded 145 times

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Now that i think about it maybe the format of the sent data from the esp cannot be recognise....i will try to change the firmware of the antenna tomorrow with the esp link to make it fully serial without the ipd:/2344444crlf format just the bytes to see if any difference :wink:

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Dear Benj,
I also would like to add that using the esp-link firmware to the esp01 module made no difference i can connect with modbus poll and sent data but the controller doesnt react....
Now i will change the firmware to the ai-thinker (at commands) again and wait for your responce.
Thanks again

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

Some progress here but still not quite there yet.
viewtopic.php?f=76&t=21504&p=97202#p97138

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Ok so for tcp modbus basically there is no wireless or wired hardware combination that works yet if my understanding is correct...

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

Hello,

The Raspberry pi works fine and the W5500 is close. I hope to crack it and the ESP8266 this week.

I've edited this wiki page to make it more obvious how the components can be connected together and to report the status of the various embedded modules.

https://www.matrixtsl.com/wiki/index.ph ... etworking)

Having another go this afternoon so hopefully I'll get somewhere with it.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by Benj »

Hello,

Right I have updated the components and both the W5500 and the ESP8266 should now work correctly with the Network Comms component.

If you have a go with the Modbus TCP component then let us know how you're getting on.

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Hello,
Thats great news Benj!!thank you so much for your efforts!!!
Ok i will try first the esp8266 and after the w5500 because it has not arrived yet!!
I will keep you posted. :wink:

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Dear Benj,
I downloaded the new updates and by testing, I noticed the following!
It seems that now I can connect to the module (esp8266) and the controller can receive some data (i check as per your Modbus slave example if check for incoming yes led on)now it receives before it didn't.
But unfortunately, it couldn't read or write anything like that it receives but not the correct data.
After that i checked by using master example and slave at simulation, It works at simulation
Next i runned the slave thought flowcode and connected Schneider electric Modbus/jbus tester
The result is that even in simulating the slave flowcode with Modbus tester I can communicate but the data is not correct...
I attached some data i took that may help you but I think the network component does not receive/respond correctly
Attachments
3.png
(181.69 KiB) Downloaded 2234 times
2.png
(51.14 KiB) Downloaded 2234 times
1.png
(23.34 KiB) Downloaded 2234 times

kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: Modbus tcp/ip master/slave simulation problem

Post by kabouras_33 »

Dear Benj,
Just to be clear! I would like to say basically that the master and slave examples work great with each other but they don't work with external software/devices...I cannot understand why but I think they should work for example
simulator software master(Modbus poll, simply Modbus e.t.c) / flowcode slave and
flowcode master/simulator software slave(Modbus slave, simply Modbus e.t.c)
because that's the purpose of Modbus to be able to communicate in a common protocol with various devices :wink:
so I think that now esp8266 works well but the network comm module doesn't speak correct Modbus language.
I hope i could help a little and of course, i will continue research and wait for your response!
Best Regards

Note: the previous post testings are only with Modbus module and network comm modules!

Post Reply