beautypg.com

Measurement Computing TempScan/1100 User Manual

Page 280

background image

C-10 Program Examples in Quick Basic

879696

TempScan / MultiScan, Appendix C

This program is

SLOW_ACQ.BAS

in the

\EXAMPLES\

subdirectory. It will configure 48 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 MultiScan/1200 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 first thing necessary to start scanning is to setup the measuring mode. In this case, the

MultiScan/1200 will be setup for line-cycle integration / high-speed multi-channel mode.

Lines 10-11: The Configure Channels (

C

) command will be used once to configure a range of

channels from 1 to 24 as Type J thermocouples, and used again to configure a range of channels from
25 to 48 as Type K thermocouples.

Line 12: 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 13: The Set Scan Interval (

I

) command sets the time period between scans in hours-minutes-

seconds format. The MultiScan/1200 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 2.0 seconds (0.5 Hz), and the Pre-
Trigger
and Post-Stop scan intervals to 3.0 seconds (0.333 Hz).

Line 14: 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 MultiScan/1200 will not re-arm itself for another acquisition after the first
acquisition is complete. The synchronization flag is also disabled, so the MultiScan/1200 will not re-
synchronize itself to the Trigger point when the Trigger (trigger start event) begins. When the
MultiScan/1200 encounters the Execute (

X

) command, it will be armed and will start the collection of

the Pre-Trigger data.

Lines 15-18: The next four lines prompt you to hit a key to trigger the MultiScan/1200 acquisition.

When a key is hit, the Trigger On (

@

) command character is sent as the Trigger.

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

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

R1

command tells the MultiScan/1200 to send the oldest scan to the IEEE 488 controller. The

command

ENTER

requests the response data from the MultiScan/1200. The command

INPUT

places

the retrieved data into the variable

READINGS$

. Since the acquisition is slow and the buffer in the

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

Line 34: 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 35-52: 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: