that's interesting, how about if you just change to
Code:
if compvalue > (vin + 1) then 
    serout porta.5,6,[#vin,10,13]
    endif
Or having anoher Var like

Code:
TestVar=vin+1
if compvalue > TestVar then 
    serout porta.5,6,[#vin,10,13]
    endif