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

Using Auto-Rearm to Capture Multiple Trigger Blocks using BLK_ACQ.BAS

The following program, BLK_ACQ.BAS, in the EXAMPLES directory will set up the ChartScan for auto-
rearm, which rearms the unit for another trigger event as soon as the present acquisition has been
completed.
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.
CLS : PRINT “The ChartScan is resetting..”
PRINT #1, “OUTPUT 07;*RX”
SLEEP 4
To be certain that the reset was successful and the device is ready, serial poll the device until the proper
status is returned.
WHILE (S% AND 4) = 0
PRINT #1, “SPOLL 07"
INPUT #2, S%
WEND
The C command will be used twice to configure a range of channels from 1 to 16 as Type J thermocouples
and a range of channels from 17 to 32 as Type K thermocouples.
PRINT #1, “OUTPUT 07;C1-16,1X”
PRINT #1, “OUTPUT 07;C17-32,2X”
The Y command is used to configure the number of scans to take while in the different acquisition states. In
this example, 1000 scans are taken while in the pre-trigger state, 20 while in the post-trigger state, and 10
while in the post-stop state. The post-trigger count is valid since the stop event, set by the T command, is
set to Counted.
PRINT #1, “OUTPUT 07;Y1000,20,10X”
The I command sets the time between scans in hours-minutes-seconds format. The ChartScan can have
two separate scan rates, one that is used in the post-trigger state, and one that is used in all other states.
This example sets up the pre-trigger and post-stop scan intervals to 0.3 seconds (3 Hz), and the post-trigger
interval to 0.0, which makes the units sample as fast as possible during the post-trigger period.
PRINT #1, “OUTPUT 07;I00:00:00.3,00:00:00.0X”
The T command sets up the trigger parameters for the acquisition. In this example, the start event is the ‘@
character issued by the controller. The stop event is Counted. The auto-rearm flag is set to 1 (on), so that
the ChartScan will re-arm itself for another acquisition after this acquisition is complete. The
synchronization flag is also off, so the ChartScan will not re-synchronize itself to the trigger point when the
start event begins. When the ChartScan encounters the X command, it will be armed and start the collection
of the pre-trigger data.
PRINT #1, “OUTPUT 07;T1,8,1,0X”
The Q command is used to set the buffer terminators for the data that is transferred to the controller. Both
the scan and trigger block terminators are set to LF (linefeed).
PRINT #1, “OUTPUT 07;Q,0,0,8,8,0X”
The FOR loop will read 5 trigger blocks, each consisting of a trigger point.
FOR i = 1 TO 5
The first lines of code within the FOR loop ask you to trigger the unit, then the last line sends an@
character to the unit.
PRINT : PRINT “The ChartScan’s Block ”; i; “ has not been
triggered.. ”
PRINT “It is currently collecting the Pre-trigger data
specified..”
PRINT “Press any key to send a start trigger event.”
WHILE INKEY$ = “”: WEND
PRINT #1, “OUTPUT 07;@X”