Modbus tcp/ip master/slave simulation problem
Moderator: Benj
-
- 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
Hello,
Once again I come here humble to ask for your kind help .
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!!!
Once again I come here humble to ask for your kind help .
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!!!
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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
Unbelievable how i didnt do that first!!
Well thats why you are the boss!
Thanks again for the great support
Ps. How embarrassing
-
- 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
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!!
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!!
-
- 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
I attach my test code also may it is a bit more helpfull!!
- Attachments
-
- tcp modbus slave (1).fcfx
- (17.7 KiB) Downloaded 275 times
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
- Contact:
-
- 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
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.
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.
-
- 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
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!
I do not understand why or it is extremely difficult or too easy.
If anyone has any working example it will be much appreciated!
- Attachments
-
- pneumatic troobleshooter.fcfx
- (21.27 KiB) Downloaded 233 times
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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!!!
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!!!
- 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
Hello,
I beleive the W5500 is fine and also the ESP8266 should be ok too. I'll double check these now.
I beleive the W5500 is fine and also the ESP8266 should be ok too. I'll double check these now.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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!!!
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!!!
- 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
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.
In fact I might do various examples as this will allow me to proove to myself that things are well supported and working.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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!
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!
-
- 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
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!
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 148 times
-
- 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
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
-
- 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
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
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
- 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
Some progress here but still not quite there yet.
viewtopic.php?f=76&t=21504&p=97202#p97138
viewtopic.php?f=76&t=21504&p=97202#p97138
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
Ok so for tcp modbus basically there is no wireless or wired hardware combination that works yet if my understanding is correct...
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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.
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.
-
- 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
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
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
-
- 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
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
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!
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
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!