RETURN
ENDIF

Hello Friend...

A couple of things I saw that could give you problems...


Your ifs and END ifs... Some of your Ifs do NOT have a end if. I can't tell if you are only wanting to a *if* on just one line of code, or 5 lines...., but just below these missing end ifs, you *do* have a endif.


Then more importantly , 1/2 down your routine, you have the following:

RETURN
ENDIF


This means the return will NOT be excuted (to return to where your gosub was), *UNLESS* the if statement is true.

ENDIF should ALLLWAYs be before the return!




Here is a routine....I am not sure what you want to do with:

IF COMMAND(0)="T" THEN

LOW TEMP1 'initialize DS18S20
PAUSEUS 500 'wait for return pulse
TRISB.7=1 'set pin as input to get temp reading
PAUSEUS 100

IF TEMP1=1 THEN
DS18S20F=999 'VB error code signaling no sensor connected
HSEROUT ["T", DEC (DS18S20F),"X"]
RETURN
ENDIF


1. See that ENDIF after the return??? that is a killer!
2. When does your first IF statement end??? should it really be the following???? (

IF COMMAND(0)="T" THEN

LOW TEMP1 'initialize DS18S20
PAUSEUS 500 'wait for return pulse
TRISB.7=1 'set pin as input to get temp reading
PAUSEUS 100
ENDIF

IF TEMP1=1 THEN
DS18S20F=999 'VB error code signaling no sensor connected
HSEROUT ["T", DEC (DS18S20F),"X"]
ENDIF
RETURN


I see this in all your routines...


Dwayne