I think this should do it.
Set ADchan before GOSUBing ...
Code:
Result       VAR WORD

GetSetpoint:
    GOSUB GetADC
    Result  = ADvalue*(MaxSetPoint - MinSetPoint)
    Result  = (DIV32 ADmax) + MinSetPoint
    Setpoints(ADchan) = Result
RETURN
hth,