![background image](http://html1.mh-extra.com/html/omron/r88a-mcw151-drt-e/r88a-mcw151-drt-e_operation-manual_742243268.webp)
253
Programming Examples
Appendix C
' to VR memory (address 0). The PC has Host Link slave node 13.
HLM_READ(2,13,PLC_IR,2,2,MC_VR,0)
GOSUB check_status
PRINT VR(0)[0],VR(1)[0]
STOP
check_status:
VR(250)=HLM_STATUS PORT(2)
IF VR(250)=0 THEN
PRINT "Succeeded"
RETURN
ELSE
PRINT "Failure (";attempt[0];"): ";
IF READ_BIT(9,250) THEN
PRINT "Command not recognized by slave"
ELSE
IF READ_BIT(8,250) THEN
PRINT "Timeout error"
ELSE
PRINT "Received end code: ",HEX(VR(250))
ENDIF
ENDIF
IF attempt=3 THEN
PRINT "Read failed after 3 attempts"
STOP
ENDIF
attempt=1
GOTO loop
ENDIF