HP (Hewlett-Packard) VXI User Manual

Contents
Programming HP VXI Instruments
Common Commands and the Status System
Edition 1
Chapter 1
Introduction ....................................................................................................................5
Chapter 2
Programming the Status System ..................................................................................7
General Status Register Model.....................................................................................7
Condition Register .................................................................................................8
Transition Filter .....................................................................................................8
Event Register .......................................................................................................8
Enable Register .....................................................................................................8
An Example Sequence ..........................................................................................8
Required Status Groups..............................................................................................10
Status Byte ...........................................................................................................11
Standard Event Group .........................................................................................12
Standard Operation Status Group ........................................................................13
Questionable Data Group ....................................................................................14
Status System Programming Examples......................................................................15
Handling SRQs ...................................................................................... ......... .....15
Using MAV to Determine When Data is Available ............................................15
Example Program .........................................................................................16
Using a Service Request to Detect Errors ...........................................................18
Example Program .........................................................................................19
Chapter 3
Command Reference ...................................................................................................23
About this Chapter......................................................................................................23
STATus.......................................................................................................................24
Subsystem Syntax .........................................................................................24
:OPERation :CONDition? ...................................................................................24
Comments ..................................................................................................... 24
Example ........................................................................................................ 24
:OPERation:ENABle ...........................................................................................24
Parameters .....................................................................................................24
Comments ..................................................................................................... 24
Example ........................................................................................................ 24
:OPERation:ENABle? ......................................................................................... 25
Comments ..................................................................................................... 25
Example ........................................................................................................ 25
:OPERation[:EVENt]? ........................................................................................ 25
Comments ..................................................................................................... 25
Example ........................................................................................................ 25
:PRESet ............................................................................................................... 25
Example ........................................................................................................ 25
:QUEStionable :CONDition? ..............................................................................25
Comments ..................................................................................................... 26
Contents 1
Example ........................................................................................................ 26
:QUEStionable:ENABle ......................................................................................26
Parameters .....................................................................................................26
Comments ..................................................................................................... 26
Example ........................................................................................................ 26
:QUEStionable:ENABle? .................................................................................... 26
Comments ..................................................................................................... 26
Example ........................................................................................................ 26
:QUEStionable[:EVENt]? ................................................................................... 26
Comments ..................................................................................................... 26
Example ........................................................................................................ 27
Common Command Reference...................................................................................28
*CLS ....................................................................................................................28
*DMC <name_string>, <command_block> .......................................................29
*EMC <enable> ..................................................................................................29
*EMC? ................................................................................................................ 29
*ESE <mask> ......................................................................................................29
Example ........................................................................................................ 29
*ESE? .................................................................................................................. 29
Example ........................................................................................................ 29
*ESR? ..................................................................................................................29
Example ........................................................................................................ 30
*GMC? <name_string> .......................................................................................30
Example ........................................................................................................ 30
*IDN? .................................................................................................................. 30
Example ........................................................................................................ 30
*LMC? ................................................................................................................ 30
*LRN? ................................................................................................................. 30
*OPC ................................................................................................................... 31
*OPC? ................................................................................................................. 31
*PMC ..................................................................................................................31
*RMC <name_string> .........................................................................................31
Example ........................................................................................................ 31
*RST ....................................................................................................................31
*SRE <mask> ......................................................................................................32
Example ........................................................................................................ 32
*SRE? ..................................................................................................................32
Example ........................................................................................................ 32
*STB? ..................................................................................................................32
Comments ..................................................................................................... 32
Example ........................................................................................................ 32
*TST? .................................................................................................................. 32
Example ........................................................................................................ 32
*WAI ...................................................................................................................33
2 Contents
This document contains proprietary information which is protected by copyright. All rights are reserved. No part of this document may be photocopied, reproduced, or translated to another language without the prior written consent of Hewlett-Packard Company.
E2090-90021
Notice
The information contained in this document is subject to change without notice. Hewlett-Packard Company (HP) shal l not be liable for any error s contained in this document . HP makes no
warranties of any kind with regar d to this documen t, whether express or impl ied. HP specificall y disclaims the implied warran ties of merchantabil ity and fit ness for a particula r purpose. HP shall no t be liable for any direct, indirect , s pec ial, incidental, or c onsequential damages, wh et her ba sed on contract, tort, or any other legal theory, in connection with the furnishing of this document or the use of the information in this document.
Warranty Information
A copy of the specific warranty terms applicable to your Hewlett-Packard product and replacement parts can be obtained from your local Sales and Service Office.
Restricted Rights Legend
Use, duplication or disclos ure by t he U.S. Gov ernment i s subject t o restr ictions as set forth in subpar agraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause of DFARS 252.227-7013.
Use of this manual and magnetic media supplied for this product are restricted. Additional copies of the software can be made for secu rity and backup purposes only. Resal e of the s oft ware in its present form or with alterations is expressly prohibited.
Copyright © Hewlett-Packard Company 1994
Printing History
This is the first edition of “Programming HP VXI Instruments”
September 1994; First Edition
3
This Page Intentionally Left Blank
4
Chapter 1
Introduction
This document descri bes the common commands and t he status sy stem used by VXI instruments. The status system is a group of registers that can be used to monitor events, such as when an error occurs or when a reading is available from a s pecified instrumen t in your VXI mainframe. Us e the SCPI status system commands and IEEE 488.2 common commands described in Chapter 3 of this document to program the status system.
The common commands are used to read and configure the status byte and standard event group registers, while the status commands are used to configure the standard operation status group and questionable data status group registers. See the individual VXI instrument manuals to determine how a specific instrument uses the operation status group and the questionable data status group. If status system commands are not documented, that instrument does not use the registers.
Other common commands are used for general functionality, macros, and synchronization.
Note This document should be placed with your other VXI instrumentation
documentation.
Introduction 5Chapter 1
Notes:
6 Introduction Chapter 1
Programming the Status System

