11-20
Status Structure
Model 2701 User’s Manual
Example 2 – Read RAV bit of measurement event register
The following command sequence demonstrates the proper method to read the RAV bit of
the measurement event register:
*RST
' Put 2701 in “one-shot” mode.
*CLS
' Clear measurement event register.
STAT:PRES
' Clear measurement event enable register.
STAT:MEAS:ENAB 32
' Enable RAV bit (B5)of the measurement event register.
INIT
' Trigger one measurement.
*STB?
' Read status byte register.
*CLS and STAT:PRES resets the measurement register bits to zero. The :ENAB command
enables the reading available bit B5 (RAV) of the measurement event register. When a
reading is triggered and becomes available, bit B0 (MSB) of the status byte will set. INIT
triggers a reading and *STB? reads the status byte.
Since you are only interested in bit B0 of the status byte, it is recommended that your
program routine mask out the other bits, which may also be set. For example, *STB? may
return decimal “17”. The binary bit pattern for decimal 17 is as follows:
B7 B6 B5 B4 B3 B2 B1 B0
0
0
0
1
0
0
0
1
*STB? returns decimal “17” (B4 and B0 set)
If, in your program, you logically AND the above returned binary value with 00000001,
you will mask out bits B1 through B7:
B7 B6 B5 B4 B3 B2 B1 B0
0
0
0
1
0
0
0
1
*STB? returns decimal 17 (B0 and B4 set)
0
0
0
0
0
0
0
1
Mask to read B0 (decimal 1)
_____________________________
0
0 0
0
0 0
0
1
Result of logic AND operation (decimal 1)
As shown in the above result for the AND operation, when B0 is set, your program routine
will generate a “1” to indicate that RAV is set. If B0 is not set (0), the AND operation will
result in “0” to indicate that RAV is not set.
Example 3 – Read BHF bit of measurement event register
The buffer half full bit (BHF) is read in the same manner that the RAV bit was read in
Example 2. The difference being that the BHF bit is enabled (not the RAV bit). The
following example performs 500 measurements and stores them in the buffer.
NOTE
Details on using the buffer is provided in Section 6.
2701-900-01.book Page 20 Wednesday, August 3, 2011 9:43 AM
Summary of Contents for 2701
Page 344: ...12 CommonCommands 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...
Page 366: ...15 SCPIReferenceTables 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...
Page 393: ...A Specifications 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...
Page 399: ...B Model7700ConnectionGuide 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...
Page 410: ...C StatusandErrorMessages 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...
Page 417: ...D SignalProcessing SequenceandDataFlow 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...
Page 430: ...E MeasurementConsiderations 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...
Page 450: ...G KE2700InstrumentDriver Examples 2701 900 01 book Page 1 Wednesday August 3 2011 9 43 AM...