beautypg.com

Measurement Computing TempScan/1100 User Manual

Page 306

background image

C-36 Program Examples in Quick Basic

879696

TempScan / MultiScan, Appendix C

The following program is

BURST.BAS

in the

\EXAMPLES\

subdirectory. It will set up the MultiScan/1200

for an acquisition in single-channel high-speed burst mode and then bring the values into the controller
after the acquisition is complete.

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-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 first thing necessary to start scanning is to setup the measuring mode. In this case, the

MultiScan/1200 will be setup for single-channel high-speed burst mode, and for a sampling frequency
of 20 kHz.

Lines 11-12: The Configure Channels (

C

) command will be used once to configure Channel 1 as a 10-

Volt DC input. Insert a brief pause.

Line 13: Using the Set Counts (

Y

) command, program the burst-mode acquisition for 8 blocks of 256

scans. Note that the Trigger (trigger start event) can only be assigned with the software Trigger On
(

@

) command while the Stop (trigger stop event) can only be assigned with Count.

Line 14: Using the Set Trigger Configuration (

T

) command, the Trigger (trigger start event) is

assigned the Trigger On (

@

) command character as sent by the controller, while the Stop (trigger stop

event) is assigned to Count. Both the Auto Re-arm flag and the synchronization flag are disabled, as
described in previous examples. When the MultiScan/1200 encounters the Execute (

X

) command, it

will be armed and will start the collection of the data.

Lines 15-23: After the last Execute (

X

) command has been received, the MultiScan/1200 arms itself

and then waits for the Trigger (trigger start event). The IEEE 488 Serial Poll (

SPOLL

) command is

used to query the acquisition status of the MultiScan/1200. A

SPOLL

value of 2 signifies that the

MultiScan/1200 has detected the Trigger.

Lines 24-29: Using the User Status (

U

) command

U0

to query the Event Status Register (

ESR

), we now

wait until the Acquisition Complete event is reached. After the acquisition is complete, the single-
channel burst-mode data can now be retrieved using the standard retrieval commands keeping in mind
that the acquisition will look like 8 blocks of 256 channels.

Lines 30-37: 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 38-44: 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: