Brookfield CAP2000 Viscometer User Manual
Page 34
Brookfield Engineering Labs., Inc.
Page 34
Manual No. M/94-310F
1430 ‘
1435 ‘
1440 ‘ Routine used to insert a delay (approximately 50 milliseconds)
1445 ‘ between each character sent to the CAP 2000.
1450 ‘
1455 FOR DLY = 1 TO 50
1460 NEXT DLY
1465 RETURN
1470 ‘
1475 ‘
1480 ‘ Routine that waits for a keystroke
1485 ‘
1490 KEYSTROKE$ = “”
1495 WHILE KEYSTROKE$ = “”
1500 KEYSTROKE$ = INKEY$
1505 WEND
1510 RETURN
1515 ‘
1520 ‘
1525 ‘ Routine to count elapsed seconds. It is used to count the time
1530 ‘ interval between each data point taken.
1535 ‘
1540 T1 = TIMER ‘ Gets seconds since
‘ midnight
1545 T2 = T1
1550 WHILE (T2 - T1) < TINTERVAL ‘ Loop until time elapsed =
‘ Tinterval
1555 T2 = TIMER
1560 WEND
1565 RETURN
1570 ‘
1575 ‘
1580 ‘ Routine to convert a decimal value to a hexadecimal string that the
‘CAP 2000 understands
1590 ‘
1595 ‘
1600 HEXVALUE$ = HEX$(CAPVALUE) ‘ Convert to hexadecimal
1605 ISLENOK = CMDLEN - LEN(HEXVALUE$) ‘ Pad the string with
‘ leading
1610 WHILE ISLENOK > 0 ‘ 0’s until its length is
‘ CMDLEN
1615 HEXVALUE$ = “0” + HEXVALUE$
1620 ISLENOK = ISLENOK - 1
1625 WEND
1630 RETURN
1635 ‘
1640 ‘
1645 ‘ Initialize variables and constants
1650 ‘
1655 CR$ = CHR$(13)
1660 RPM = 100
1665 TEMPERATURE = 0