Skip to main content

10.4.7.3. Example

10.4.7.3. Example

 

This is the task program to request for task file to the remote PC and to receive the result.

 

 

_TEINPUT=0 'INPUT Ending character

'

'Ethernet setting -----------

ENET1.IP="192.168.1.172"

ENET1.LPORT=500

ENET1.RPORT=7000

ENET1.OPEN 1

CLR_RBUF ENET1

'

'Request for file transmission

PRINT ENET1,"LDFILE ";V200%; ‘V200% is the task number to request

 

'Standby for result response

INPUT ENET1,V20$,8,*NO_RESP

ENET1.OPEN 0

 

'Result interpretation

V21$=LEFT$(V20$,11)

IF V21$<>"LDFILE RES=" THEN *INV_RES

V21$=MID$(V20$,12,4)

V201%=VAL(V21$) 'Return value’

IF V201%<0 THEN *ERR_RES

'

'Call sub robot task

CALL V200%

END

'

'Exception processing -----------

*NO_RESP

PRINT #0,"There is no response for LDFILE request."

END

*INV_RES

PRINT #0,"LDFILE response is not valid."

END

*ERR_RES

PRINT #0,"LDFILE response error code =";V201%

END