ChartScan Program Examples Appendix D
D-14 ChartScan User’s Manual

Using the U6 query, the controller gets the trigger block stri ng, which, among other things, supplies the

block complete flag, indicating the state of the present trigger block. The block is marked complete when

the last post-stop scan is recorded into the buffer.

PRINT “Waiting for completion of Block ”; i; “..”
DO
PRINT #1, “OUTPUT 07;U6X”
PRINT #1, “ENTER 07"
LINE INPUT #2, U$
UA$ = MID$(U$, 86, 2)
LOOP UNTIL UA$= “1"
PRINT “The ChartScan is done with Block”; i; “and has re-armed itself”

Using the U$ string which still contains the trigger block status string, the number of scans available in the

buffer is calculated. The R2 command is then used to retrieve the data in the ChartScan’s internal buffer.

‘Query the ChartScan for the # of scans available in the Buffer
UAT$ = MID$(U$, 9, 7)
PRINT UAT$
PRINT “The ChartScan collected a total of ”; VAL(UAT$); “ scans”
UA$ = MID$(U$, 18, 7)
PRINT UA$
PRINT “Pre-Triggered scans :”; VAL(UA$)
UA$ = MID$(U$, 47, 8)
PRINT “Post-Triggered scans :”; VAL(UA$)
UAS$ = MID$(U$, 77, 8)
PRINT “Post-stop-Triggered scans :”; VAL(UAS$) - VAL(UA$)
‘Upload Block
PRINT “Uploading trigger block”; i
PRINT #1, “OUTPUT 07;R2X”
FOR c = 1 TO VAL(UAT$)
PRINT #1, “ENTER 07"
LINE INPUT #2, SCAN$
NEXT c
PRINT “Block ”; i; “ is read.”
NEXT i

After all 5 trigger blocks have been collected, the unit is disarmed by sending the T command.

PRINT #1, “OUTPUT 07;T0,0,0,0X”

Configure for 12 Channels with Continuous Binary Upload using

CONTIN_D.BAS

This program configures the ChartScan for 12 Channels and allows the system to continuously upload

binary data to disk when the buffer is 75% full.

'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"
OPEN "Chrtscan.DAT" FOR OUTPUT AS #3 'output data file Dimensions
s! = 4096 'number of bytes to be transferred at a time
DataBuffer$ = SPACE$(s!)
DIM DataBuffer$(s!)
DEF FNPEEKW (addr) = PEEK(addr) + 256 * PEEK(addr + 1)