Hello
I am trying to get Modbus tcp working and was wondering if anyone has a working example I can see, I think my problem is around the setup of the tcp stack I can connect to the micro but it is not responding when I send a request from another working Modbus master.
Regards
modbus tcp
Moderator: Benj
- 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
Hello,
We have an example here that is known to work.
https://www.matrixtsl.com/wiki/index.ph ... b672d9b8f4
Can you post what you have so far so we can have a look and hopefully spot the issue?
We have an example here that is known to work.
https://www.matrixtsl.com/wiki/index.ph ... b672d9b8f4
Can you post what you have so far so we can have a look and hopefully spot the issue?
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
Re: modbus tcp
Hello Benj
Thankx for quick reply. Im using a Ethermega from freetronics which is a Arduino 2560mega with a built in ether shield wiznet w5100. Running the attached flowcode file setup as Modbus tcp slave and then on separate computer running a program called simply Modbus tcp client. The client is connecting okay but when requesting a coil change the slave is not responding.
Regards
Thankx for quick reply. Im using a Ethermega from freetronics which is a Arduino 2560mega with a built in ether shield wiznet w5100. Running the attached flowcode file setup as Modbus tcp slave and then on separate computer running a program called simply Modbus tcp client. The client is connecting okay but when requesting a coil change the slave is not responding.
Regards
- Attachments
-
- tcp modbus slave.fcfx
- (11.92 KiB) Downloaded 362 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
Hello,
I've looked through your project file and made some minor changes. Basically the Modbus TCP component needs to connect to the Network Comms component and it is this that then connects to the Wiznet component.
The Network comms component is quite new and interfacing with the Wiznet component is not yet tested and confirmed working so there may well be problems lurking (hence the "Not Yet Supported" message in the properties). I've just been in and had a look through the code and didn't see any issues but let us know how you get on.
You might want to make sure you are running the 8.1 release and also use the check for updates tool to get the latest component fixes etc.
I've looked through your project file and made some minor changes. Basically the Modbus TCP component needs to connect to the Network Comms component and it is this that then connects to the Wiznet component.
The Network comms component is quite new and interfacing with the Wiznet component is not yet tested and confirmed working so there may well be problems lurking (hence the "Not Yet Supported" message in the properties). I've just been in and had a look through the code and didn't see any issues but let us know how you get on.
You might want to make sure you are running the 8.1 release and also use the check for updates tool to get the latest component fixes etc.
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
Re: modbus tcp
Hello Benj
Still no joy tried everything i could think of including using the EB 023 v2 e block it connects like the wiznet to simply modbus, but wont pass any requests from the client software, think i need a beer and think.
Still no joy tried everything i could think of including using the EB 023 v2 e block it connects like the wiznet to simply modbus, but wont pass any requests from the client software, think i need a beer and think.
Re: modbus tcp
Hello Benj
Happy boy found a strange problem to do with the 2560 mega board if you are using a ethernet shield (wiznet 810MJ) it is wired for slave select from port B4 which I had configured to use from the component properties in Flowcode but you also have to write Port B0 to be an output in the code even if you are not using this port for slave select, as this is the default port for slave select for the 2560 mega. Anyway just letting you know that I can successfully connect now with Simply Modbus and it is reading the address values. Have noticed the new updates from flowcode so will install and test in anger now and let you know if everything lines up correctly.
Regards
Dave
Happy boy found a strange problem to do with the 2560 mega board if you are using a ethernet shield (wiznet 810MJ) it is wired for slave select from port B4 which I had configured to use from the component properties in Flowcode but you also have to write Port B0 to be an output in the code even if you are not using this port for slave select, as this is the default port for slave select for the 2560 mega. Anyway just letting you know that I can successfully connect now with Simply Modbus and it is reading the address values. Have noticed the new updates from flowcode so will install and test in anger now and let you know if everything lines up correctly.
Regards
Dave