beautypg.com

Measurement Computing TempScan/1100 User Manual

Page 282

background image

C-12 Program Examples in Quick Basic

879696

TempScan / MultiScan, Appendix C

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 T 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, 50 scans will be 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 (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 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 Post-Trigger, Pre-Trigger and Post-Stop scan intervals to the same
value of 0.1 second (10.0 Hz).

Line 13: The Set Trigger Level (

L

) command specifies the channel as Channel 1 at a level of 20

°C

with a hysteresis of 0

°C (where the default units is degrees Celsius). This command is relevant only

when the Trigger (trigger start event ) or Stop (trigger stop event) is a channel level, as specified on
the next line.

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
assigned the rising level and falling level, respectively, of an input channel as specified via the Set
Trigger Level
(

L

) command. 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 15-22: After the Execute (

X

) command has been received, the TempScan/1100 arms itself and

then waits for the Trigger (trigger start event) of Channel 1 rising above 20

°C. The IEEE 488 Serial

Poll (

SPOLL

) command is used to query the acquisition status of the TempScan/1100. A

SPOLL

value

of 2 signifies that Channel 1 has in fact risen above 20°C.

Lines 23-28: Using the User Status (

U

) command

U0

to query the Event Status Register (

ESR

), we now

wait until the Acquisition Complete event is reached.

Lines 29-36: During the acquisition or after the acquisition has been completed, the Acquisition

Buffer can be queried for the data that is available for transfer. The User Status (

U

) command

U6

can

be used to query the Buffer Status String, which includes the following eight fields of information: (1)
Number of Trigger Blocks Available, (2) Number of Scans Available, (3) Current Position of Read
Pointer, (4) Time/Date Stamping of Trigger Event, (5) Position of Stop Event Pointer, (6) Time/Date
Stamping of Stop Event, (7) Position of End Scan Pointer, and (8) Status of Current Trigger Block.
For more information on the Acquisition Buffer, see chapter System Operation.

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$

extracts 6 characters from the string

U$

starting at character 8.

Lines 37-43: The Read Buffered Data (

R

) command

R1

is used to request the oldest scan from the unit.

Using the variable

UA%

calculated from the previous step, all of the oldest scan data is transferred to

the controller.

This manual is related to the following products: