beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 69

background image

MVI56-BAS ♦ ControlLogix Platform

Using the Program Port (PRT1)

BASIC Module (DB/BAS Compatible)

User Manual

ProSoft Technology, Inc.

Page 69 of 234

December 13, 2011

After the error code value has been retrieved, it can be cleared using the

CLRERR

command; this allows debugging to continue. The following code shows how to
use the

CLRERR

command:

10 ONERR 100
20 LET =5
30 PRINT "THIS IS LINE 1"
40 PRINT "THIS IS LINE 2"
50 PRINT "THIS IS LINE 3"
100 E = ERRCODE
200 PRINT "ERROR CODE WAS ", E
300 CLRERR
400 PRINT "ERROR CODE NOW IS ", ERRCODE
Ready
>run
ERROR CODE WAS 16
ERROR CODE NOW IS 0