User guide

- 56 -
1550
WHILEWHILE
WHILEWHILE
WHILE (T2 - T1) < TINTERVAL ‘ Loop until time elapsed = Tinterval
1555 T2 =
TIMERTIMER
TIMERTIMER
TIMER
1560
WENDWEND
WENDWEND
WEND
1565
RETURNRETURN
RETURNRETURN
RETURN
1570 ‘
1575 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1580 ‘
||
||
|
Routine to convert a decimal speed to a four digit |Routine to convert a decimal speed to a four digit |
Routine to convert a decimal speed to a four digit |Routine to convert a decimal speed to a four digit |
Routine to convert a decimal speed to a four digit |
1585 ‘
||
||
|
hexadecimal string that the DV-III understands. |hexadecimal string that the DV-III understands. |
hexadecimal string that the DV-III understands. |hexadecimal string that the DV-III understands. |
hexadecimal string that the DV-III understands. |
1590 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1595 TEMPRPM = RPM * 10 ‘ Multiply the speed by 10
1600 HEXRPM$ =
HEX$HEX$
HEX$HEX$
H E X $(TEMPRPM) ‘ Convert to hexadecimal
1605 ISFOUR = 4 -
LENLEN
LENLEN
L E N(HEXRPM$) ‘ Pad the string with leading
1610
WHILEWHILE
WHILEWHILE
WHILE ISFOUR > 0 ‘ 0’s until its length is 4
1615 HEXRPM$ = “0” + HEXRPM$
1620 ISFOUR = ISFOUR - 1
1625
WENDWEND
WENDWEND
WEND
1630
RETURNRETURN
RETURNRETURN
RETURN
1635 ‘
1640 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1645 ‘
||
||
|
Initialize variables and constants Initialize variables and constants
Initialize variables and constants Initialize variables and constants
Initialize variables and constants
||
||
|
1650 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1655 CR$ =
CHR$CHR$
CHR$CHR$
C H R $(13)
1660 RPM = 10
1665 TINTERVAL = 10
1670
RETURNRETURN
RETURNRETURN
RETURN
1675 ‘
1680 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1685 ‘
||
||
|
DV-III Reset Procedure |DV-III Reset Procedure |
DV-III Reset Procedure |DV-III Reset Procedure |
DV-III Reset Procedure |
1690 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1695 RESP$ = “”
1700
WHILEWHILE
WHILEWHILE
WHILE
LEFT$LEFT$
LEFT$LEFT$
LEFT$(RESP$,1) <> “E” ‘ Check for a valid reset
1705 DV3COMMAND$ = “K” ‘ K command (reset DV-III)
1710
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1815 ‘ Send the command
1715 DV3COMMAND$ = “E ‘ E command (enable the DV-III)
1720
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1815 ‘ Send the command
1725
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1870 ‘ Wait for the DV-III to respond
1730
WENDWEND
WENDWEND
WEND
1735
RETURNRETURN
RETURNRETURN
RETURN
1740 ‘
1745 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1750 ‘
||
||
|
Routine to auto-zero the DV-IIRoutine to auto-zero the DV-II
Routine to auto-zero the DV-IIRoutine to auto-zero the DV-II
Routine to auto-zero the DV-III
||
||
|
1755 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1760 DV3COMMAND$ = “Z” ‘ Z command (zero the DV-III)
1765
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1815 ‘ Send the command
1770
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1870 ‘ Wait for the DV-III to repsond
1775 HEXRESP$ =
MID$MID$
MID$MID$
M I D $(RESP$,2,4) ‘ Parse out characters 2-5 from the response
1780
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1990 ‘ Convert this 4 digit hex string to decimal
1785 ZEROOFFSET = DECIMALNUM ‘ This is the zero offset
1790
RETURNRETURN
RETURNRETURN
RETURN
1795 ‘
1800 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1805 ‘
| Routine to send commands to the DV-III || Routine to send commands to the DV-III |
| Routine to send commands to the DV-III || Routine to send commands to the DV-III |
| Routine to send commands to the DV-III |
1810 ‘
+——————————————————————————++——————————————————————————+
+——————————————————————————++——————————————————————————+
+——————————————————————————+
1815
GOSUBGOSUB
GOSUBGOSUB
GOSUB 2035
1820 DV3COMMAND$ = DV3COMMAND$ + CR$ ‘ Append a carriage return to command
1825
FORFOR
FORFOR
F O R CMD = 1
TOTO
TOTO
TO
LENLEN
LENLEN
L E N(DV3COMMAND$)
1830
PRINTPRINT
PRINTPRINT
PRINT #1,
MID$MID$
MID$MID$
M I D $(DV3COMMAND$,CMD,1); ‘ Send one character at a time