About this Chapter

Chapter 2
This chapter discusses the structure of the status system used in SCPI instruments and explains how to program status registers. An important feature of SCPI instruments is that they all implement status regist ers in the same way. The status system is explained in the following sections:
General Status Register Model
This section explains the way that status registers are structured in
SCPI instruments. It also contains an example of how bits in the various registers change with different input conditions.
Required Status Groups
This section describ es the minimum r equired status registers pre sent in
SCPI instruments. These status registers cover the most frequently used functions.

General Status Register Model

The generalized status register model shown in Figure 2-1 is the building block of the SCPI sta tus system. Thi s model consists of a conditio n register, transition filter, an event register, and an enable register. A set of these registers is called a status group.
When a status group is implemented in an instrument, it always contai ns all of the component registers. However, there is not always a corresponding command to read or write to every register.
Figure 2-1. Generalized Status Register Model
Programming the Status System 7Chapter 2

Condition Register The condition register continuously monitors the hardware and firmware

status of the instrument. There is no latching or buffering for this register; it is updated in real time. Condition registers are read-only.0
If there is no command to read a particular condition register, it is simply invisible to you.

Transition Filter The transi t ion fi lt er specifies which types of bit state changes in the

condition register will set corresponding bits in the event register. Transition filter bits may be set for positiv e transitions (P TR), negative transitions (NTR), or both. Positive means a condition bit changes from 0 to 1. Negative means a condition bit changes from 1 to 0. Transition fil ters are read-write. Transition filters are unaffected by *CLS (clear status) or queries. They are set to instrument-dependent values at power on and afte r *RST (reset).
If there are no commands to access a particular transition filter, it has a fixed setting. This setting is specified in the instrument’s programming guide or command dictionary. Most of our VXI instruments assign the transition filter to detect positive transitions only.

Event Register The event register latches transition events from the condition register as

specified by the transition filter. Bits in the event register are latched, and, once set, they remain set until cleared by a query or *CLS (clear status). There is no buffering; so while an eve nt bit is set, subsequent events corresponding to that bit are ignored. Event registers are read-only.

Enable Register The enable register specifies which bits in the event register can gen erate a

summary bit. The instrument logically ANDs corresponding bits in the event and enable reg isters, and ORs all the resulti ng bits to obtain a summary bit. Summary bits are, in turn, recor ded in anoth er register, oft en the Status Byte. Enable registers are read-write. Enable registers are not affected by *CLS (clear status). Queryin g enable register s does not affec t them. There is always a command to read and write to the enable r egi ster of a particular status group.
An Example
Sequence
Figure 2-2 illustr ate s th e response of a single bit posit io n in a typ ic al status
group for various settings. The changing state of the condition in question is shown at the bot tom of t he figur e. A smal l binar y table shows the state of the chosen bit in each status register at the selected times T1-T5.
8 Programming the Status System Chapter 2
Figure 2-2. Typical Status Bit Changes in a Status Register
Programming the Status System 9Chapter 2

Required Status Groups

All SCPI instruments must implement a minimum set of status groups. Some instruments contain additional status groups, consistent with the general status re gister model. The minimum requi red status system is shown in Figure 2-3.
Figure 2-3. Minimum Required Status Register System
10 Programming the Status System Chapter 2
The Standard Operation Status and Questionable Data groups are 16 bits wide, while Status Byte and Standard Eve nt groups are onl y 8 bits wide. In all 16 bit groups, the most signif icant bit ( bit 15) is not us ed. Bit 15 always returns a zero. The comman ds t hat set and query bits in the status r egi sters all use decimal integers. For example, you send *ESE 4 to set bit 2 of the Standard Event enable register. Similarly, a response of "8" to the query *ESE? indicates th at bit 3 is set. The r emainder of this chap ter explains each status group in detail.

Status Byte As Figure 2-4 indicates, the Status Byte is used to summarize information

from all the other status groups. The Status Byte differs from the other groups in the way you read it and how its summary bit is processed.
Figure 2-4. Status Byte Register
The Status Byte can be read using either the *STB? common command or by doing a SICL ireadstb function call. The ireadstb function reads the status byte from the device specified.
The Status Byte summary bit actually appears in bit 6 (RQS) of the Status Byte. When bit 6 is set, it generates an SRQ interrupt. This interrupt is a low-level HP-IB message that signals the controller that at least one instrument on the bus requires attention.
There are some subtle differences between *STB? and ireadstb. You can use either method to read the state of bits 0-5 and bit 7. Bit 6 is treated differently dependi ng on whether you use *STB? or i readstb. With ireadstb, bit 6 returns RQS (request for service) which is cleared after the first ireadstb. *STB? returns the MSS (master state summary). This is the summary bit of the status byte register. It’s like a condition bit and will return to zero only when all enabled bits in the status byte are zero. In general, use ireadstb inside interrupt service routines, not *STB?.
Note In an SRQ interrupt service routine, yo u must clear the event register which
caused the SRQ (for example, STATus:QUES:EVEN?, STATus:OPER:EVEN?, or *ESR?). Failure to do so will prevent future SRQs from arriving.
Programming the Status System 11Chapter 2
Loading...
+ 23 hidden pages