ChartScan User’s Manual, 1-14-99 D-1

Appendix D

ChartScan Program Examples

Reference Note: You may find Appendix A useful while reading through these examples. Appendix A
contains descriptions and examples of the Application Program Interface (API) Commands.
Contents
Overview------------------------------------------------------------------------------------------------------------------------D-1
Reading HLL Status using HLL16.BAS--------------------------------------------------------------------------------D-2
Reading HLL Data from T/C and Volts Cards using HLL32.BAS------------------------------------------------D-2
Acquiring Pre-& Post-Trigger Data at Data at Different Rates using SLOW_ACQ.BAS-------------------D-3
Acquiring Pre-& Post-Trigger Data at the Same Rate using FAST_ACQ.BAS------------------------------D-5
Operating Alarms using ALARM2.BAS---------------------------------------------------------------------------------D-6
Using the IEEE 488 SRQ with Alarms using ALAR2SRQ.BAS --------------------------------------------------D-8
Collecting Data in Binary Format using BIN_ACQ.BAS------------------------------------------------------------D-9
Collecting Binary-Formatted High/Low/Last Data using BIN_HLL.BAS---------------------------------------D-11
Using Auto-Rearm to Capture Multiple Trigger Blocks using BLK_ACQ.BAS-------------------------------D-13
Configure for 12 Channels with Continuous Binary Upload using CONTIN_D.BAS------------------------D-14
Configure for High-Speed, Single-Channel Burst Mode using BURST.BAS---------------------------------D-17
Overview
This chapter walks through the example programs that are supplied on the release disk in the EXAMPLES
subdirectory of the CHARTVIEW directory. This directory has additional examples for serial users.
Although written in QuickBASIC, the program logic and the ChartScan device-dependent commands apply
to all languages and computers.
The first group of examples uses the IEEE 488 bus through the Personal488 interface to communicate with
the ChartScan. Each one of these programs begins with a short preamble that opens the driver and
substantiates communications.
After the driver is opened, commands are issued to the driver thr ough character strings in quotes.
QuickBASIC’s PRINT and INPUT commands are used to communicate with the driver. The driver
commands used most commonly are ENTER, OUTPUT, and SPOLL.
ENTER gets data from the selected device. The syntax of the ENTER command is “ENTERaddr”,
where addr is the IEEE 488 address of the instrument. To bring the data into a language variable, the
QuickBASIC INPUT function must be used right after the ENTER command.
OUTPUT sends data to the selected device, The syntax of the OUTPUT command is “OUTPUTaddr;out
data”, where addr is the IEEE 488 address of the instrument, and out data the string of characters to
send to the device.
SPOLL is an abbreviation for a Serial Poll that retrieves an 8-bit status response from the selected
instrument. The syntax of the SPOLL command is “SPOLLaddr”, where addr is the IEEE 488 address
of the instrument. Right after the SPOLL command, the QuickBASIC INPUT function must be used to
bring the data into a language variable.
Note: The ChartScan is at IEEE 488 address 07 for all IEEE 488 examples.