beautypg.com

Brookfield DV-II+ Digital Viscometer User Manual

Page 43

background image

- 43 -

550

+

+

560

| Print the parsed Viscometer data string |

570

+

+

580

LOCATE 4, 1

590

PRINT “Here is Viscometer data parsed into its constituent parts”

600

LOCATE 5, 10: PRINT “RPM = “; RPM$

610

LOCATE 6, 10: PRINT “MODEL = “; MDL$

620

LOCATE 7, 10: PRINT “SPINDLE = “; SPD$; “”

630

LOCATE 8, 10: PRINT “TORQUE % = “; TOR$

640

LOCATE 9, 10: PRINT “VISCOSITY cP = “; CPS$

650

LOCATE 10, 10:PRINT “SS Dynes/cm^2 = “; SHS$

660

LOCATE 11, 10:PRINT “SR 1/Sec = “; SHR$

670

LOCATE 12, 10:PRINT “TEMPERATURE = “; TMP$

680

DS$ = “”

‘ NULL OUT DS$

690

LOCATE 13, 1

700

PRINT “Press key to end program”

710

IF KEYPRESSED$ <> ESC$ THEN KEYPRESSED$ = INKEY$

720

WEND

730

CLOSE #1

‘ Close serial port

740

CLS

‘ Clear the screen

750

LOCATE 12, 32

760

PRINT “PROGRAM STOPPED”

770

END

780

+

+

790

| Routine to get input from com port |

800

+

+

810

DS$ = “”

820

WHILE (RIGHT$(DS$, 1) <> LF$) AND (KEYPRESSED$ <> ESC$) ‘ Wait for a LF 580

‘ If data in inputbuffer, retrieve it

830

IF LOC(1) > 0 THEN DS$ = DS$ + INPUT$(LOC(1), #1)

840

KEYPRESSED$ = INKEY$

850

WEND

860

RETURN

Running this program from within GWBASIC© produces output as shown below.

Here is DV-II+ Viscometer raw output data string

RPM=50 MD=RV SPDL=29 %=41.4 cP=8280 D/CM2=1035 1/SEC=12.5 T=25.5C

Here is Viscometer data parsed into its constituent parts

RPM = 50

MODEL = RV

SPINDLE = 29

TORQUE % = 41.4

VISCOSITY cP = 8280

SS Dynes/cm^2 = 1035

SR 1/Sec = 12.5

TEMPERATURE = 25.5C

Press key to end program