
Originally Posted by
eetech
...
Code:
IF (OhmCheck = FAILED) or _ ' resistor out of tolerance or
(FlagResult <> 0) then ' hardware flag
GOSUB Houston
ENDIF
Try this for the one above:
Code:
IF ErrCnt > 1 or FlagResult > 0 THEN GOSUB Houston
-------------------------------------------------

Originally Posted by
eetech
...
Replace it with this one and it does not work:
Code:
IF OhmCheck = FAILED THEN
ErrCnt = ErrCnt + 1
IF ErrCnt = 1 then 'first time gets a pass for a recheck
Device = DISPLAY
GOSUB SetCtrl
LCDOUT $FE,1,"Chk Dckbill conn"
LCDOUT $FE,$C0,"then retry test"
PAUSE 1000
ENDIF
ENDIF
IF (ErrCnt > 1) or (FlagResult <> 0) THEN
GOSUB Houston
ENDIF
And try this for the one above:
Code:
IF OhmCheck = FAILED or FlagResult > 0 then GOSUB Houston
And try this separately:
Code:
IF OhmCheck = FAILED THEN
ErrCnt = ErrCnt + 1
IF ErrCnt = 1 then 'first time gets a pass for a recheck
Device = DISPLAY
GOSUB SetCtrl
LCDOUT $FE,1,"Chk Dckbill conn"
LCDOUT $FE,$C0,"then retry test"
PAUSE 1000
else
gosub Houston
endif
ENDIF
IF FlagResult > 0 THEN GOSUB Houston
Question: Do you set ErrCnt = 0 before the program starts running, or it gets some values from somewhere else?
In your code, it seems that it must be set to zero at initial power up before coming to "IF OhmCheck = FAILED THEN" condition.
Question: FlagResult is a hardware flag. So it can be 1 or 0 only, right? If yes, then why not use IF FlagResult = 1 instead of FlagResult <> 0 ?
Also, as Jerson said, we should see Houston subroutine.
May be there is something in it that makes things messed up.
--------------------------------
Bookmarks