beautypg.com

Measurement Computing TempScan/1100 User Manual

Page 278

background image

C-8 Program Examples in Quick Basic

879696

TempScan / MultiScan, Appendix C

(42)

…… 15- …… 15-PRINT #1 “OUTPUT 07; R1X”

…… 15- …… 15-PRINT #1 “ENTER 07”
…… 15- …… 15-INPUT #2, READINGS$
…… 15- …… 15-LOCATE 7, 1: PRINT “The scan”; i; “was:”; READINGS$
…… 15- …… 15-PRINT #1, “OUTPUT 07; UOX:
…… 15- …… 15-PRINT #1, :ENTER07”
…… 15- …… 15-OUTPUT #2, U%
…… 15- …… 15-IF U% = 1 THEN END

(50)

…… 15-WEND

This program is

SLOW_ACQ.BAS

in the

\EXAMPLES\

subdirectory. It will configure 64 thermocouple

channels, collect the data as soon as it becomes available, and post it on the screen.

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-7: To be certain that the reset was successful and the device is ready, Serial Poll the device

until the proper status is returned.

Lines 8-9: 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 64
as Type K thermocouples.

Line 10: The Set Counts (

Y

) command is used to configure the number of scans to take while in the

different acquisition states. In this example, 30 scans will be taken while in the Pre-Trigger state, 1
while in the Post-Trigger state, and 200 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 does not use Count, so this parameter is ignored.

Line 11: 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 Post-Trigger scan interval to 0.3 seconds (3.33 Hz), and the Pre-
Trigger
and Post-Stop scan intervals to 1.0 second (1.0 Hz).

Line 12: 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 and Stop are both
assigned the Trigger On (

@

) command character as sent by the controller. The Auto Re-arm flag is

disabled, so that the TempScan/1100 will not re-arm itself for another acquisition after the first
acquisition is complete. The synchronization flag is also disabled, so 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.

Lines 13-16: The next four lines prompt you to hit a key to trigger the TempScan/1100 acquisition.

When a key is hit, the Trigger On (

@

) command character is sent as the Trigger.

Lines 17-31: While in the Post-Trigger state, this program will first check for an available scan via a

Serial Poll of the TempScan/1100, and will then compare the response with an 8. If a scan is
available, the

R1

command tells the TempScan/1100 to send the oldest scan to the IEEE 488

controller. The command

ENTER

requests the response data from the TempScan/1100. The command

INPUT

places the retrieved data into the variable

READINGS$

. Since the acquisition is slow and the

buffer in the TempScan/1100 can be made very large, this program can go off to other foreground
tasks while the TempScan/1100 is acquiring data, and only occasionally query the unit and collect its
data.

Line 32: When a key is hit once again to stop the current acquisition, the program proceeds to the next

block where the Trigger On (

@

) command character is sent once again. This time, the character is sent

as the Stop, ending the Post-Trigger state and entering the Post-Stop state.

Lines 33-50: Now the collection of the Post-Stop data begins by querying for new scans and

requesting the data. The program is done when the acquisition is complete.

This manual is related to the following products: