ChartScan Program Examples
Appendix D
D-10
ChartScan User’s Manual
PRINT “The ChartScan is currently collecting pre-trigger
data..”
PRINT “The ChartScan has not been triggered..”
PRINT “Hit a key to start a trigger event ..”:
WHILE INKEY$ = “”: WEND
PRINT #1, “output07;@X”
WHILE (S% AND 2) <> 2
PRINT #1, “SPOLL 07"
INPUT #2, S%
WEND
PRINT “A Start Trigger has been detected..”
PRINT “Waiting for acquisition complete..including Post and
Post-Stop
Scans”
Using the event status register command “
U0X
”, we now wait until the acquisition complete event which
includes the stop event.
WHILE (E% AND 1) <> 1
PRINT #1, “OUTPUT 07;U0X”
PRINT #1, “ENTER 07"
INPUT #2, E%
WEND
PRINT “The Acquisition is now complete”
Before reading the data, the
F
command is sent, instructing the ChartScan to return the data in a binary
format where every value will be 2 bytes in length. This command could have been issued anytime after the
initial reset and stays in effect until the unit is reset again or another
F
command is issued.
PRINT #1, “OUTPUT 07;F0,1X”
During or after the acquisition has been completed, the internal buffer can be queried for the amount of data
available for transfer. The U6 command will return the trigger block number, the current scan number, the
current read pointer, the trigger time/date stamp, the scan number where the stop event occurred, the stop
time/date stamp, the scan number of the end of the trigger block, and the block complete flag.
This example uses the last parameter in the return string as an indicator of how much data is available to
transfer to the controller. QuickBASIC’s MID$ function extracts 6 characters from the string U$ starting at
character 8.
‘Query the ChartScan for the # of scans available in the Buffer
PRINT #1, “OUTPUT 07;U6X”
PRINT #1, “ENTER 07"
LINE INPUT #2, U$
PRINT U$
UA$ = MID$(U$, 9, 7)
UA% = VAL(UA$)
PRINT UA%
PRINT “The ChartScan collected ”; UA%; “ scans of data”
After calculating the number of scans, an integer-type buffer is then prepared for the data. The offset and
segment pointers are supplied to the IEEE 488 driver so that the data can be transferred using DMA (direct
memory access).
The
R2
command instructs the ChartScan to supply the entire block of data that is presently available.
CHANNELS = 16
DIM CBUFFER%(UA% * CHANNELS)
SE% = VARSEG(BUFFER%(0))
OF% = VARPTR(BUFFER%(0))
B& = UA% * CHANNELS * 2
PRINT “Total number of Bytes available : ”; B&
PRINT #1, “OUTPUT 07;R2X”
PRINT “Uploading data..”
WHILE INKEY$ = “”: WEND
PRINT #1, “ENTER 07 #”; B&; “BUFFER ”; SE%; “:”; OF%; “ DMA”
At the completion of the DMA transfer, the integer data is now in the buffer
BUFFER%
. To convert the
integer data into temperatures, a simple calculation is performed.
BINARY DATA%/10 = °C
Summary of Contents for OMB-CHARTSCAN 1400
Page 1: ...August 2002 OMB CHARTSCAN 1400 Portable Data Recorder p n OMB 483 0901 Rev 3 1...
Page 6: ...iv ChartScan User s Manual...
Page 24: ...ChartScan User s Manual...
Page 32: ...2 8 General Information ChartScan User s Manual Notes...
Page 56: ...3 24 ChartScan User s Manual Notes...
Page 124: ...6 20 Calibration ChartScan User s Manual...
Page 126: ...A ii ChartScan User s Manual...
Page 136: ...API Commands Appendix A A 10 ChartScan User s Manual Notes...
Page 176: ...API Commands Appendix A A 50 ChartScan User s Manual...
Page 230: ...Appendix C Registers Data Formats Queries ChartScan User s Manual C 13...
Page 237: ...Registers Data Formats Queries Appendix C C 20 ChartScan User s Manual Notes...
Page 257: ...E 2 ChartScan User s Manual Notes...
Page 265: ...ASCII Code Summary Appendix F F 8 ChartScan User s Manual Notes...
Page 269: ...Abbreviations Appendix H H 2 ChartScan User s Manual Notes...
Page 271: ...ChartScan User s Manual...