k64f120m project with mqx4.1 of TCP/IP stack

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

k64f120m project with mqx4.1 of TCP/IP stack

1,105 Views
wulinweng
Contributor II

Dear Support:
our project used the mqx4.1 with tcp/ip stack, and the function modbus tcp is available. but now we encountered a question is that when the maximum multilink connection number is 4, and when the modbus tcp clients become 5 to connect to our Module(modbus server with mqx4.1 of tcp/ip stack) at the same time. the connections sometime is not good and stable.

My question is that is there any constraint about the tcp connection numbers?

Thanks & BR,

Mike

0 Kudos
3 Replies

681 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Mike,

there are 2 limitations:

1) The number of sockets available.

2) The RAM available to create these sockets.

You can configure the parameters that RTCS uses for connections. You con modify the following variables before calling RTCS_create().

/* runtime RTCS configuration */
_
RTCSPCB_init = 4;
_
RTCSPCB_grow = 2;
_
RTCSPCB_max = 20;
_
RTCS_msgpool_init = 4;
_
RTCS_msgpool_grow = 2;
_
RTCS_msgpool_max = 20;
_
RTCS_socket_part_init = 4;
_
RTCS_socket_part_grow = 2;
_
RTCS_socket_part_max = 20;

In this case you can see that _RTCS_socket_part_init = 4; you may modify such variable to increase the number of your sockets. However, for every connection you may use also a PCB.

You must also check in the Task Aware Debugger(TAD) the Task Summary, Stack usage and socket summary because you could be getting out of RAM. If this is the case you can increase the task stack that requires more RAM.

If your problem persists please attach some screenshots of the TAD views.


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

681 Views
wulinweng
Contributor II

Dear Carlos,

Please find the upper pic for the modbus tcp connection test.

According to your instruction from the email below: I have changed the source code below:

RTCSPCBinit = 16; //Default value: 4

RTCSPCBgrow = 8; //Default value: 2

RTCSPCBmax = 64; //Default value: 20

RTCSmsgpool_init = 64; //Default value: 4

RTCSmsgpool_grow = 32; //Default value: 2

RTCSmsgpool_max = 320; //Default value: 20

RTCSsocket_part_init = 12; //Default value: 4

RTCSsocket_part_grow = 8; //Default value: 2

RTCSsocket_part_max = 160; //Default value: 20

RTCSTASKstacksize = 10000; //Default value: 10000

And also I have checked the stack usage for the project, it is ok for the Modbus TCP task.

The test result is that I can’t connect the fifth client connection to the server (our equipment, ip is 192.168.1.28)

So can you provide some information for the test?

BR,

Mike-WuLin Weng

ABB Xiamen Low Voltage Equipment Company Limited

No.12-20, 3rd Chuang Xin Road Xiamen SEZ, Fujian 361006 P.R.China

Phone: +86 592 5767829

Mobile: +86 181 5089 0831

email: mike-wulin.weng@cn.abb.com<mailto:mike-wulin.weng@cn.abb.com>

0 Kudos

681 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Mike,

Please use following settings, make sure you set them before calling RTCS_create().

/* runtime RTCS configuration */
_
RTCSPCB_init = 6;
_
RTCSPCB_grow = 2;
_
RTCSPCB_max = 20;
_
RTCS_msgpool_init = 6;
_
RTCS_msgpool_grow = 2;
_
RTCS_msgpool_max = 20;
_
RTCS_socket_part_init = 12;
_
RTCS_socket_part_grow = 4;
_
RTCS_socket_part_max = 40;

RTCS_create();

Then, when the 5th link is not able to be created please take screen captures of following windows and attach them.

Menu MQX > Task Summary

Menu MQX > Stack Usage

Menu  RTCS > Socket Summary

Regards,

Carlos

0 Kudos