Measurement Computing TempScan/1100 User Manual
Page 298

C-28 Program Examples in Quick Basic
879696
TempScan / MultiScan, Appendix C
The following program is
BIN_HLL.BAS
in the
\EXAMPLES\
subdirectory. It will configure 32
thermocouple and 16 volts channels, set up the TempScan/1100 for acquisition, and then after the
acquisition is complete, collect the High/Last/Low (HLL) channel readings in a Binary format rather than
the default ASCII format. The Binary format is inherently faster than ASCII format, but the data must be
deciphered after it is collected in order to yield the temperature values.
• 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 32 as Type J thermocouples, and used again to configure a range of channels from 33 to 48
as 10-Volt DC inputs.
• Lines 11-29: For sample acquisition program lines, refer to the previous TempScan/1100 program
example. For convenience, lines 11-29 from that example are identical to lines 11-29 in this example.
• Line 30: Before reading the data, the Set Data Format (
F
) command is sent, instructing the
TempScan/1100 to return the data in Binary format where every value will be 2 bytes in length. This
command can be issued anytime after the initial reset, and stays in effect until the unit is reset again or
another
F
command is issued.
• Lines 31-38: This example will now use DMA (Direct Memory Access) to transfer the HLL data into
the controller. For this purpose, an array is dimensioned, then the offset and segment pointers are
supplied to the IEEE 488 driver. After the
ENTER
command has completed, the Binary data will be in
the string
READS
.
• Lines 39-59: To convert the data into integer form, the string must be parsed and decoded.
• Lines 60-61: To convert the integer data into temperatures and into voltages, simple calculations are
performed.