I developed a CR6 application that makes the logger a listening server for max 15 clients. I use the TCPOpen() function in a slowsequence outside the do/loop:
Slowsequence
TCPOpen("",1234,100,1000,handle(),15)
do
for i = 1 to 15
if handle(i)> 100 then
'///// processing task...
endif
next
loop
endsequence
The program runs correctly, but sometimes shows some watchdog as this (important: now there are only 4 clients):
CR6.Std.06.03 26 6 2017 17:20:26
Watchdog timer IpTask triggered.
Slot Task Name Pri Status
14 TableFile 200 waiting at mailbox 28, PC-> FFE45492
3 PushButton 200 waiting at mailbox 26, PC-> FFE95D07
8 CommTask 200 waiting at mailbox 23, PC-> FFE65BD5
7 CommTask 200 waiting at mailbox 14, PC-> FFE65BC4
6 CommTask 200 waiting at mailbox 13, PC-> FFE65BD5
4 Terminal 200 waiting at mailbox 10, PC-> FFE4EAA6
9 PakBusServer 200 waiting at mailbox 2, PC-> FFE65DE9
5 PakBusMain 200 waiting at mailbox 1 [Timeout=19943], PC-> FFE684EA
18 SlowProcX 200 waiting for resource 38, owner=12, PC-> FFEC9F34
11 Display 200 waiting for event 45 set, PC-> FFE7290D
10 VoiceTask 200 waiting for event 43 set, PC-> FFE4CD09
17 SlowProcX 200 waiting for event 26 set, PC-> FFE53C35
16 RunDld 200 waiting for event 16 set [Timeout=8512], PC-> FFE53A3E
13 IpServerTask 200 waiting for event 13 set, PC-> FFEC723A
15 SlowMeas 253 waiting for event 1 set, PC-> FFE787AB
19 SlowProcX 200 delayed 33697 ticks, PC-> FFE0EB4C
20 SlowProcX 216 delayed 756 ticks, PC-> FFE51CC8
12 IpTask 200 in run queue, PC(qproc)-> 63DB158 , PC-> FFEDD7DD
1 Watchdog 220 => in run queue, PC(qproc)-> 6035514
ChkMem results:
COLOR0: ok
fragments: 11, total_free: 65796
largest free: 16392, alloc blocks: 1539
COLOR1: ok
fragments: 2, total_free: 49992
largest free: 41808, alloc blocks: 19
COLOR2: ok
fragments: 1, total_free: 801104
largest free: 801104, alloc blocks: 11
Slot 1, Stack base 0001F7F8, pointer 0001FDD4, See current sp Min 664
Slot 3, Stack base 0001CBE8, pointer 0001D748, remaining 2912, Min 2812
Slot 4, Stack base 0001C3E0, pointer 0001C9F8, remaining 1560, Min 1560
Slot 5, Stack base 0001BBD8, pointer 0001C2F8, remaining 1824, Min 1224
Slot 6, Stack base 0001B3D0, pointer 0001BAF4, remaining 1828, Min 1672
Slot 7, Stack base 0001ABC8, pointer 0001B2EC, remaining 1828, Min 1548
Slot 8, Stack base 0001A3C0, pointer 0001AAE4, remaining 1828, Min 1560
Slot 9, Stack base 000197B8, pointer 0001A318, remaining 2912, Min 2240
Slot 10, Stack base 00018BB0, pointer 00019738, remaining 2952, Min 2920
Slot 11, Stack base 00017FA8, pointer 00018AC4, remaining 2844, Min 2724
Slot 12, Stack base 000173A0, pointer 00017D74, remaining 2516, Min 2068
Resources owned: 38
017d74: 063ded14 00003270 063db158 06030a38 063db098 0604d80c 00003274 00003270
02030001 ffeaf675 000038fa 063db158 06030a38 063db098 0604d80c 0604d808
ffec7c69 ffeafb90 00000000 000005b3 00000014 00000003 00000001 063ded14
06030a38 063db158 06030a38 063db098 0604d80c 0604d808 ffec7c69 0604d814
Slot 13, Stack base 00016798, pointer 000172DC, remaining 2884, Min 1964
Slot 14, Stack base 00015F90, pointer 000166EC, remaining 1884, Min 1132
Slot 15, Stack base 00015B88, pointer 00015E8C, remaining 772, Min 568
Slot 16, Stack base 00014F80, pointer 00015A6C, remaining 2796, Min 2260
Slot 17, Stack base 00014B78, pointer 00014ECC, remaining 852, Min 584
Slot 18, Stack base 00013F70, pointer 00014A6C, remaining 2812, Min 2264
Slot 19, Stack base 00013368, pointer 00013EB0, remaining 2888, Min 1172
Slot 20, Stack base 00012760, pointer 00013248, remaining 2792, Min 2588
CommsMemFree:
15(15),25(24),15(14),5(4)
306
101(97),16(16),35(28),25(19)
fileopen_writeIP mem pools total free min
RAW_PCB 4 4 3
UDP_PCB 10 6 6
TCP_PCB 105 101 97
TCP_PCB_LISTEN 20 15 14
TCP_SEG 105 103 96
PBUF_POOL 37 16 16
MALLOC_270 45 35 28
MALLOC_1584 25 25 19
When the socket is open the CR6 sends a query to each clients and receives a reply of max 50 bytes/client.
May be I must resize the Communication Allocation parameter? If yes, how do it?
Thanks in advance
There will be a new OS released shortly that should help with this issue (06.08). You can increase the communications memory by increasing the value in the Communication Allocation to be 70 or 100 instead of the default 50. That will help as well.
Thank you Gary. Actually I setted the Communication Allocation at 500, and CR6 doesn't permit any increase from this value. I hope the CSI will publish more detailed info on the meaning and use of Communication Allocation and CommsMemFree interpretation.
Thanks,