Home/Support/Support Forum/Multiple TCP Processes, Modbus & http
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Multiple TCP Processes, Modbus & http

0 votes
I am currently in the process of building a Modbus TCP Slave adapter.
Now my plan is to perform configuration and monitoring via a http interface.

Now my problem.

sock_init();
MODBUS_TCP_Init ( MY_MODBUS_ADDRESS, MY_MODBUS_PORT );
http_init();

in the above sequence http kills the modbus. the port is not even available to connect to.
The init Sequence does not change the result.
if i init http first then modbus i still loose the modbus.

I suspect its a problem of running 2 separate controls both requiring access to ETH.

Does anyone have any ideas ?
asked Sep 18, 2015 in Rabbit by robbudge New to the Community (1 point)

Please log in or register to answer this question.

2 Answers

+1 vote
Depending on your maximum memory (2 if less than 256K) MAX_TCP_BUFFERS will default to either 2 or 4 and HTTP_MAXSERVERS defaults to 2 so all the sockets could be used up before the Modbus tick gets to open them.

You will have to tune the number of available sockets and servers etc in your system.

Regards,
Peter
answered Sep 18, 2015 by petermcs Veteran of the Digi Community (1,128 points)
0 votes
Thanks,
After looking more closely at the separate pieces of code.
HTTP Max Servers was set to 2,
Max TCP Socket buffers was also set to 2.
So no sockets available for the modbus.
changed Max TCP Socket buffers to 5

All working,
Now on to the next problem.
answered Sep 18, 2015 by robbudge New to the Community (1 point)
...