Omega Vehicle Security 1400 User Manual

Page of 273
Appendix D
ChartScan Program Examples
ChartScan User’s Manual 
D-11
Collecting Binary-Formatted HLL Data using  BIN_HLL.BAS
The following program, BIN_HLL.BAS, in the EXAMPLES directory will set up the ChartScan to collect
High/Low/Last channel readings in a binary format rather than the default ASCII format.  This is inherently
faster than ASCII format, but the data must be deciphered after it is collected to yield temperature values.
This program configures the channels, uploads HLL data in High speed binary mode, decodes this data and
displays it on the screen.
Although not necessary, it is good practice to reset the ChartScan at the beginning of your application by
sending it the “*R” command and then waiting a few seconds.
'Establish communication with the DRIVER488
OPEN "\DEV\IEEEOUT" FOR OUTPUT AS #1
IOCTL #1, "BREAK"
PRINT #1, "RESET"
OPEN "\DEV\IEEEIN" FOR INPUT AS #2
PRINT #1, "TIMEOUT 5"
PRINT #1, "ERROR ON"
PRINT #1, "FILL ERROR"
PRINT #1, "TERM IN LF EOI"
'Program the ChartScan to power on with Factory default
PRINT #1, "CLEAR 07"
PRINT #1, "OUTPUT 07;*S1X"
'Reset ChartScan and make sure it is ready
CLS : PRINT "The ChartScan is resetting.."
PRINT #1, "OUTPUT 07;*RX"
SLEEP 3
WHILE (S% AND 4) = 0
PRINT #1, "SPOLL 07"
INPUT #2, S%
WEND
'Setup the ChartScan for line cycle integration mode
PRINT #1, "OUTPUT 07;M#0X"
PRINT #1, "OUTPUT 07;W#32X"
'Setup ChartScan for 16 channels TC type J and 16 Volts channels
PRINT #1, "OUTPUT 07;C1-16,1X"
PRINT #1, "OUTPUT 07;C17-32,14X"
'Program the ChartScan for binary format
PRINT #1, "OUTPUT 07;F0,1X"
'Start an acquisition with 1 pretrigger scan to enable the ChartScan
'to start scanning
PRINT #1, "OUTPUT 07;Y1,0,0X"
PRINT #1, "OUTPUT 07;T1,1,0,0X"
'Pause for key press
PRINT "The ChartScan is collecting High/Low/Last for all 32 channels.."
PRINT "Hit a key to start or stop reading HLL data.."
WHILE INKEY$ = "": WEND
CONST CHANNELS% = 32, BYTES = CHANNELS% * 20
DIM READS AS STRING * BYTES
S% = VARSEG(READS)
O% = VARPTR(READS)