User guide

- 54 -
A sample program demonstrating the above principles is contained in the following listing. Please
note that this is an example only and does not include advanced programming techniques or error
trapping.
1000
‘+——————————————————————————+‘+——————————————————————————+
‘+——————————————————————————+‘+——————————————————————————+
‘+——————————————————————————+
1005
‘|‘|
‘|‘|
‘|
DV-III External Mode Command Protocol Demonstration |DV-III External Mode Command Protocol Demonstration |
DV-III External Mode Command Protocol Demonstration |DV-III External Mode Command Protocol Demonstration |
DV-III External Mode Command Protocol Demonstration |
1010
‘|‘|
‘|‘|
‘|
Copyright 1991, Brookfield Engineering Labs |Copyright 1991, Brookfield Engineering Labs |
Copyright 1991, Brookfield Engineering Labs |Copyright 1991, Brookfield Engineering Labs |
Copyright 1991, Brookfield Engineering Labs |
1015
‘|‘|
‘|‘|
‘|
Written by Greg Krysko |Written by Greg Krysko |
Written by Greg Krysko |Written by Greg Krysko |
Written by Greg Krysko |
1020
‘+——————————————————————————+‘+——————————————————————————+
‘+——————————————————————————+‘+——————————————————————————+
‘+——————————————————————————+
1025 ‘
1030
CLSCLS
CLSCLS
CLS
1035
PRINT SPCPRINT SPC
PRINT SPCPRINT SPC
PRINT SPC(26) “Brookfield Engineering Labs”
1040
PRINT SPCPRINT SPC
PRINT SPCPRINT SPC
PRINT SPC(20) “DV-III External Mode Demonstration Program”
1045
PRINT SPCPRINT SPC
PRINT SPCPRINT SPC
PRINT SPC(32) “Copyright 1991”
1050
PRINTPRINT
PRINTPRINT
PRINT
1055
PRINTPRINT
PRINTPRINT
PRINT “This program is intended to demonstrate the use of the RS-232 command “
1060
PRINTPRINT
PRINTPRINT
PRINT “set employed by the Brookfield Engineering Labs Model DV-III Rheometer “
1065
PRINTPRINT
PRINTPRINT
PRINT “in its External mode. This program and/or any of the commands used “
1070
PRINTPRINT
PRINTPRINT
PRINT “within may be freely used in your own applications.”
1075
PRINTPRINT
PRINTPRINT
PRINT
1080
PRINTPRINT
PRINTPRINT
PRINT “Press any key to continue...”
1085
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1490 ‘ Wait for a keypress
1090
CLSCLS
CLSCLS
CLS
1095
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1655 ‘ Initialize variables
1100
OPEN OPEN
OPEN OPEN
OPEN “COM1:9600,N,8,1,CS,DS,CD”
ASAS
ASAS
A S #1 ‘ Open com port #1
1105
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1695 ‘ Reset the DV-III
1110
PRINTPRINT
PRINTPRINT
PRINT “Please remove the spindle and press any key to begin the Auto-Zero process.”
1115
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1490 ‘ Wait for a keypress
1120
PRINTPRINT
PRINTPRINT
PRINT “Auto-Zeroing...”
1125
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1760 ‘ Send the zero command
1130
BEEPBEEP
BEEPBEEP
BEEP
1135
PRINTPRINT
PRINTPRINT
PRINT “Auto-Zero complete. Replace spindle then press any key to continue.”
1140
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1490 ‘ Wait for a keypress
1145
CLSCLS
CLSCLS
CLS
1150
PRINTPRINT
PRINTPRINT
PRINT “Enter model multiplier (See Table A.2 of Appendix A in the DV-III manual) “
1155
INPUTINPUT
INPUTINPUT
INPUT “Ex: A model LV rheometer has a multiplier of 0.09373 “;MODMULT
1160
PRINTPRINT
PRINTPRINT
PRINT “Enter the spindle SMC (See Table A.1 of Appendix A in the DV-III manual) “
1165
INPUTINPUT
INPUTINPUT
INPUT “Ex: An SC4-31 spindle has an SMC of 32 “;SMC
1170
PRINTPRINT
PRINTPRINT
PRINT “Enter the spindle SRC (See Table A.1 of Appendix A in the DV-III manual) “
1175
INPUTINPUT
INPUTINPUT
INPUT “Ex: An SC4-31 spindle has an SRC of 0.34 “;SRC
1180
PRINTPRINT
PRINTPRINT
PRINT
1185
PRINTPRINT
PRINTPRINT
PRINT “The DV-III will begin running at 10 RPM and will increment”
1190
PRINTPRINT
PRINTPRINT
PRINT “its speed by 10 RPM every 10 seconds. At the end of each”
1195
PRINTPRINT
PRINTPRINT
PRINT “10 second interval, a data point will be taken and displayed”
1200
PRINTPRINT
PRINTPRINT
PRINT “on the screen. This will continue until a data point is taken”
1205
PRINTPRINT
PRINTPRINT
PRINT “at 150 RPM at which point the DV-III will return to 0 RPM.”
1210
PRINTPRINT
PRINTPRINT
PRINT
1215
PRINTPRINT
PRINTPRINT
PRINT “Press any key to continue...”
1220
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1490 ‘ Wait for a keypress
1225
CLSCLS
CLSCLS
CLS
1230
PRINT SPCPRINT SPC
PRINT SPCPRINT SPC
PRINT SPC(31) “Sample DV-III Data”
1235
PRINT SPCPRINT SPC
PRINT SPCPRINT SPC
PRINT SPC(31) “—————————”
1240
PRINTPRINT
PRINTPRINT
PRINT
1245
WHILEWHILE
WHILEWHILE
WHILE RPM <= 150 ‘ Repeat until RPM > 150
1250
GOSUBGOSUB
GOSUBGOSUB
GOSUB 1595 ‘ Convert RPM value to a 4 digit hex string
1255
PRINTPRINT
PRINTPRINT
PRINT “RPM=”;
1260
PRINT USINGPRINT USING
PRINT USINGPRINT USING
PRINT USING “###.#”;RPM; ‘ Print RPM