I use the below code to allow a leak test device to print data into strings to evaluate.
The device will send several lines, but the PLC will shut down the port after recieving the first line.
is there a way to keep the port open and recieve all the data?
This is the code used below:
G$=""
J$=""
G=0
H=0
while G=0 and H<20
PRINT #4 "<TCPCONNECT 192.168.100.004:10001>"
J$=""
DELAY 200
if status(3)=1 then
I=0
while G=0 and I<=20
delay 200
J$=INPUT$(4)
if len(J$)>0 then
G=1
G$=J$
endif
I=I+1
endwhile
ENDIF
PRINT #4 "</>" ' close connection before reconnecting
H=H+1
'
IF G=0 THEN
DELAY 500
ENDIF
endwhile