Page 2 of 4

Re: Modbus TCP Implementation

Posted: Fri Aug 28, 2020 8:51 am
by dkaufmann
Hello,
okay thank you very much for your reply, very appreciated.
I am looking forward for the new version then.
best regards
DK

Re: Modbus TCP Implementation

Posted: Sun Oct 18, 2020 6:37 pm
by jas39_
@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

Re: Modbus TCP Implementation

Posted: Mon Oct 26, 2020 12:49 pm
by ESP_alisitsyn
@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.

Re: Modbus TCP Implementation

Posted: Tue Oct 27, 2020 10:31 am
by deolsunny533
Could you tell me little bit more about your application? Is this Modbus master TCP or slave?

Re: Modbus TCP Implementation

Posted: Wed Oct 28, 2020 8:09 am
by dkaufmann
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.

Re: Modbus TCP Implementation

Posted: Wed Oct 28, 2020 7:34 pm
by jas39_
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 :-)

Re: Modbus TCP Implementation

Posted: Thu Oct 29, 2020 9:08 am
by dkaufmann
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
...

Re: Modbus TCP Implementation

Posted: Thu Oct 29, 2020 7:23 pm
by jas39_
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.

Re: Modbus TCP Implementation

Posted: Wed Nov 04, 2020 11:15 am
by ESP_alisitsyn
@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.

Re: Modbus TCP Implementation

Posted: Wed Nov 04, 2020 1:31 pm
by dkaufmann
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.