11 - 159 11 - 159
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
400 ZRECEIVE #CH%,0,TBL2%( ),CTBL%( )
:
' Executes the reception operation
410 LOCATE 0,15
420 PRINT "RECEIVE CHARACTER =";TBL2%(1)
:
' Displays the number of received
characters
430 FOR I%=0 TO WOR%-1
440 LOCATE 0,16+I%
450 PRINT "RECEIVE DATA =&H";HEX$(CTBL%(I%))
: ' Displays the data received
460 NEXT I%
470 RETURN 310
480 '
490 '***** ERROR ROUTINE *****
500 ERTYPE%=ERR:ERLINE%=ERL
:
' Stores the error occurred, and the line
510 IF ERTYPE%=17 THEN PRINT "ZOPEN ERROR!!"
:
' Notifies if it is a Z-related error
520 PRINT "ERROR CODE =";ERTYPE%
:
' Displays the error code
530 PRINT "ERROR LINE =";ERLINE%
:
' Displays the line where the error occurred
540 RESUME 310
:
' Returns the operation to line 310