beautypg.com

Acquiring hll data in binary format, Tempscan/1100, Acquiring hll data in binary format …… c-27 – Measurement Computing TempScan/1100 User Manual

Page 297

background image

TempScan / MultiScan, Appendix C

879696

Program Examples in Quick Basic C-27

Acquiring HLL Data in Binary Format

TempScan/1100

Example 15o. BIN_HLL.BAS Program

(1)

…… 15-CLS : PRINT “The TempScan/1100 is resetting...”

…… 15-PRINT #1, “OUTPUT 07;*RX”

(3)

…… 15-SLEEP 10

(4)

…… 15-S% = 0

…… 15-WHILE (S% AND 4) = 0

…… 15-PRINT #1, “SPOLL 07"
…… 15-INPUT #2, S%

(8)

…… 15-WEND

(9)

…… 15-PRINT #1, “OUTPUT 07;C1-32,1X”

(10)

…… 15-PRINT #1, “OUTPUT 07;C33-48,14X”

(11-29) …… 15-(For sample acquisition program lines, refer to the previous TempScan/1100 program example.)

(30)

…… 15-PRINT #1, “OUTPUT 07;F0,1X”

(31)

…… 15-CONST CHANNELS% = 48, BYTES = CHANNELS% * 20

DIM READS AS STRING * BYTES
S% = VARSEG(READS)
O% = VARPTR(READS)
WHILE INKEY$ = “”
PRINT #1, “OUTPUT 07;U4X”
PRINT #1, “ENTER 07 #”; CHANNELS%*20; “BUFFER ”;S%; “:”;O%; “ DMA”

(38)

…… 15-PRINT “High, Low and Last readings of all 48 channels :”

(39)

…… 15-FOR i = 1 TO BYTES STEP 20

…… 15- …… 15-HIGH$ = STR$(CVI(MID$(READS, i, 2)))

(41)

…… 15- …… 15-HOURh$ = STR$(ASC(MID$(READS, i + 2, 1)))

…… 15- …… 15-MINh$ = STR$(ASC(MID$(READS, i + 3, 1)))
…… 15- …… 15-SECh$ = STR$(ASC(MID$(READS, i + 4, 1)))
…… 15- …… 15-TENTHh$ = STR$(ASC(MID$(READS, i + 5, 1)))
…… 15- …… 15-MONh$ = STR$(ASC(MID$(READS, i + 6, 1)))
…… 15- …… 15-DAYh$ = STR$(ASC(MID$(READS, i + 7, 1)))
…… 15- …… 15-YEARh$ = STR$(ASC(MID$(READS, i + 8, 1)))

(48)

…… 15- …… 15-LOW$ = STR$(CVI(MID$(READS, i + 9, 2)))

(49)

…… 15- …… 15-HOURl$ = STR$(ASC(MID$(READS, i + 11, 1)))

…… 15- …… 15-MINl$ = STR$(ASC(MID$(READS, i + 12, 1)))
…… 15- …… 15-SECl$ = STR$(ASC(MID$(READS, i + 13, 1)))
…… 15- …… 15-TENTHl$ = STR$(ASC(MID$(READS, i + 14, 1)))
…… 15- …… 15-MONl$ = STR$(ASC(MID$(READS, i + 15, 1)))
…… 15- …… 15-DAYl$ = STR$(ASC(MID$(READS, i + 16, 1)))
…… 15- …… 15-YEARl$ = STR$(ASC(MID$(READS, i + 17, 1)))

(56)

…… 15- …… 15-LAST$ = STR$(CVI(MID$(READS, i + 18, 2)))

…… 15- …… 15-PRINT HIGH$+HOURh$+MINh$+SECh$+TENTHh$+MONh$+DAYh$+YEARh$
…… 15- …… 15-PRINT LOW$+HOURl$+MINl$+SECl$+TENTHl$+MONl$+DAYl$+YEARl$

(59)

…… 15-NEXT i

(60)

…… 15-BINARY DATA%/10 = °C

(61)

…… 15-BINARY DATA%/3276.7 = V (±10 V DC)

This manual is related to the following products: