Print
Listing index
Read
Routine:        Range   
Function:       Finds minimum and maximum motor speeds that are suitable for the set of measurements
Called by:      Visc
Calls:          Chk1, Chk2, Chk3, Divide, Intfp, Sub
Entry:          None
Exit:           Mtrmin, Mtrmax set; C flag is set on error
Preserved:      None


RANGE   CALL    CHK1
; Find the maximum motor speed, angle < 170 degrees; return on error.
        RET     C
        CALL    CHK2
; Find minimum motor speed, angle >0.
        CALL    CHK3
; Check max speed is more than min speed, return on error.
        RET     C
        LD      A,(MTRMIN)
        LD      L,0
        LD      H,0
        LD      IX,RNGMAX
; Convert max speed to floating point.
        CALL    INTFP
        LD      A,(MTRMAX)
        LD      L,0
        LD      H,A
        LD      IX,RNGMIN
; Convert min speed to floating point.
        CALL    INTFP
        LD      BC,RNGMAX
        LD      DE,RNGMIN
        LD      HL,RNG
; Calculate range.
        CALL    SUB
        LD      BC,RNG
        LD      DE,TEN
        LD      HL,RNGINC
; Calculate motor speed increment.
        CALL    DIVIDE
        OR      A
        RET

 
Print
Listing index
Read