Modbus TCP Implementation

dkaufmann
Posts: 24
Joined: Wed May 17, 2017 9:06 am

Re: Modbus TCP Implementation

Postby dkaufmann » Fri Aug 28, 2020 8:51 am

Hello,
okay thank you very much for your reply, very appreciated.
I am looking forward for the new version then.
best regards
DK

jas39_
Posts: 21
Joined: Mon Aug 29, 2016 8:26 pm

Re: Modbus TCP Implementation

Postby jas39_ » Sun Oct 18, 2020 6:37 pm

@ESP_alisitsyn,
Any update on when this feature can make it into the MASTER tree?

I'm implementing a TCP modbus slave with a very sparse register map and it would save mamory to be able to have several areas of each type
Rgds
/Anders

ESP_alisitsyn
Posts: 211
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: Modbus TCP Implementation

Postby ESP_alisitsyn » Mon Oct 26, 2020 12:49 pm

@jas39_,

Unfortunately I can not provide the concrete date for this feature. It is in my todo list and will be implemented after higher priority tasks.

deolsunny533
Posts: 1
Joined: Tue Oct 27, 2020 10:19 am

Re: Modbus TCP Implementation

Postby deolsunny533 » Tue Oct 27, 2020 10:31 am

Could you tell me little bit more about your application? Is this Modbus master TCP or slave?

dkaufmann
Posts: 24
Joined: Wed May 17, 2017 9:06 am

Re: Modbus TCP Implementation

Postby dkaufmann » Wed Oct 28, 2020 8:09 am

in my case it is a Modbus TCP slave (server).
The problem is, that the prepared library from esp-idf does not allow several areas of holding register areas.

jas39_
Posts: 21
Joined: Mon Aug 29, 2016 8:26 pm

Re: Modbus TCP Implementation

Postby jas39_ » Wed Oct 28, 2020 7:34 pm

My case is a modbus router rtu<->tcp (Rs485 master <-> Wifi Slave) with a sparse memorymap on the RS485 side and on top of that "double buffering" of tcp-write data which doubles the amount of registers needed.

Sofar I've solved the TCP slave part with a linked list of memory areas and wrapped it in my app so that I can reuse the same struct as for the master_serial. Keeping the external interface.

I now realize I have to provide both read and write pointers to mbc_tcp_slave extending the mb_register_area_descriptor_t , but I think I can still keep the external interface, well we see :-)

dkaufmann
Posts: 24
Joined: Wed May 17, 2017 9:06 am

Re: Modbus TCP Implementation

Postby dkaufmann » Thu Oct 29, 2020 9:08 am

Okay interesting.
Did you find any possibility or work around to make several address areas of holding registers for a Modbus TCP slave?
HREG area 1: 0-100
HREG area 2: 1000-1100
HREG area 3: 2000-2100
...

jas39_
Posts: 21
Joined: Mon Aug 29, 2016 8:26 pm

Re: Modbus TCP Implementation

Postby jas39_ » Thu Oct 29, 2020 7:23 pm

I had to extend the current implementation of mbc_serial_slave.c and mbc_tcp_slave.c by using a linked list of memory areas. It's a hack for now.

ESP_alisitsyn
Posts: 211
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: Modbus TCP Implementation

Postby ESP_alisitsyn » Wed Nov 04, 2020 11:15 am

@jas39_, @dkaufmann,

If you are still interested in this feature (definition of several register areas for modbus slave), the feature will be completed soon but I need to perform testing. Before the official merge I would like you to test the patch for official code. Could you test it?

Thanks.

dkaufmann
Posts: 24
Joined: Wed May 17, 2017 9:06 am

Re: Modbus TCP Implementation

Postby dkaufmann » Wed Nov 04, 2020 1:31 pm

Hello, yes I am still interested and I would also test it. It might takes some time because at the moment my project works with esp-idf 4.0 so I need to change some things first to be compatible with esp-idf v4.3.
thanks for your update and let me know how I can test it.

Who is online

Users browsing this forum: KMTsvetanov, snutw_ and 106 guests