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

Acquiring Pre- & Post-Trigger Data at the Same Rate using FAST_ACQ.BAS

The following program, FAST_ACQ.BAS, in the EXAMPLES directory will set up the ChartScan for fast
acquisition then bring the values into the controller after the acquisition is complete. From a logic
standpoint, the difference between this and SLOW_ACQ.BAS is that this program reads blocks of data
instead of one scan at a time. This method is usually more efficient in case of fast scan intervals.
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 10
To be certain that the reset was successful and the device is ready, serial poll the device until the proper
status is returned.
S% = 0
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 T thermocouples
and a range of channels from 17 to 32 as Type K thermocouples.
PRINT #1, “OUTPUT 07;C1-16,3X”
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, 50 scans are taken while in the pre-trigger state, 100 while in the post-trigger state, and 200
while in the post-stop state. The post-trigger count is only valid when the stop event, set by the T command
is set to Counted. This application does not use Counted, so this parameter of 100 is ignored.
PRINT #1, “OUTPUT 07;Y50,100,200X”
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 both scan intervals to 0.1 seconds (10 Hz).
PRINT #1, “OUTPUT 07;I00:00:00.1,00:00:00.1X”
The T command sets up the trigger parameters for the acquisition. In this example, the start event is a rising
level of an input channel as specified by the L command. The stop event is a falling level of an input
channel as it passes through the level specified by the L command. The auto-rearm flag is set to 0 (off), so
that the ChartScan will not 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.
The L command in this example specifies the trigger channel as channel 1 at a level of 20 degrees with a
hysteresis of 0 degrees. The L command is relevant only when the start or stop event is a channel level.
PRINT #1, “OUTPUT 07;L1,20.0,0X T4,5,0,0X”
After the X command has been received, the ChartScan arms itself and, in this case, waits for the start event
of channel 1 rising above 20°C. The IEEE 488 Serial Poll command is used to query the ChartScan as to
the status of the acquisition. An SPOLL value of 2 signifies that channel 1 has reached 20°C.
PRINT “The ChartScan has not been triggered..”
PRINT “Waiting for Channel 1 to reach the trigger level..”
WHILE (S% AND 2) <> 2
PRINT #1, “SPOLL 07"
INPUT #2, S%
WEND
PRINT “A Start Trigger event has been detected..”
PRINT “Waiting for a stop Trigger event..”