modbus tcp

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

Moderator: Benj

Post Reply
dwenzel
Posts: 4
Joined: Thu Dec 06, 2018 9:57 pm
Been thanked: 1 time
Contact:

modbus tcp

Post by dwenzel »

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

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

Post by Benj »

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?

dwenzel
Posts: 4
Joined: Thu Dec 06, 2018 9:57 pm
Been thanked: 1 time
Contact:

Re: modbus tcp

Post by dwenzel »

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
Attachments
tcp modbus slave.fcfx
(11.92 KiB) Downloaded 362 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

Post by Benj »

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.
tcp modbus slave.fcfx
(12.38 KiB) Downloaded 385 times
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.

dwenzel
Posts: 4
Joined: Thu Dec 06, 2018 9:57 pm
Been thanked: 1 time
Contact:

Re: modbus tcp

Post by dwenzel »

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.

dwenzel
Posts: 4
Joined: Thu Dec 06, 2018 9:57 pm
Been thanked: 1 time
Contact:

Re: modbus tcp

Post by dwenzel »

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

Post Reply