Measurement Computing TempScan/1100 User Manual
Page 302

C-32 Program Examples in Quick Basic
879696
TempScan / MultiScan, Appendix C
The following program is
BLK_ACQ.BAS
in the
\EXAMPLES\
subdirectory. It will configure 32
thermocouple channels, and will set up the TempScan/1100 unit for Auto Re-arm, which re-arms the unit
for another Trigger (trigger start event) as soon as the current acquisition has been completed.
• Lines 1-3: Although not necessary, it is good practice to reset the TempScan/1100 at the start of your
application by sending the Reset Power-On (
*R
) command. Wait a few seconds.
• Lines 4-8: To be certain that the reset was successful and the device is ready, Serial Poll the device
until the proper status is returned.
• Lines 9-10: The Configure Channels (
C
) command will be used once to configure a range of channels
from 1 to 16 as Type J thermocouples, and used again to configure a range of channels from 33 to 48
as Type K thermocouples.
• Line 11: The Set Counts (
Y
) command is used to configure the number of scans to take while in the
different acquisition states. In this example, 1000 scans will be 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 only
valid when the Stop (trigger stop event) is set to Count via the Set Trigger Configuration (
T
)
command. This example will in fact use Count, so this parameter is valid.
• Line 12: The Set Scan Interval (
I
) command sets the time period between scans in hours-minutes-
seconds format. The TempScan/1100 can have two different scan intervals, one for the Post-Trigger
state (acquisition scan interval), and one for the Pre-Trigger and Post-Stop states (normal scan
interval). This example sets up the Pre-Trigger and Post-Stop scan intervals to 0.3 seconds (3.0 Hz),
and sets up the Post-Trigger scan interval to 0.0 second, which defaults the TempScan/1100
acquisition to fast mode.
• Line 13: The Set Trigger Configuration (
T
) command sets up the Trigger (trigger start event ) and
Stop (trigger stop event) parameters for the acquisition. In this example, the Trigger is assigned the
Trigger On (
@
) command character as sent by the controller, while the Stop is assigned to Count.
In this example, the Auto Re-arm flag is enabled so that the TempScan/1100 will automatically re-arm
itself for another acquisition after the current acquisition is complete. Meanwhile, the synchronization
flag are disabled so that the TempScan/1100 will not re-synchronize itself to the Trigger point when
the Trigger (trigger start event) begins. When the TempScan/1100 encounters the Execute (
X
)
command, it will be armed and will start the collection of the Pre-Trigger data.
• Line 14: The Set Query Terminator (
Q
) command is used to set the buffer terminators for the data that
is transferred to the controller. Both the scan terminator and Trigger Block terminator are set to
LF
(line feed).
• Lines 15-19: The
FOR
loop will read five Trigger Blocks, each consisting of one Trigger point. These
first lines of code within the loop will ask you to trigger the TempScan/1100 unit.
• Lines 20-39: During the acquisition or after the acquisition has been completed, the Acquisition
Buffer can be queried for the data that is available for transfer. These next lines of code within the
loop use the User Status (
U
) command
U6
to query the Buffer Status String, as described in previous
examples. This example uses the last parameter in the return string as an indicator of how much data
is available to transfer to the IEEE 488 controller. The function
MID$
is used to extract characters
from the string
U$
.
• Lines 40-47: After using the
U$
string to calculate the number of scans available in the buffer, the last
lines of code within the loop use the Read Buffered Data (
R
) command
R2
to instruct the
TempScan/1100 unit to supply the oldest complete Trigger Block of data that is currently available.
Then the
NEXT
command will return the unit to the start of the loop.
• Line 48: After five loops and all five Trigger Blocks have been collected, the TempScan/1100 unit is
disarmed by sending the Set Trigger Configuration (
T
) command.