On a the Weintek MT8071ip I can correctly read the data sent from an external TCP client using this macro combined with timing execution :
macro_command main()
char wResponse[20] = ""
short receive_len = 0
short wait_time = 1
//FILL(wResponse[0],0,receive_len)
TRACE("receive_len (A) = %d", receive_len) // Easy diagnoser: ritorna 0, ed è giusto
INPORT(wResponse[0], "Free Protocol Server (Ethernet)", receive_len, wait_time)
TRACE(" receive_len (B) = %d", receive_len) // ritorna sempre 0, anche se sono arrivati dei dati
if receive_len >= 4 then
SetData(wResponse[0], "Local HMI", LW, 0 , 20)
TRACE(" receive_len3 = %d", receive_len) // qui non arriverà mai, se receive_lan non cambia valore
end if
end macro_command
Every 5 second this run, but seems that always trigger the SetData(… even if there’s no data at all.
If data are received these would disappear on next execution.
Is there a way to enable a script debugger to check what happen inside the macro?