Freeze the communication after 30 minutes
Hello
In my apliacation, I will make a scan to several pcb boards through serial communication. For test purpose, i have only one pcb connect to the PC trough a USBtoRS232 converter, later, it must work as a wireless network. On the boards scan procedur, the PC application send data to ask the boards one after another, if they have new data to store on the PC aplicattion. Everytime the asked PCBboard have no data, after a timeout on the PC applications, the programm on the PC ask the next pcb board, and so on...It works about 15...30 Minutes perfectly, after that period, in one of the scan phases, the pcb board that have new data, try to send and freeze the communication, the program on the PC doesn't receive the data anymore. I have to unplug the USBtoRS232 converter and plug again and restart the PC application. Have somebody an idea how to solve this problem. Due this application have to work continually and autonomous, nobody won't exist to unplug and plug the USBtoRS232 again restart the PC application.
Thanks
Best regards
Pedro
''Here part of code that freeze the communication after 30 minutes with 18F4520
Code:
engine = 2
scanboards:
SERIN2 rx_,bmode,500,final,[wait ("P"),dec2 function,dec3 board, dec3 dumy] ''receive the comando what to do
'
' ******************* PC ask the if have new data, the flag reg_complet have this information *******************
if (function = 30) and (engine = board) and (reg_complet = 1) then
''read the data from the 18F4520 eeprom
read 10,tmp0
read 11,tmp1
read 12,tmp2
read 13,tmp3
read 14,tmp4
read 15,tmp5
read 16,tmp6
read 17,tmp7
read 18,tmp8
read 19,tmp9
read 20,tmp10
read 21,tmp11
read 22,tmp12
read 23,tmp13
read 24,tmp14
read 25,tmp15
read 26,tecnico1
read 27,tecnico0
'
''send the new data to the PC
serout2 tx_,bmode,["dumi",";",hex2 tmp0,";",hex2 tmp1,";",hex2 tmp2,_
";",hex2 tmp3,";",hex2 tmp4,";",hex2 tmp5,_
";",hex2 tmp6,";",hex2 tmp7,";",hex2 tmp8,_
";",hex2 tmp9,";",hex2 tmp10,";",hex2 tmp11,_
";",dec3 tmp12,";",dec3 tmp13,";",dec3 tmp14,_
";",hex2 tmp15,";",hex4 tecnico,13,10]
serout2 tx_,bmode,["y",13,10] ''end of data
'
SERIN2 rx_,bmode,5000,final,[wait ("OK"),dec3 board] ''wait during 5 seg a confirmation from the PC application that have received the new data
if board = engine then
reg_completo = 0 ''data received, clear the flag that have no more new data to send
write 4, reg_complet ''save the flag for posterior test
endif
endif
final:
return