Home
HP 53151A User's Manual
Contents
1. SPC Technology 6 Conductor Flat Telephone Wire Part number TXW6151 Figure 3 4 Assembling the Cable 4 Connect either end of the cable to the adapter by inserting the RJ12 plug into the receptacle on the adapter 3 10 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer Connecting with the Serial Interface Connect the female DB25 connector on the adapter to the male DB25 serial port connector on the computer and then insert the RJ12 plug at the other end of the cable into the RJ12 receptacle on the back of the counter as shown in Figure 3 5 i i Computer Rear Panel Serial Cable Counter Rear Panel Figure 3 5 RS 232 Serial Interconnection Remote Local Operation When the counter is connected to a computer via the HP IB and it is in Remote mode the Rmt indicator is visible on the display and the Counter settings cannot be affected using the front panel controls The Reset Local key can be used to manually return the counter to local control if local lockout is off When the Counter is in Local mode the front panel Rmt indicator in the display is off Programming Guide 3 11 Chapter 3 Programming Your Counter for Remote Operation Overview of Command Types and Formats Overview of Command Types and Formats There are two types of HP 53150A 151A4 152A programming com
2. The Master Summary Status not the RQS message is reported on bit 6 Master Summary Status indicates that the Counter has at least one reason for requesting service The Master Summary Status is not sent in response to a serial poll the IEEE 488 1 RQS message is sent instead It is the inclusive OR of the bitwise combination excluding bit 6 of the Status Byte Register and the Service Request Enable Register Programming Guide 4 57 Chapter 4 Command Reference Common Commands TRG Trigger Command COMMAND TRG This command is the device specific analog of the IEEE 488 1 Group Execute Trigger GET interface message page 4 7 and has exactly the same effect The TRG command performs the action defined by the DDT command page 4 46 RELATED None FRONT PANEL KEYS 4 58 Programming Guide Chapter 4 Command Reference Common Commands TST Self Test Query COMMAND TST This query causes an internal self test the response indicates whether any errors were detected When the self test fails error 330 is generated and other messages indicating specific failures are also placed in the error event queue QUERY RESPONSE Numeric data transferred as ACSII bytes in lt NR1 gt format e A response value of zero indicates the self test has completed with no errors detected while a non zero value indicates the self test was not completed or was completed with errors detected The test f
3. Programming Guide 4 17 Chapter 4 Command Reference MEASure Subsystem Using MEAsure This is the simplest Measurement Instruction command to use but it does not offer much flexibility MEASure causes the Counter to configure itself for a default measurement starts the measurement and queries the result The following example shows how to use the MEASure query to measure frequency Use MEASURE FREQ to execute a default frequency measurement and have the result sent to the controller The Counter selects settings and carries out the required measurement it automatically starts the measurement and sends the result to the controller You can add parameters to provide more details about the signal you are going to measure Use MEASURE FREQ 50 MHZ 1 HZ where 50 MHz is the expected value this value can also be sent as 50E6 HZ and 1Hz is the required resolution The channel numbers can also be specified For example you can send MEASURE FREQ 1 MEASURE FREQ 50 MHz 1 HZ 1 Using CONFigure with READ The CONFigure command causes the instrument to choose default settings for the specified measurement READ starts the measurement and queries the result This sequence operates in the same way as the MEASure query but it allows you to insert commands between CONFigure and READ to specify a particular setting 4 18 Programming Guide i i i Chapter 4 Command Reference MEA
4. FRONT PANEL KEYS i i Programming Guide 4 23 Chapter 4 Command Reference SENSe Subsystem COMMAND SENSe DATA lt data handle gt Queries the current measurement result data of the SENSe subsystem roy Valid lt data handles gt pi SENSe XNONE FREQuency 1 2 SENSe XNONE POWer 2 QUERY RESPONSE Frequency values are returned in Hz as ASCII bytes in NR1 format Power values are returned in dB in NR2 format COMMENTS Query only e Does not initiate any measurement action e The data handle is optional If it is omitted the query returns values for all functions enabled by the FUNCtion ON command e Values are returned in the same order as the functions returned by the FUNCtion ON query e Ifthis query executes while a measurement is in progress the prior measurement result is returned if the prior result was not invalidated RELATED None FRONT PANEL KEYS COMMAND SENSe FiLTer FM AUTO lt Boolean gt Turns the Counter s ability to automatically compensate for frequency modulation ON or OFF RST ON COMMENTS When FM AUTO is ON the Counter automatically detects FM signals and modifies its measurement algorithm accordingly e Using FM AUTO increases the time required to compute each measurement but increases the accuracy of FM signal measurements RELATED Shift Menu FM gt AUTO OFF rea FRONT PANEL KEYS i 4 2
5. SSENSe FILTer FM AUTO SSENSe FREQuency OFFset STATe SSENSe FREQuency RESolution SENSe FREQuency TRACking SENSe FUNCtion ON SENSe POWer AC REFerence SENSe POWer AC REFerence STATe SENSe ROSCillator SOURce TRIGger SEQuence HOLDoff DDT The following front panel settings are saved these settings have no command equivalents Rel Pwr Relative Power value Rel Freq Relative Frequency value Rel Pwr Relative Power state Rel Freq Relative Frequency state Power Display Units Shift Menu SAVE gt 0 through 8 4 54 Programming Guide Chapter 4 Command Reference Common Commands SRE Service Request Enable Command SRE Service Request Enable Query i COMMAND SRE lt NRf gt lt non decimal numeric gt SRE Sets or queries the Service Request Enable Register which is shown in Figure 4 5 The parameter and query response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the Service Request Enable Register This register is used to enable a single or inclusive OR group of Status Byte Register events to generate an SRQ Bits Biot 2 Not Used EAV QSB MAV ESB Not Used enter OSB a b oO o R Figure 4 5 The Service Request Enable Register See the section titled Status Byte Register and Service Request Enable Register starting on page 3 27 for a det
6. Counter is error can be generated when parsing a string data element This particular error message is used if the Counter cannot detect a more specific error Invalid string data Astring data element was expected but was invalid for some reason For example an END message was received before the terminal quote character String data not allowed Astring data element was encountered but was not allowed by the Counter at this point in parsing Block data error This error can be generated when parsing a biock data element This particular error message is used if the Counter cannot detect a more specific error errors 161 through 169 Invalid block data A block data element was expected but it was not allowed by the Counter at this point in parsing Block data not allowed A legal biock data element was encountered but was not allowed by the Counter at this point in parsing Expression error This error can be generated when parsing an expression data element It is used if the Counter cannot detect a more specific error Invalid expression The expression data element was invalid see IEEE 488 2 For example unmatched parentheses or an illegal character Expression data not Expression data was encountered but was not allowed by the Counter at allowed this point in parsing Invalid outside macro Indicates that a macro parameter placeholder lt number gt was definition encountered outside of a macro definition Execution error Thi
7. Programming Guide This guide describes how to program the HP 53150A 53151A and 53152A Microwave Frequency Counters The information in this guide applies to instruments having the number prefix listed below unless accompanied by a Manual Updating Changes package indicating otherwise SERIAL PREFIX NUMBER 3735A and above 53150A 3736A and above 53151A 3737A and above 53152A HP 53150A 151A 152A Microwave Frequency Counter Copyright Hewlett Packard Company 1997 All Rights Reserved Reproduction adaptation or translations without prior written permission is prohibited except as allowed under the copyright laws Printed November 1997 Printed in USA Manual part number 53150 90002 Certification and Warranty Jertification Hewlett Packard Company certifies that this product met its published specification at the time of shipment from the jes that its calibration measurements are traceable to the United States National Institute of Standards and Technology formerly National Bureau of Standards to the extent allowed by the Institute s calibration facility and to the calibration facilities of other International Standards Organization members Warranty HP warrants HP hardware accessories and supplies against defects in materials and workmanship for a period of one year from date of shipment If HP receives notice of such defects during the warranty period H
8. zo OF Viewed from wire back side of the connectors 013 S eeen e enea aaa ee aa a a m e SPC Lectnology Voltrex Brand Part number MAK206 F DB 25F female to RJ12 male Adapter Pin 1 Not Used Pin 2 TXD Pin 3 RXD Pin 4 GND Pin 5 Not Used Pin 6 Not Used Figure 3 3 Wiring the RJ12 DB25 Adapter 1 of 2 3 8 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer DB 25F Female a 250 Male 240 230 220 1 210 i 200 GRNIGND 190 180 170 160 BLK TXD 150 RED RXD 140 Pin 4 GND Pin 3 RXD Pin 2 TXD O1 Viewed from front side of the connectors taniman aeae SPC Technology Voltrex Brand Part number MAK206 F DB 25F female to RU12 male Adapter Figure 3 3 Wiring the RJ12 DB25 Adapter 2 of 2 Programming Guide 3 9 Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer 3 Attach an RJ12 modular plug to each end of a suitable length of 6 conductor flat telephone cable as shown in Figure 3 4 Be sure to attach the connectors in the orientations shown in the figure bad RJ12 Modular Plug mmaa SPC Technology Wi Se Part number TA 30 6 ena AEE Color 6 BUU S veL 5 YEL 5 YEL 4 GAN 3 RED 3 RED 2 e 2 BLK T wn 1 dwr LLT
9. MEASure query 4 11 MEASure Subsystem 4 10 measurement algorithm 4 24 measurement functions 2 12 4 27 4 16 4 28 Measurement Instructions 2 14 4 10 measurement instructions commands definition 4 10 measuring status bit 3 38 MEMory 2 7 2 15 4 20 4 21 DATA 2 7 MEMory Subsystem 4 20 minimum value 3 16 Index 4 Programming Guide Index Missing parameter 5 8 N negative pulse width 4 27 4 28 negative transition filter 2 17 negative transition filter register 3 37 New 2 12 No Error 5 5 NR1 4 59 NRE 2 12 NSTates 2 15 NSTates 4 21 NTRansition 2 17 4 34 Numeric data error 5 8 Numeric data not allowed 5 8 FFSet 2 15 4 25 PC 3 31 PERation 2 16 4 31 4 32 4 33 4 34 peration and Questionable Data Status Register Groups 3 33 eration Complete 2 10 4 5 eration Complete bit 2 10 4 51 eration Complete Command 4 51 eration Complete Idle State 4 53 peration Complete Query 2 10 4 51 peration Complete Query Idle State 4 53 eration Complete status bit 3 31 eration Condition Status Register 2 17 4 32 peration Event Status Enable Register 2 17 4 32 eration Event Status Register 4 33 peration Status Register Group 3 33 3 37 4 31 eration status reporting structure 4 34 OSB 3 29 oscillator reference 4 27 4 29 4 30 Out of memory 5 10 Output Queue 2 10 oooo OOGO O39 Ce O 2 O r a output queue 4 51 P Parallel Poll Enable Register 2 10 4 52 Parallel Poll Enable Register Q
10. Ontario LAW 5G1 906 206 4725 Latin America Hewlett Packard Latin American Region Headquarters 5200 Blue Lagoon Drive 9th Floor Miami Florida 33126 USA 305 267 4245 4220 United States Hewlett Packard Company Test and Measurement Organization 5301 Stevens Creek Boulevard Building 51L SC Santa Clara California 95052 8059 1 800 452 4844 Europe Africa and Middle East Austria 0 1 25000 0 Baltic Countries 358 08872 2100 Belgium and Luxembourg 02 778 34 17 Czech Republic 0042 2 474311 1 Denmark 45 99 10 00 Finland 90 88 721 France 1 69 29 41 14 Germany 0180 532 62 33 Greece 1 726 4045 Hungary 1 252 4705 Ireland 01 284 4633 Israe 08 5380 333 Italy 02 92 122 241 Netherlands 020 547 6669 Norway 22 73 57 50 Poland 22 508 7700 Portugal 11 482 85 00 Russia Tele 7 095 928 6885 Fax 7 095 916 9844 South Africa 011 806 1000 Spain 34 1 631 1323 Sweden 08 444 22 77 Switzerland 01 735 7111 Turkey 212 224 59 25 United Kingdom 01344 366 666 For countries in Europe Middle East and Africa not listed contact Hewlett Packard International Sales Europe Geneva Switzerland Tel 41 22 780 4111 Fax 41 22 780 4770
11. Programming Guide 2 3 Chapter 2 Command Summary Front Panel to SCPI Command Map Shift Freq Offset Shift Pwr Offset Eomma ory mas Shift HPIB d E il l Resolution 7 i Monu 1 Reset Local ce i cae i on 2 Shift amp On Off 8 POWER Channel 2 pS 3 Chan Select ay i j 42 sole Lower 9 f Freq Offset On Off SE Power Offset On Off 10 at T Figure 2 1 Front Panel Control to SCPI Command Map Part 1 of 2 2 4 Programming Guide 10 11 12 13 Chapter 2 Command Summary Front Panel to SCPI Command Map NITitiate MMediate TRIGger SEQuence HOLDoff SENSe FREQuency OFFSet SENSe POWer AC REFerence SENSe AVERage COUNt SENSe AVERage STATe SYSTem COMMunicate GPIB ADDRess SENSe FREQuency RESolution DISPlay BACKground STATe SENSe FUNCtion SENSe POWer AC REFerence STATe SENSel FREQuency OFFSet STATe SENSe FUNCtion Figure 2 1 Front Panel Control to SCPI Command Map Part 2 of 2 Programming Guide 2 5 Chapter 2 Command Summary Front Panel to SCPI Command Map Shift Menu REF OSC 3 RECALL J l 4 CH1 LPF j 5 FM 6 BAUD 7 PRESET 8 Instrument ID j 9 OP HRS j 10 BATT VOLTAGE 11 DO SELF TEST 4 12 PWR CORR j Figure 2 2 Front Panel Menu to SCPI Command Map Part 1 of 2 2 6 Programming Guide 10 11 12 Ch
12. When INIT CONT is OFF the holdoff has no effect There is no setting for this command that corresponds to the front panel rate setting of HOLD The HOLD mode is entered through RST or INIT CONT OFF The instrument then stops making measurements until it is triggered or until it receives INIT CONT ON RELATED Rate FRONT PANEL KEYS i Programming Guide 4 43 Chapter 4 Command Reference Common Commands Common Commands The IEEE 488 2 Common Commands are general purpose commands that are common to all instruments as defined in IEEE 488 2 These commands are generally not related to measurement configuration They are used for functions like resetting the instrument identification or synchronization 4 44 Programming Guide COMMAND COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference Common Commands CLS Clear Status Command CLS Clears all event registers summarized in the status byte Standard Event Status Register Operation Event Status Register and Questionable Data Event Status Register and clears the Error Queue The CLS command does not clear data memories or any other settings CLS places the instrument in Operation Complete Idle State and Operation Complete Query Idle State IEEE 488 2 This results in the disabling of any prior OPC command If CLS immediately follows a program message terminator the output queue and the MAV bit
13. 5 8 Too much data 5 10 totalize 4 27 4 28 TRACking 2 16 4 26 Transition Filter 3 34 transition filter 4 35 TRIGger 2 5 2 18 4 43 trigger 2 11 device 4 46 command 4 58 error 5 9 ignored 5 10 i system 2 13 Turbo C using 3 55 U Li Unaffected by RST 2 19 see Al Undefined header 5 8 Le URQ 3 31 user settings 2 11 using internal reference status bit 3 38 Index 8 Programming Guide Technical Support If you need technical assistance with a Hewlett Packard test and measurement product or application please contact the Hewlett Packard office or distributor in your country Asia Pacific Hong Kong 852 2599 7889 india 91 11 647 2311 Japan Hewlett Packard Japan Ltd Measurement Assistance Center 9 1 Takakura Cho Hachioji Shi Tokyo 192 Japan Tel 81 426 56 7832 Fax 81 426 56 7840 Korea 82 2 769 0800 Malaysia 60 3 291 0213 Philippines 63 2 894 1451 PRC 86 10 505 0149 Singapore 1800 292 8100 Taiwan 886 2 492 9666 Thailand 66 2 661 3900 For Countries in Asia Pacific not listed contact Hewlett Packard Asia Pacific Ltd 17 2U F Shell Tower Times Square 1 Matheson Street Causeway Bay Hong Kong Tele 852 2599 7777 Fax 852 2506 9285 Australia New Zealand Hewlett Packard Australia Ltd 31 41 Joseph Street Blackburn Victoria 3130 Australia 1 800 629 485 Canada Hewlett Packard Canada Ltd 5150 Spectrum Way Mississauga
14. 7 Remote Local Operation pg 3 11 Common Command Format pg 3 12 SCPI Command and Query Format pg 3 12 Abbreviated Commands pg 3 14 Optional Keyword pg 8 14 e Parameter Types pg 3 16 Parameter Separator pg 3 17 Command Terminator pg 3 18 e Program Messages pg 3 19 e Response Messages pg 3 21 Programming Examples Making a Frequency Measurement HP BASIC pg 3 56 Making a Frequency Measurement QuickBASIC pg 8 57 Making a Frequency Measurement C pg 3 58 3 4 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer Connecting the Counter to a Computer To program the Counter to operate remotely you need to interface the Counter with a computer The HP 53150A 53151A and 53152A Microwave Frequency Counters provide two interfaces for remote computer controlled operation HP IB and RS 232 The following sections describe how to connect and configure both interfaces for remote Counter operation To Connect With the HP IB To connect the Counter to a computer using the HP IB install an HP IB cable such as the HP 10833A cable between the two units as shown in Figure 3 1 Computer Rear Panel HP 10833A B C D HP iB Cable Counter Rear Panel Figure 3 1 HP IB Interconnection Configuring the HP IB The Counter s HP IB operates in Addressed talk listen mode which provides bi directional communicatio
15. Chan Select Display Power Offset On Off Frequency Offset On Off Power Up Arrow Down Arrow Left Arrow Right Arrow lto 15 The Key Queue is unaffected by SAV RCL Key commands are sequential but only in terms of processing other key commands or getting into the Key Queue The operation performed by the key command is not guaranteed to be complete before processing of the next non key command Be aware of this when intermixing key commands and non key commands None SYSTem VERSion Queries the SCPI version number with which the Counter complies e Numeric data transferred as ASCII bytes in lt NR2 gt format The response is an lt NR2 gt formatted numeric value which has the form YYYY V where YYYY represents the year and V represents an approved version for that year None 4 42 Programming Guide Chapter 4 Command Reference TRIGger Subsystem TRIGger Subsystem COMMAND TRIGger SEQuence STARt HOLDoff lt numeric_value gt When INIT CONT is ON this command determines the rate at which measurements are made by setting a delay between measurements Its setting corresponds to the front panel rate setting as follows lt NUMERIC_VALUE gt 0 0 FAST 0 5 MEDium 1 0 SLOW RATE COMMENTS RST 0 0 e The only settings that are accepted are the three listed above The measurement rate is also affected by the Resolution setting
16. DISPLAY are both acceptable forms Other forms of DISPlay such as DISPL or DISPLA are illegal and they generate errors You may use upper and or lower case letters Therefore DISPLAY display and DiSpLaY are all acceptable Keyword Separator A colon always separates one keyword from the next lower level keyword as shown below DISPlay ENABle Optional Keyword Optional keywords are those which appear in square brackets in the command syntax Note that the brackets are not part of the command and are not sent to the Counter Suppose you send a second level keyword without the preceding optional keyword In this case the Counter assumes you intend to use the optional keyword and responds as if you had sent it 3 14 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Examine the portion of the SENSe subsystem shown below SENSe FREQuency RESolution The root level keyword SENSe is an optional keyword To set the Counter s frequency resolution you can use either of the following iSENS FREQ RES or FREQ RES Programming Guide 3 15 Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Parameter Types Table 3 1 contains explanations and examples of parameter types Parameter types may be numeric value Boolean literal NRf string non decimal numeric or arbitrary block Table 3 1 Command and
17. FRONT PANEL KEYS i i i Programming Guide 4 61 Chapter 4 Command Reference Common Commands 4 62 Programming Guide Errors Chapter 5 Errors Introduction Introduction This chapter explains how to read error messages from the Counter discusses the types of errors and provides a table of all of the Counter s error messages and their probable causes 5 2 Programming Guide Chapter 5 Errors Reading an Error Reading an Error Executing the SYSTem ERRor command reads the oldest error from the error queue and erases that error from the queue The SYST ERR response has the form lt error number gt lt error string gt An example response is 113 Undefined header All errors set a corresponding bit in the Standard Event Status Register see the section titled Standard Event Status Register Group on page 3 30 The following short program reads all errors one at a time oldest to newest from the error queue As each error is read it is automatically erased from the error queue When the error queue becomes empty that is when all errors have been read from the queue further queries return the 0 No error response 10 ASSIGN Cnir TO 703 20 Assign path name 30 DIM Err_string 255 40 ICreates array for error string 50 REPEAT 60 Repeats until error queue is empty 70 OUTPUT Cntr SYST ERR 80 Read error number and string 90
18. HPIB FRONT PANEL KEYS Programming Guide 4 39 COMMAND lt NUMERIC_VALUE gt RANGE QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS COMMAND QUERY RESPONSE Chapter 4 Command Reference SYSTem Subsystem SYSTem COMMunicate SERial BAUD lt numeric_value gt Sets or queries the baud rate The possible BAUD rate values that can be entered for the lt numeric_value gt parameter are 1200 2400 4800 9600 14400 and 19200 yf ae Numeric data transferred as ASCII bytes in lt NR1 gt format gt This value is unaffected by RST To change the Baud rate used at power on save the instrument settings using the SAV 0 command after changing the Baud rate Shift Menu BAUD gt 19200 14400 9600 4800 2400 1200 SYSTem ERRor Queries the oldest error in the Error Queue and removes that error from the queue first in first out See Chapter 5 Errors for detailed error information gt The response is in the following form lt error_number gt lt error_description gt e The lt error_number gt is an integer in the range 32768 32767 The negative error numbers are defined by the SCPI standard positive error numbers are particular to this Counter An error number value of zero indicates that the Error Queue is empty The maximum length of the lt error_description gt is 255 characters 4 40 Programming Guide Chapter 4 Command Refe
19. This HP BASIC manual contains a good non technical description of the HP IB IEEE 488 1 interface in Chapter 12 The HP IB Interface Subsequent revisions of HP BASIC may use a slightly different title for this manual or chapter This manual is the best reference on I O for HP BASIC programmers To obtain a copy of this manual contact your nearest Hewlett Packard Sales office 8 Hewlett Packard Company Tutorial Description of the Hewlett Packard Interface Bus 1987 To obtain a copy of this manual contact your nearest Hewlett Packard Sales office Programming Guide 1 9 Chapter 1 Before You Start Related Documentation 1 10 Programming Guide Command Summary A Quick Reference Chapter 2 Command Summary Introduction Introduction This chapter is a quick reference that summarizes the Counter s programming commands Chapter Summary Front Panel to SCPI Command Map HP 53150A 151A4 152A Command Summary SCPI Conformance Information IEEE 488 2 Common Commands HP 53150A 151A4 152A SCPI Subsystem Commands RST Response pg 2 3 pg 2 8 pg 2 8 pg 2 9 pg 2 12 pg 2 19 1 The section titled Front Panel to SCPI Command Map provides maps that show the front panel keys and their corresponding or related SCPI commands 2 The section titled HP 53150A 151A 152A Command Summary lists the IEEE 488 2 Common Commands and SCPI Subsystem commands in Tabl
20. are cleared since any new program message after a program message terminator clears the output queue This command clears any displayed error message from the front panel If the front panel is displaying any menu when CLS is received the menu is abandoned equivalent to pressing the Clear key Clear Programming Guide 4 45 COMMAND QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference Common Commands DDT lt arbitrary block gt Define Device Trigger Command DDT Define Device Trigger Query DDT DDT Sets or queries the action that the device executes when it receives the TEEE 488 1 Group Execute Trigger GET interface message page 4 7 or a TRG common command e Definite length block e The query response is one of the following terminated with a new line and EOI 141NIT 216INIT WAL DATA 0 I5BFETC 15READ RST 18INIT IMM e Ifazero length lt arbitrary block gt is specified as the parameter the Counter does nothing when it receives a GET or T RG command None 4 46 Programming Guide Chapter 4 Command Reference Common Commands ESE Standard Event Status Enable Command ESE Standard Event Status Enable Query COMMAND ESE lt NRf gt lt non decimal numeric gt ESE Sets or queries the Standard Event Status Enable Register shown in Figure 4 3 The parameter and query response value when rou
21. by are referenced to the same level as the bey preceding command if no is present immediately after the command separator the semicolon EE For example sending SENS AVER COUN 5 STAT ON is equivalent to sending SENS AVER COUN 5 SENS AVER STAT ON or SENS AVER COUN 5 SENS AVER STAT ON The must be present to distinguish another root level command For example SENS AVER COUN 5 INIT CONT OFF is equivalent to sending SENS AVER COUN 5 INIT CONT OFF If the which is following the and is in front of INIT is omitted the Counter assumes that the second command is SENS AVER INIT CONT OFF and generates a syntax error 3 20 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Overview of Response Message Formats Overview of Response Message Formats Response Messages Response messages are data sent from the Counter to a computer in response to a query A query is a command followed by a question mark Queries are used to find out how the Counter is currently configured and to transfer data from the Counter to the computer After receiving a query the Counter interrogates the requested configuration and places the response in its output queue The output message remains in the queue until it is read or another command is issued When read the message is transmitted across the HP IB or the serial interface to the computer You read
22. consists of ASCII characters enclosed by double quotes For example string data is used for the lt error description gt portion of SYST ERR response and for SENS FUNC response definite length The syntax is a pound sign followed by a non zero digit representing the block gt number of digits in the subsequent decimal integer The decimal integer specifies the number of 8 bit data bytes being sent This is followed by the actual data The terminator is a line feed asserted with EOI For example for transmitting 8 bytes of data the format might be Number of digits that follow Actual data Terminator p mn 208 lt 8 bytes of data gt lt new line gt EO Number of bytes to be transmitted The 2 indicates the number of digits that follow and the two digits 08 indicate the number of data bytes to be transmitted A zero length block has the format 0 lt new line gt EO lt new line gt is defined as a single ASCll encoded byte corresponding to 10 decimal 3 24 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Status Reporting Status Reporting The HP 53150A 53151A and 53152A status registers conform to the SCPI and IEEE 488 2 standards Figure 3 10 shows all of the status register groups and queues in the Counter This is a high level diagram that does not show all the registers that are contained in each group It is intend
23. sensor_function gt s to be sensed by the instrument Selects the lt sensor_function gt s to be turned OFF Selects the lt sensor_function gt to be sensed by the instrument Query that returns a Boolean value which indicates whether the specified lt sensor_function gt is ON or OFF Subtree Configures the instrument for power measurement on channel 2 Sets a reference amplitude in dB for display of power measurements Determines whether amplitude is measured in absolute or relative mode Subtree Controls the reference oscillator Sets the selection of a reference timebase INTernal or EXTernal 2 16 Programming Guide Chapter 2 Command Summary HP 53150A 151A 152A Command Summary Table 2 2 HP 53150A 151A 152A SCPI Command Summary Continued Keyword Syntax Parameter Form Sid New Comments STATus Subsystem Controls the SCPI defined Operation and Questionable status reporting structures OPERation Std Subtree CONDition Std Query only Queries the Operation Condition Status Register ENABle lt non decimalnumeric gt lt NRf gt Std Sets the Operation Event Status Enable Register LEVEN Std Query only Queries and then clears the Operation Event Status Register NTRansition lt non decimalnumeric gt lt NRi gt Std Sets and queries the negative transition filter for the Operation status reporting structure PTRansition lt non decim
24. setting is returned If you send the MIN parameter using AVER COUN MIN the command returns the minimum acceptable count If you send the MAX parameter the command returns the maximum level currently available Be sure to place a space between the question mark and the parameter Suffixes A suffix is the combination of suffix elements and multipliers that can be used to interpret some lt numeric value gt If a suffix is not specified the Counter assumes that lt numeric value gt is unscaled that is Volts seconds etc For example the following two commands are equivalent OUTPUT 703 FREQ RES 1KHz OUTPUT 703 FREQ RES 1E 3 Suffix Elements Suffix elements such as HZ Hertz S seconds V volts OHM Ohms PCT percent and DEG degrees are allowed within this format Programming Guide 3 17 Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Suffix Multipliers Table 3 2 lists the suffix multipliers that can be used with suffix elements except PCT and DEG Table 3 2 Suffix Multipliers MNEMONIC NAME MA or M for OHM and HZ except for OHM and HZ The suffix units MHZ and MOHM are special cases that should not be confused with lt suffix muitiplier gt HZ and lt suffix multiplier gt OHM Command Terminator Acommand may be terminated with a lt new line gt ASCII character decimal 10 an EOI End o
25. the command setting can be queried by omitting the parameter and appending a to the last command keyword For example ROSC SOUR INT EXT can be queried with sROSC SOUR Unless otherwise noted a command described as an event cannot be queried Unless otherwise noted the command setting is affected by SAV FRCL The square brackets are used to indicate that the element s within the brackets are optional Note the brackets are NOT part of the command and should not be sent to the Counter The vertical bar is used to mean OR and is used to separate alternative options 4 2 Programming Guide Chapter 4 Command Reference Introduction The short form of keywords is shown in uppercase e Quotation marks may be part of the command s parameter the quotation marks shown must be sent to the Counter Unless otherwise noted a command is sequential not overlapped See Chapter 3 of this guide for details regarding command syntax parameter types and query response types i i Programming Guide 4 3 COMMAND COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference ABORt Command ABORt Command ABORt This command causes the Counter to abort as quickly as possible any measurement in progress The ABORt command is not complete until the current measurement is stopped The execution of an ABORt command sets false any Pending Operation F
26. the same syntax as SCPI lt channel_list gt For example the Frequency function uses 1 to specify channel 1 If the instrument receives an unexpected parameter it processes the command ignoring the unexpected parameter and sets the Command Warning bit of the Data Questionable status reporting structure The response format for MEASure query READ and FETCh is ASCII data If no valid data is available the Counter generates error 230 Data corrupt or stale Programming Guide 4 11 COMMAND COMMENTS COMMAND QUERY RESPONSE COMMENTS Chapter 4 Command Reference MEASure Subsystem CONFigure SCALar lt function gt lt parameters gt lt source_list gt Configures the instrument to perform the specified function but does not initiate the measurement Aa Use INITiate FETCh or READ to make and query a measurement e Parameters other than lt source_list gt can be defaulted by substituting the keyword DEFault The lt source_list gt parameter can be defaulted by omitting it The default values are specified by the particular function description This command defaults several Counter settings To change the e function only while leaving all other Counter settings as they are use SENSILFUNCLON e Ifan lt expected_value gt parameter is outside the measurement capabilities of the Counter model an error is generated and the command does not execute e For POWer lt reso
27. 11 Acquiring indicates that the counter is searching for a signal The condition bit is high while the counter is searching It goes low when a search is complete whether or not a signal was found Ifa signal was not found the bit goes high again after a delay when the next search begins e Bit 12 Locked a value of 1 indicates that the counter has found a measurable signal and has locked onto it e Bits 13 15 are not used 3 38 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Status Reporting Questionable Data Status Register Group The Questionable Data Status Register Group monitors SCPI defined conditions NOTE For this register group the transition filter is fixed as PTR with all bits set to ones This cannot be changed or queried Table lists the Questionable Data Status Register bits and briefly describes each bit Table 3 8 Questionable Data Status Register DESCRIPTION 0 Not used 3 8 Power 4 Not used 5 32 Frequency 6 11 oa Not used 12 4096 Hardware Summary 13 Not Used 14 16384 Command Warning 15 Not used since some controllers may have difficulty reading a 16 bit unsigned integer The value of this bit is always 0 A detailed description of each bit in the Questionable Data Status Register Group follows o Bits 0 2 are not used e Bit 3 Power Power Cal is turned off or the Power Cal ta
28. 2 12 RST Response 2 19 Programming Your Counter for Remote Operation Introduction 3 2 Chapter Summary 3 3 Where to Find Some Specific Information 3 4 Programming Examples 3 4 Programming Guide iii Contents Connecting the Counter to a Computer 3 5 To Connect With the HP IB 3 5 IEEE 488 1 Interface Capabilities 38 6 To Connect With the RS 232 Serial Interface 3 7 ra Remote Local Operation 3 11 38 11 Overview of Command Types and Formats 3 12 Common Command Format 3 12 SCPI Command and Query Format 3 12 Elements of SCPI Commands 3 13 Subsystem Command Syntax 3 13 Common Command Syntax 3 13 Abbreviated Commands 3 14 Keyword Separator 3 14 Optional Keyword 3 14 Parameter Types 3 16 Parameter Separator 3 17 Query Parameters 3 17 Suffixes 3 17 Command Terminator 3 18 Using Multiple Commands 3 19 Program Messages 3 19 Program Message Syntax 3 19 Overview of Response Message Formats 3 21 Response Messages 3 21 Response Message Syntax 3 21 Response Message Data Types 3 23 iv Programming Guide Contents Status Reporting 3 25 Status Byte Register and Service Request Enable Register 3 27 Standard Event Status Register Group 3 30 The Operation and Questionable Data Status Register Groups 3 33 f Programming the Counter for Status Reporting 3 41 Determining the Condition of the Counter 3 41 Resetting the Counter and Clearing the Remote Interface Example 1 3 42 Using the Standard Event Status Registe
29. 3 The OPC command to assert SRQ The following discussion shows how to use these three commands Resetting the Counter and Clearing the Interface Before attempting any programming it is best to set the Counter to a known state The following command grouping illustrates how to reset the Counter Before issuing these commands execute a device clear to reset the interface and the Counter You should consult your interface card s documentation for information on issuing a device clear since the device clear command is specific to the interface you are using Perform the following steps 1 Issue an Interface Clear and a Device Clear See your computer or interface card documentation for information on how to issue this command 2 Issue the following commands RST CLS SRE 0 ESE 0 STAT PRES 3 48 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements Using the WAI Command This command is most useful when only the Counter is on the bus and you want the Counter to send the data when it is ready In this example the Counter is instructed to take 50 measurements and return the average for these 50 measurements The WAI command that follows the INIT command instructs the Counter to hold off execution of any further commands until the 50 measurements are complete When the Counter has completed the 50 measurements and averages it executes
30. 4 Programming Guide Chapter 4 Command Reference SENSe Subsystem COMMAND SENSe FREQuency OFFSet lt numeric_value gt lt frequency unit gt Sets a reference frequency for all other absolute frequency settings in the instrument RANGE The acceptable range for the lt numeric_value gt parameter is 0 to 50 GHz UNITS The offset frequency can be specified in Hz KHz or MHz only COMMENTS This command does not affect the hardware settings of the instrument It affects only the entered and displayed frequencies The Counter accepts only six digits of resolution for an offset entry through this command For example the command FREQ OFFSet 12345 678912MHz results in an offset of approximately 12 3456 GHz i The coupling equation for this command is Entered Displayed frequency Hardwarefrequency offset RELATED Freq Offset FRONT PANEL KEYS COMMAND SENSe FREQuency OFFSet STATe lt Boolean gt When FREQuency OF FSet is ON the frequency measurement results are modified by the setting of FREQ OFFset before being displayed or reported in response to a query RELATED Freq Offset FRONT PANEL KEYS Programming Guide 4 25 COMMAND COMMENTS RELATED FRONT PANEL KEYS COMMAND COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference SENSe Subsystem SENSe FREQuency RESolution lt numeric_value gt lt frequency_unit gt Sets the resolut
31. 7 l 4 5 a i PEN Standard Status Data Struturel Queue Not Empty ouR ae BY 7 Service Request Enable and Status Byte Registers i Read by Serial Poli l read registers I t 1 Gery Counter to read the Output Queue Read with STB i I LE Not Bits p ee ie tot MSS l l Operation Complete 3 ikas EN a 2 i Not Used 4 5 cay 8 3 6 i ERROR abo Query Eroria 2 h S ESA E l 4 a Service spa QUEUE L Device Dependent Error Lhat 3 Lon F ESR 82 5 gt G Becucs i Interrupt i Executon Enor Sle a Jo HOS teal semea E Serea 1o Conouer kia commana Error Slat mh SSB 128 y 2 i we Not Used 6 Use 428 L Use SRE lt NRf gt and SySTomn FRO i Power One 7 gt re to control and read l to query the i the Service Reques Enor Queue Use ESR ESE lt NRt gt Enable nease l and ESE to controt and i 1 am Operation Status Register Group en 7 Bits Not Used 0 my Not Used mmm 1 to 3 Measuring BL a p Waiting tor Trigger 2 5 z Not USed mmml 7 t0 8 f gt 2 Using internal Reterence 12a 9 p 8 Not Used m gt 0 j i Acquiring 2048 F 43 Looked 4998 12 Not Used 1310 15 t Use STATus OPERation Commands d to control and read registers Figure 3 10 53150A 151A 152A SCPI Status Reporting Summary Functional Di
32. A 152A SCPI Command Summary Continued Parameter Form Keyword Syntax MEMory CLEAr NAME lt name gt DATA lt name gt lt data gt DATA lt name gt NSTates Std New Std Std Std Std Comments Subsystem Manages instrument memory Event no query Restores the frequency values in the named correction profile to the default values and sets all loss values to zero Stores data in the named correction profile Queries the data in the named correction profile Query only Returns the number of available SAV RCL states in the instrument READ See Measurement Instructions in this table SENSe AVERage STATe lt Boolean gt COUNt lt numeric_value gt CORRection CSET SELect lt character_data gt CORR1 CORR2 CORRS STATe lt Boolean gt DATA lt data_handie gt XNONe FREQuency 1 2 XNONe POWer 2 FiLTer FM AUTO lt Boolean gt New New New Std Std Std Std Std Std Std New Subsystem setup commands Subtree Configures the averaging function Turns averaging ON and OFF Specifies the number of measurements to combine when AVERage STATe is ON Subtree Configures the power correction function Selects a power correction profile When STATe is ON power measurements are modified according to the data in the correction profile selected with SELect Query only Returns the current measurement result data of
33. ATe lt Boolean gt Turns the display backlight ON or OFF QUERY RESPONSE Single ASCII encoded byte 0 or 1 A value of 0 indicates OFF a value of 1 indicates ON COMMENTS gt RST ON Turning the display backlight OFF conserves battery power if the Counter has the Battery option Ifthe Counter is operating from battery power Battery option required the display backlight is automatically turned off after a period of inactivity When activity is subsequently detected a measurable signal is applied a front panel key is pressed or a setting is changed by a command sent over the HP IB or the RS 232 interface the display backlight is restored to its previous state e if the backlight was set to OFF it remains off if the backlight was set to ON it is turned on RELATED amp On Off Shift Clear FRONT PANEL KEYS Programming Guide 4 5 Chapter 4 Command Reference DISPlay Subsystem COMMAND _ DISPlay ENABle lt Boolean gt Sets or queries whether the entire display annunciators and indicators pn with the exception of Rmt is visible Lae QUERY RESPONSE Single ASCII encoded byte 0 or 1 ma f e A value of 0 indicates OFF a value of 1 indicates ON i COMMENTS RST ON This value is unaffected by SAV RCL RELATED None FRONT PANEL KEYS 4 6 Programming Guide COMMAND RELATED FRONT PANEL KEYS Chapter 4 Command Reference Group Execute Trigger GET Group Exe
34. Commands Summary Table 4 49 2 10 FETCh 2 13 COMMunicate 2 5 2 7 2 18 4 39 4 40 ndentification Query 2 10 CONDition 4 32 4 36 INITiate 2 13 Condition Register 3 33 3 34 3 37 NPut 2 13 CONFigure 2 13 2 14 4 10 4 11 4 12 nstrument Status 4 50 CONFigure with INITiate and FETCh Instrument Status Query 2 10 4 19 operation complete 2 10 CONFigure 4 12 Operation Complete Command 4 51 configuring the HP IB 3 5 Operation Complete Query 2 10 conformance 4 51 IEEE488 2 2 8 2 9 4 44 Parallel Poll Enable Register 2 10 connecting the Counter to a Computer 4 52 3 5 Parallel Poll Enable Register Query connecting with the HP IB 3 5 2 10 connecting with the RS 232 serial Recall 2 10 interface 3 7 Recall command 4 52 CORRection 2 7 2 15 4 23 Reset 2 10 correction profile 2 15 Reset command 4 53 COUNT 2 15 4 22 Save 2 11 OSET 2 15 4 23 Save command 4 54 D Self Test Query 2 11 4 59 g Service Request Enable 2 11 DATA 2 15 4 20 data corrupt or stale 5 10 data out of range 5 10 Index 2 Programming Guide Index data type error 5 8 data measurement 4 24 DATA 2 15 data point 4 20 DDE 3 31 Define Device Trigger Command 2 10 Define Device Trigger Query 2 10 Device or Counter Specific Error 5 7 device trigger 4 46 device dependent error definition 5 7 device specific error 5 10 device specific error status bit 3 32 DISPlay 2 13 4 5 display 2 13 enable 4 6 double quoted string sending a double quoted string 3 54 duty c
35. D AND MET CAUTION Damage to equipment or incorrect measurement data may result from failure to heed a caution Do not proceed beyond a CAUTION until the indicated conditions are fully understood and met Safety Earth Ground An uninterruptible safety earth ground must be maintained from the mains power source to the product s ground circuitry WARNING WHEN MEASURING POWER LINE SIGNALS BE EXTREMELY CAREFUL AND ALWAYS USE A STEP DOWN ISOLATION TRANSFORMER WHICH OUTPUT IS COMPATIBLE WITH THE INPUT MEASUREMENT CAPABILITIES OF THIS PRODUCT THIS PRODUCT S FRONT AND REAR PANELS ARE TYPCIALLY AT EARTH GROUND THUS NEVER TRY TO MEASURE AC POWER LINE SIGNALS WITHOUT AN ISOLATION TRANSFORMER For additional safety and acoustic noise information see back matter Hewlett Packard Company Santa Clara Division 5301 Stevens Creek Boulevard Santa Clara California 95052 8059 Contents Before You Start Introduction 1 2 Getting Started 1 3 How to Use This Guide 1 3 New Users 1 4 Experienced Programmers 1 5 Applications 1 5 Programming Guide Contents 1 6 Assumptions 1 7 Related Documentation 1 8 Command Summary Introduction 2 2 Chapter Summary 2 2 Front Panel to SCPI Command Map 2 3 HP 531504 1514 152A Command Summary 2 8 SCPI Conformance Information 2 8 IEEE 488 2 Common Commands 2 9 HP 53150A 151A 152A SCPI Subsystem Commands 2 12 Std New Column 2 12 Parameter Form Column
36. ENTER CntrErr_num Err_string 100 Enter error number and string 110 PRINT Err_num Err_string 120 Print error number and string 130 UNTIL Err_num 0 140 END Programming Guide 5 3 Chapter 5 Errors Error Queue Error Queue As errors are detected they are placed in an error queue The error queue is a first in first out queue That is if more than one error has occurred the first error in the queue is read out with SYST ERR Subsequent responses to SYST ERR continue until the queue is empty If the error queue overflows the last error in the queue is replaced with error 350 Queue overflow Any time the queue overflows the least recent errors remain in the queue and the most recent error is discarded The length of the Counter s error queue is 10 9 positions for the error messages and 1 position for the Queue overflow error Reading an error from the head of the queue removes that error from the queue and opens a position at the tail of the queue for a new error if one is subsequently detected When all errors have been read from the queue further error queries return 0 No error The error queue is cleared when any of the following events occur gt Power on Receipt of a CLS command The last item is read from the queue 5 4 Programming Guide Chapter 5 Errors Error Types Error Types Error numbers are categorized by type as shown in Table 5 1 The erro
37. IN MAX DEF default 100 MHz stesolution gt description The value specifies the frequency resolution for the measurement values THz 10 Hz 100 Hz 1 KHz 10 KHz 100 KHz 1 MHz DEF default 1 Hz source list gt description Specifies which front panel input is used for the measurement values 1 2 default 2 response format lt NR1 gt 4 16 Programming Guide Chapter 4 Command Reference MEASure Subsystem MEASure SCALar POWer AC lt expected_value gt lt resolution gt 2 This command measures power FUNCTION value DESCRIPTION range 40 to 10 dBm default 0 00 resolution 0 01 sresolution gt l j i i description lt resolution gt is supported only for compatibility with other instruments values 0 01 dB MIN MAX DEF i default 0 01 dB lt source_list gt description Specifies which front panel input is used for the measurement values DEF 2 default 2 response format lt NR2 gt Power values are returned in dBm How to Use the Measurement Instruction Commands The Measure Instruction commands have a different level of compatibility and flexibility than other commands The parameters used with commands from the Measure Instruction describe the signal you are going to measure This means that the Measure Instructions give compatibility between instruments since you do not need to know anything about the instrument you are using
38. NRf gt SRE lt NRf gt Chapter 2 Command Summary HP 53150A 151A 152A Command Summary Common Commands Command Name Clear Status Define Device Trigger Command Define Device Trigger Query Standard Event Status Enable Standard Event Status Enable Query Event Status Register Query Identification Query Instrument Status Query Operation Complete Operation Complete Query Parallel Poll Enable Register Parallel Poll Enable Register Query Recall Service Request Enable Function Clears all event status registers summarized in the status byte and empties the Error Queue Defines which command is executed when the Counter receives a GET or TRG command Queries which command is executed when the Counter receives a GET or TRG command Sets the Standard Event Status Enable Register Queries the Standard Event Status Enable Register Queries and then clears the Standard Event Status Register Queries the Counter identification Queries the current state of the parallel poll response Instrument Status Causes Counter to set the operation complete bit in the Standard Event Status Register when all pending operations see Note at the end of table are finished Places an ASCII 1 in the Output Queue when ail pending operations see Note at the end of table are completed Sets the value of the Parallel Poll Enable register Queries the value of the Parallel Poll Enable register Restor
39. P 53150A 151A 152A SCPI Command Summary Continued Keyword Syntax Parameter Form Std New Comments Measurement Instructions CONFigure SCALar lt function gt See lt parameters gt Configures the and lt source_list gt instrument to perform the below specified measurement CONFigure Returns the function configured by the last CONFigure or MEASure command MEASure SCALar lt tunction gt See lt parameters gt Configures the and lt source_list gt instrument initiates below measurement and queries for the result i e provides a complete measurement sequence READ SCALar lt function gt Initiates measurement and queries for the result Performs a FETCH on fresh data tFETCh SCALar lt function gt Queries the measurement made by a previous MEASure READ or INITiate command The lt function gt and corresponding lt parameters gt and lt source_list gt are defined below lt function gt lt parameters gt L lt source_list gt Std New VOLTage F REQuency lt expected_value gt lt 1 2 POWer AC resolution gt 2 lt expected_value gt lt resolution gt lt source list has the same syntax as SCPI lt channel_list gt For example a frequency measurement on channel 2 uses 2 to specify channel 2 2 14 Programming Guide Chapter 2 Command Summary HP 53150A 151A 152A Command Summary Table 2 2 HP 53150A 151
40. P will at its option either repair or replace products which prove to be defective Replacement products may be either new or like new HP warrants that HP software will not fail to execute its programming instructions for the period specified above due to defects in material and workmanship when properly installed and used If HP receives notice of such defects during the warranty period HP will replace software media which does not execute its programming instructions due to such defects For detailed warranty information see back matter Safety Considerations General This product and related documentation must be reviewed for familiarization with this safety markings and instructions before operation Before Cleaning Disconnect the product from operating power before cleaning Warning Symbols That May Be Used In This Book gt Jnstruction manual symbol the product will be marked with this symbol when it is necessary for the user to refer to the instruction manual NS Indicates hazardous voltages IH Indicates earth ground terminal L g Indicates terminal is connected to chassis when such connection is not apparent Indicates Alternating current Indicates Direct current Safety Considerations contd WARNING BODILY INJURY OR DEATH MAY RESULT FROM FAILURE TO HEED A WARNING DO NOT PROCEED BEYOND A WARNING UNTIL THE INDICATED CONDITIONS ARE FULLY UNDERSTOO
41. Query Parameter Types TYPE EXPLANATIONS AND EXAMPLES lt numeric value gt lt Boolean gt lt literal gt lt NRf gt lt string gt lt non decimal numeric gt lt arbitrary block gt Accepts all commonly used decimal representation of numbers including optional signs decimal points and scientific notation 123 123e2 123 1 23e2 123 1 23e 2 1 23000E 01 Special cases include MINimum and MAXimum as follows MINimum selects minimum value available and MAXimum selects maximum value available Queries using MINimum or MAXimum return the associated numeric value Represents a single binary condition that is either true or false 1 or ON 0 or OFF Query response returns only 1 or 0 An lt NRf gt is rounded to an integer A non zero value is interpreted as 1 Selects from a finite number of choices These parameters use mnemonics to represent each valid setting An example is the INPut COUPling AC DC command parameters AC DC Flexible numeric representation A string parameter is delimited by either single quotes or double quotes Within the quotes any characters in the ASCII 7 bit code may be specified The following HP BASIC statement sends a command containing a lt string gt parameter OUTPUT 703 FUNC FREQ Format for specifying hexadecimal H1F octal Q1077 and binary B10101011 numbers using ASCII characters May be used in STATus subsys
42. RESolution lt numeric_value gt frequency unit gt 1 Hz SENSe FREQuency TRACking lt character_program_data gt SLOW SENSe FUNCtion OFF lt sensor_function gt FREQuency 1 i POWer 2 SENSe FUNCtion ON lt sensor_function gt FREQuency 2 SENSe POWer AC REFerence lt numeric_value gt 0 SENSe POWer AC REFerence STATe lt Boolean gt OFF SENSe ROSCillator SOURce INTernal EXTernal lt Boolean gt INTernal TRIGger SEQuence HOLDoftt lt numeric value gt 0 Programming Guide 2 19 Chapter 2 Command Summary RST Response Tabie 2 4 Unaffected by RST ESE PRE SRE MEMory NSTates STATus subsystem all command settings SYSTem subsystem all command settings Programming Guide Programming Your Counter for Remote Operation NOTE Chapter 3 Programming Your Counter for Remote Operation Introduction Introduction This chapter provides remote operation setup and programming ey information You can use this information to configure the Counter to iA operate as a remote device Most of this chapter deals with programming the HP 53150A 151A 152A Counters using SCPI and IEEE 488 2 commands With two minor exceptions the only difference between programming these Counters using the HP IB interface and the RS 232 serial interface is the manner in which you connect the Counter to the computer These exception
43. SCillator Subtree 4 30 STATus Subsystem 4 31 STATus OPERation Subtree 4 31 STATus QUEStionable Subtree 4 36 SYSTem Subsystem 4 39 SYSTem COMMunicate Subtree 4 39 vi Programming Guide Contents TRIGger Subsystem 4 43 Common Commands 4 44 CLS Clear Status Command 4 45 DDT Define Device Trigger Command DDT Define Device Trigger Query 4 46 ESE Standard Event Status Enable Command ESE Standard Event Status Enable Query 4 47 ESR Event Status Register Query 4 49 IDN Identification Query 4 50 IST Instrument Status 4 50 OPC Operation Complete Command 4 51 OPC Operation Complete Query 4 51 PRE Parallel Poll Enable Register 4 52 RCL Recall Command 4 52 RST Reset Command 4 53 SAV Save Command 4 54 SRE Service Request Enable Command SRE Service Request Enable Query 4 55 TRG Trigger Command 4 58 TST Self Test Query 4 59 WAI Wait to Continue Command 4 61 5 Errors Introduction 5 2 Reading an Error 5 3 Error Queue 5 4 Error Types 5 5 No Error 5 5 Command Error 5 6 Execution Error 5 6 Device or Counter Specific Error 5 7 Query Error 5 7 Error List 5 7 Programming Guide vii Contents viii Programming Guide Before You Start Chapter 1 Before You Start Introduction Introduction This programming guide contains programming information for the HP 53150A 53151A and 53152A M
44. Sure Subsystem For example use CONF FREQ 5 GHZ 1HZ to configure a default frequency measurement where 1 Hz is the required resolution and 5 GHz is the expected value Use READ to start the measurement and query the result Using CONFigure with INITiate and FETCh The READ query is composed of the INITiate command which starts the measurement and the FETCh command which returns the results to the controller For example use CONF FREQ 5 GHZ 1 HZ to configure for a default frequency measurement where 1 Hz is the required resolution and 5 GHz is the expected value Use INITIATE to start the measurement Use FETCH to query for result Programming Guide 4 19 Chapter 4 Command Reference MEMory Subsystem MEMory Subsystem This subsystem manages the instrument s memory i COMMAND MEMory DATA lt name gt lt data gt QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS Stores and queries data in the named power correction profile Data points are returned in lt definite length arbitrary block gt format A data point consists of two to ten comma separated NRf format m number pairs Valid profile names CORR1 CORR2 CORR9 Valid data is stored in non volatile memory Any error in a data block causes all data in that block to be ignored and the data currently in the named profile to be retained Data must be input in the form of t
45. UNTERMINATED Indicates that a condition causing an UNTERMINATED Query error occurred For example the Counter was addressed to talk and an incomplete program message was received Query DEADLOCKED Indicates that a condition causing a DEADLOCKED Query error I occurred For example both input buffer and output buffer are full and the Counter cannot continue Query UNTERMINATED after Indicates that a query was received in the same program message after indefinite response a query requesting an indefinite response for example IDN or OPT was executed Programming Guide 5 11 Chapter 5 Errors Error Types 5 12 Programming Guide Index CLS 2 10 5 4 5 5 DDT 2 10 4 46 DDT 2 10 4 46 ESE 2 10 4 47 ESE 2 10 4 47 ESR 2 10 4 49 IDN 2 7 2 10 4 50 IST 2 10 4 50 OPC 2 10 4 51 OPC 2 10 4 51 PRE 2 10 2 19 4 52 PRE 2 10 4 52 RCL 2 7 2 10 4 52 4 54 RST 2 7 2 10 4 53 affected setup 2 19 unaffected 2 19 unaffected setup 2 19 RST Response 2 2 2 19 RST summary list 2 19 SAV 2 7 2 11 4 54 SRE 2 11 2 20 4 55 SRE 2 11 4 55 STB 2 11 4 57 TRG 2 10 2 11 4 58 TST 2 7 2 11 4 59 WAI 2 11 4 61 A ABORI 2 13 4 4 ABORt command 4 4 ACSII 4 59 ADDRess 2 17 4 39 address HP IB 3 6 4 39 Applications 1 5 ASCH format 3 55 Assumptions 1 7 auto trigger 4 8 AVERage 2 5 2 15 4 22 STATe 2 15 averaging 2 15 B BACKgr
46. V RCL RELATED None FRONT PANEL KEYS i i 4 32 Programming Guide COMMAND QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference STATus Subsystem STATus OPERation EVENt Queries the status of the Operation Event Status Register Numeric data transferred as ASCII bytes in lt NR1 gt format Range is 0 to 32 767 The query response value is an integer formed by the binary weighting of bits The value of unused bits is zero Each event bit in the Operation Event Status Register corresponds to a specific condition bit in the Operation Condition Status Register this allows the Operation Event Status Register to detect changes in conditions An event becomes TRUE when the associated condition makes the transition specified by the transition filters The event bits once set are sticky i e they cannot be cleared until they are read even if they do not reflect the current status of a related condition The Operation Event Status Register is cleared by CLS by STAT OPERLEVEN and at power on None Programming Guide 4 33 COMMAND RANGE QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS COMMAND RANGE QUERY RESPONSE COMMENTS Chapter 4 Command Reference STATus Subsystem STATus OPERation NTRansition lt non decimal numeric gt lt NRf gt Sets or queries the negative transition filter for the Operation
47. agram 3 26 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Status Reporting Status Byte Register and Service Request Enable Register Error Event Queue Questionable Data Status Register Sege nane egele i T jis ticha Logical AND 7 0 8 0 Status of 1 On 7 Output Queue gt EAV gt 2 _ OSB gt lt 3 Standard Event gt MAV 4 Status Register gt ESB amp 5 Group gt ROS MSS lt OSB 7 Operation Status Register Group Service Logical OR Request Generation z SRQ interrupt to Computer Figure 3 11 Status Byte and Service Request Enable Status Byte Register The Status Byte Register is the summary level register in the status reporting structure It contains summary bits that monitor activity in the other status registers and queues as shown in Figure 3 11 The Status Byte Register is a live register its summary bits are set TRUE or FALSE one or zero by the presence or absence of the condition which is being summarized The Status Byte Register can be read with either a serial poll or the STB query but it is altered only when the state of the overlying status data structures is altered The entire Status Byte Register can be cleared by sending just the CLS command to the Counter in a program message Table 3 4
48. ailed description of the Service Request Enable Register lt NRF gt RANGE 0to255 The value of bit 6 is ignored lt NRF gt RESOLUTION 1 QUERY RESPONSE Numeric data transferred as ACSII bytes in lt NR1 gt format o The value of bit 6 is zero when queried Programming Guide 4 55 COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference Common Commands e At power on this value is cleared set to 0 gt This value is unaffected by RST CLS and SAV RCL None 4 56 Programming Guide Chapter 4 Command Reference Common Commands STB Status Byte Query COMMAND STB Queries the Status Byte Register shown in Figure 4 6 This register is cleared at power on This query does not directly alter the Status Byte Register including the MSS RQS bit or anything related to the generation of SRQ yet Bits se Gioi l 2 wjojaja io Figure 4 6 The Status Byte Register See the section titled Status Byte Register and Service Request Enable Register starting on page 3 27 for a detailed description of the Status Byte Register QUERY RESPONSE Numeric data transferred as ASCII bytes in lt NR1 gt format e Range is 0 to 255 e The response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the Status Byte Register e The value of unused bits is zero when queried
49. ailures that can be detected and their corresponding bit numbers are shown below Table 4 4 Self Test Error Values Tesi Failed it Test Failed Band 1 Signal Path ROM Band 1 Threshold Unused Band 2 RF Threshold Front Panel Hardware Band 2 IF Through Threshold HP IB Band 2 IF Heterodyne Threshold EEPROM Instrument Configuration Data Heterodyne Path EEPROM Service Data Through Path EEPROM Saved User Settings Data VCO EEPROM Power Calibration Data Counter Control FPGA EEPROM Write Power Measurement Hardware EEPROM Power Correction Data Unused ADC 12V Over Temperature 5V Unused The decimal weight of each bit is 2 where n is the bit number Programming Guide 4 59 Chapter 4 Command Reference Common Commands COMMENTS The following are tested CPU EEPROM Front panel components Measurement hardware NE ROM Power supply outputs i RELATED Shift Menu DO SELF TEST FRONT PANEL KEYS 4 60 Programming Guide Chapter 4 Command Reference Common Commands WAI Wait to Continue Command COMMENTS WAI This command prevents the instrument from executing any further commands or queries until all pending operations are complete The only way to cancel this holdoff is by device clear power on RST or CLS See the section titled Using the WAI Command on page 3 49 for an example that uses this command RELATED None
50. al numerics lt NRf gt Sets and queries the positive transition fitter for the Operation status reporting structure PRESet Std Event No query Presets the enable registers and transition fillers associated with the Operation and Questionable status reporting structures QUEStionable Std Subtree EVENt Std Query only Queries and then clears the H Questionable Data Event Status Register lt CONDition lt non decimal numeric gt lt NRf gt Std Query only Queries the Questionable Data Condition Status Register ENABle Std Sets the Questionable Data Event Status Enable Register structures Programming Guide 2 17 Chapter 2 Command Summary HP 53150A 151A 152A Command Summary Table 2 2 HP 53150A 151A 152A SCPI Command Summary Continued Keyword Syntax SYSTem COMMunicate GPIB SELF ADDRess SERial RECeive BAUD ERRor KEY CATalog VERSIon Parameter Form lt numeric_value gt lt numeric_value gt Std New Comments Subsystem Collects the functions that are not related to instrument performance Subtree Collects together configuration of control communication interfaces Subtree Controls the HPIB Sets the HPIB address of the instrument Subtree Sets the baud rate Query only Queries the oldest error in the Error Queue and removes the error from the queue first in first out See Chapter 5 for error definitions Sim
51. an execution error some Counter operations did not properly complete possibly due to an abnormal hardware or firmware condition These codes are also used for self test response errors The occurrence of any error in this class causes the device specific error bit bit 3 in the Event Status Register to be set Query Error An lt error number gt in the range 400 to 499 indicates that the output queue control of the Counter has detected a problem with the message exchange protocol The occurrence of any error in this class causes the query error bit bit 2 in the Event Status Register to be set This means that one of the following conditions exists An attempt is being made to read data from the output queue when no output is either present or pending e Data in the output queue was lost Error List Table 5 2 lists and describes the error messages generated by the HP 53150A 151A 152A Counters Programming Guide 5 7 Chapter 5 Errors Error Types Table 5 2 Errors Number Error String No error Command error nvalid character Syntax error nvalid separator Data type error GET not allowed Parameter not allowed Missing parameter Command header error Header separator error Program mnemonic too long Undefined header Header suffix out of range Numeric data error Invalid character in number Exponent too large Too many digits Numeric data not allowed Suffix error T
52. and incorrect or unimplemented TEER 488 2 Common Commands A Group Execute Trigger GET was entered into the input buffer inside of an IEEE 488 2 program message Events that generate command errors do not generate execution errors device specific errors or query errors Execution Error An lt error number gt in the range 200 to 299 indicates that an error has been detected by the Counter s execution control block The occurrence of any error in this class causes the execution error bit bit 4 in the Event Status Register to be set One of the following events has occurred e A lt PROGRAM DATA gt element following a header was evaluated by the Counter as outside of its legal input range or is otherwise inconsistent with the Counter s capabilities e A valid program message could not be properly executed due to some Counter condition 5 6 Programming Guide E Chapter 5 Errors Error Types Execution errors are reported by the Counter after rounding and expression evaluation operations have been taken place Rounding a numeric data element for example is not reported as an execution error Events that generate execution errors do not generate command errors f device specific errors or query errors Device or Counter Specific Error An lt error number gt in the range 300 to 399 or 1 to 82767 indicates that the Counter has detected an error that is not a command error a query error or
53. ansition filter specifies a negative transition the event becomes TRUE when its associated condition makes a TRUE to FALSE transition only When the transition filters specify both a positive and a negative transition the event becomes TRUE when its associated condition makes either a FALSE to TRUE or a TRUE to FALSE transition A transition filter is defined by positive and negative transition filter registers Table 3 6 describes how the transition filter registers define the transition criteria for setting an event bit TRUE 3 34 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Status Reporting Table 3 6 Transition Filter Definition Positive Negative Transition Transition Transition Which Causes the Event Bit to be set TRUE Filter Bit Filter Bit positive transition negative transition either a positive or negative transition neither transition event reporting is disabled Transition filters are unaffected by CLS or queries Transition filters are set to default values by STATus PRESet and power on To write to the Operation Status transition filter registers use STATus OPERation PTRansition STATus OPERation NTRansition To read these registers use STATus OPERation PTRansition SSTATus OPERation NTRansition Event Register An event register captures changes in conditions An event register bit event bit is set TRUE when an associated event oc
54. apter 2 Command Summary Front Panel to SCPI Command Map SENSe ROSCillator SOURce SAV RCL ANPut FILTer LPASs STATe U SENSe FILTer FM AUTO SYSTem COMMunicate SERial RECeive BAUD RST IDN See Service Manual See Service Manual TST MEMory CLEar NAME MEMory DATA SENSe CORRection CSET SELect SENSe CORRection CSET STATe Figure 2 2 Front Panel Menu to SCPI Command Map Part 2 of 2 Programming Guide 2 7 l Chapter 2 Command Summary HP 53150A 151A 152A Command Summary HP 53150A 151A4 152A Command Summary This section summarizes both the IEEE 488 2 Common and HP 53150A 151A4 152A Standard Commands for Programmable Instruments SCPI commands in tabular format IEEE 488 2 Common Commands are listed first followed by SCPI commands SCPI Conformance Information The SCPI commands used in the HP 53150A4 151A 152A Counters are in conformance with the SCPI Standard Version 1995 0 The SCPI command set consists of the following o Common Commands as defined in IEEE 488 2 1987 listed and summarized in Table 2 1 SCPI Subsystem commands as confirmed and listed in the SCPI Standard the commands defined in Table 2 2 as Std gt SCPI Subsystem commands designed for the instrument in conformance with SCPI standards but not yet listed in the SCPI Standard the commands defined in Table 2 2 as New Details of all HP 53150A 151A 152A com
55. ate and FETCh commands INITiate MMediate performs the data acquisition FETCh performs the post processing function Gf any and places the result in the Output Queue This allows more than one FETCh on a single set of acquired data The functions of the measurement instruction commands are summarized in Table 4 1 4 10 Programming Guide Chapter 4 Command Reference MEASure Subsystem Table 4 1 Summary of the Measurement Instruction Commands Command Description MEASure query This command is the simplest to use but it allows little flexibility This command lets the Counter configure itself for an optimal measurement initiate the measurement and return the result i e it provides a complete measurement sequence MEAS query is equivalent to the CONF INIT FETC command sequence but with no flexibility CONFigure The combined use of these two commands allows for more READ control when the Counter performs a measurement initiates a measurement and returns the result Use this command sequence when you want to customize the configuration between the measurement setup and acquisition CONFigure This combination of commands provides the most flexibility the HNITiate Measure Instructions allow This command sequence configures FETCh the Counter initiates the measurement as specified and returns the result The lt source_list gt parameter has
56. ating Guide for detailed information about front panel operation Knowing how to control the Counter from the front panel and understanding the measurements you need to perform makes the programming task much easier Programming Guide 1 7 Chapter 1 Before You Start Related Documentation Related Documentation This section contains a list of documentation that relates to the use of the i Counter Additional information that may be useful is contained in the following publications 1 HP 53150A 151A 152A Microwave Frequency Counter Operating Guide HP Part Number 53150 90001 2 Beginner s Guide to SCPI HP Part Number H2325 90002 July 1990 Edition 3 Beginner s Guide to SCPI Barry Eppler Hewlett Packard Press Addison Wesley Publishing Co 1991 4 Standard Commands for Programmable Instruments SCPD atest version This standard is a guide for the selection of messages to be included in programmable instrumentation It is primarily intended for instrument firmware engineers However you may find it useful if you are programming more than one instrument that claims conformance to the SCPI standard You can verify the use of standard SCPI commands in different instruments To obtain a copy of this standard contact SCPI Consortium 8380 Hercules Suite P3 La Mesa CA 91942 Phone 619 697 8790 FAX 619 697 5955 5 The International Institute of Electrical Engineers and Ele
57. atus Register shown in Figure 4 4 This event register captures changes in conditions by having each event bit correspond to a specific condition in the instrument An event becomes TRUE when the associated condition makes the defined transition The event bits once set are sticky i e they cannot be cleared until they are read even if they do not reflect the current status of a related condition This register is cleared by CLS by ESR and at power on Note that the instrument s power on sequence initially clears the register but then records any subsequent events during the power on sequence including setting the PON power on bit Bits Figure 4 4 Standard Event Status Register See the section titled Standard Event Status Register on page 3 30 of A this guide for a detailed description of the Standard Event Status Register QUERY RESPONSE Numeric data transferred as ASCII bytes in lt NR1 gt format Range is 0 to 255 The query response is an integer formed by the binary weighting of the bits The value of any unused bit is zero Programming Guide 4 49 COMMAND QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS COMMAND QUERY RESPONSE RANGE RELATED FRONT PANEL KEYS Chapter 4 Command Reference Common Commands TDN Identification Query IDN pe Queries the Counter identification A sequence of ASCII encoded bytes HEWLETT PACKARD lt Model Numbe
58. bles in EEPROM are defective or missing Bit 5 Frequency is a condition bit which indicates that frequency measurements may be affected by component failures e Bits 6 11 are not used Programming Guide 3 39 Chapter 3 Programming Your Counter for Remote Operation Status Reporting e Bit 12 Hardware Summary This condition is TRUE when an internal hardware fault has been detected either in normal operation or by the self test e Bit 13 is not used Bit 14 Command Warning is an event bit indicating a command such as CONFigure or MEASure ignored a parameter during execution Since this is an event bit the transition filters have no effect on it e Bit 15 is not used 3 40 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Programming the Counter for Status Reporting Determining the Condition of the Counter The Counter has status registers that are used to indicate its condition There are four register groups that can be examined individually or used to alert a computer These registers shown in Figure are e Operation Status Register Group e Questionable Data Signal Register Group Standard Event Status Register Group Status Byte Register Group The first three groups all have event registers that can be fed into the Status Byte Register The Status Byte Register can be used to assert the SRQ line and
59. cannot be turned ON when the value of AVERage COUNt is one Attempting to turn averaging ON when AVERage COUNt 1 causes an error Avg SENSe AVERage COUNt lt numeric_value gt Specifies the number of measurements to combine when AVERage STATe is ON The acceptable range for the lt numeric_value gt parameter is 1 to 99 When averaging is ON some devices may automatically set COUNt values in the TRIGger subsystem based on the AVERage COUNt value This is done to ensure that the TRIGger subsystem provides enough triggers for the average Avg 4 22 Programming Guide Chapter 4 Command Reference SENSe Subsystem COMMAND SENSe CORRection CSET SELect lt name gt Selects a power correction profile by name from nine available profiles Valid profile names CORR1 CORR2 CORRO COMMENTS RST CORRI The correction profile setting is applied for the current session only To store the profile selection in non volatile memory issue a SAV command RELATED Shift Menu PWR CORR gt OFF 1 9 FRONT PANEL KEYS COMMAND SENSe CORRection CSET STATe lt Boolean gt Enables or disables power correction mode with the currently selected power correction profile applied COMMENTS RST OFF e The power correction state is applied for the current session only To store the setting in non volatile memory issue a SAV command RELATED Shift Menu PWR CORR gt OFF 1 9
60. ck panel Reference connector the front panel frequency display may show an error message If this is set to INT the 10 MHz signal generated by the internal reference oscillator is available as an output on the back panel Reference connector Shift Menu REF OSC gt INT EXT 4 30 Programming Guide Chapter 4 Command Reference STATus Subsystem STATus Subsystem The STATus subsystem commands allow you to specify or examine the status of the Operation Status Register group and the Questionable Data Signal Register group STATus OPERation Subtree The STATus OPERation subtree commands allow you to examine the status of the Counter monitored by the Operation Status Register Group shown in Figure 4 1 The Operation Status Register Group consists of a condition register two transition registers an event register and an enable register The commands in this subtree allow you to control and monitor these registers See the sections titled Operation Status Register Group and Questionable Data Status Register Group on pages 3 37 and 3 39 for a detailed description of the Operation Status Register Group Bits Calibrating Ufo Not Used O10 3 Measuring 4 Waiting for Tage 2d oof Not Used E T0 E Using Internal Reference Ellas Not Used 11024 Acquiring CUER Tr Locked 40985 7 Not Used 13 to 15 Figure 4 1 The Operation Status Register Gr
61. ctronic Engineers IEEE Standard 488 1 1987 IEEE Standard Digital Interface for Programmable Instrumentation 1 8 Programming Guide Chapter 1 Before You Start Related Documentation This standard defines the technical details required to design and build an HP IB IEEE 488 1 interface This standard contains electrical specifications and information on protocol that is beyond the needs of most programmers However it can be useful to clarify formal definitions of certain terms used in related documents To obtain a copy of this standard write to Institute of Electrical and Electronic Engineers Inc 345 East 47th Street New York NY 10017 USA 6 The International Institute of Electrical Engineers and Electronic Engineers IEEE Standard 488 2 1987 IEEE Standard Codes Formats Protocols and Common Commands for Use with ANSI IEEE Std 488 1 1987 Programmable Instrumentation This standard defines the underlying message formats and data types used in SCPI It is intended more for firmware engineers than for instrument users programmers However it can be useful if you need to know the precise definition of specific message formats data types or common commands To obtain a copy of this standard write to The Institute of Electrical and Electronic Engineers Inc 345 East 47th Street New York NY 10017 USA 7 Hewlett Packard Company BASIC 5 0 5 1 Interfacing Techniques Vol 2 Specific Interfaces 1987
62. curs These bits once set are sticky That is they cannot be cleared even if they do not reflect the current status of a related condition until they are read Programming Guide 3 35 Chapter 3 Programming Your Counter for Remote Operation Status Reporting To read the event registers use STATus OPERation EVENt STATus QUEStionablel EVENt Use event register queries or CLS to clear event registers Event Enable Register An event enable register selects which event bits in the corresponding event register can generate a summary bit To write the event enable registers use STATus OPERation ENABle STATus QUEStionable ENABle To read the event enable registers use STATus OPERation ENABle STATus QUEStionable ENABle The event enable registers are cleared by STATus PRESet and power on 3 36 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Status Reporting Operation Status Register Group The Operation Status Register Group monitors conditions which are part of the Counter s normal operation and has a complete set of registers that consist of the following e acondition register a positive transition filter register PTR anegative transition filter register NTR an event register an event enable register Table 3 7 lists the Operation Status Register bits and briefly describes each bit Figure 3 18 s
63. cute Trigger GET GET The full capability of the Group Execute Trigger IEEE 488 1 interface function is implemented in the Counter This function permits the Counter to have its operation initiated over the Bus In response to the IEEE 488 1 Group Execute Trigger GET remote interface message while the Counter is addressed to listen the Counter performs the action defined by the DDT command see page 4 46 None Programming Guide 4 7 t H Chapter 4 Command Reference INITiate Subsystem INITiate Subsystem i j This subsystem controls the initiation of a measurement my COMMAND _ INITiate CONTinuous lt Boolean gt Sets or queries the state of continuously initiated measurements When CONTinuous is set to OFF no measurements are made until CONTinuous is set to ON or INITiate IMMediate is received Once CONTinuous is set to ON a new measurement is initiated On the completion of each measurement with CONTinuous ON another measurement immediately commences QUERY RESPONSE Single ASCII encoded byte 0 or 1 A value of 0 indicates OFF a value of 1 indicates ON RST OFF The commencement of the first measurement due to setting INTTiate CONTinuous to ON sets the Pending Operation Flag to true The Pending Operation Flag is set false by aborting a measurement or by the completion of the last measurement after SINITiate CONTinuous is set OFF e With the measurements being made con
64. display FOR I 1 TO Samples t Start making measurements OUTPUT Count INET WAL DATA t Start a measurement and STER Count Freq I t fetch the data PRINT USING 11A DD 4A 22A 3A Frequency 1 Preq I Hz i NEXT I LOCAL 703 Return counter to local END 3 56 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Programming Examples Making a Frequency Measurement QuickBASIC This program configures the counter to make 10 frequency measurements on channel 2 The results are printed on the computer monitor Data is sent in ASCII format to preseve resolution The SUB sendhp sends commands to the counter ARE SUB sendhp code SINCLUDE QBSETUP BAS Required by HP 82335A SHARED source AS LONG Address and select code M i AS INTEGER 4 is used for loops DIM samples AS INTEGER samples 10 Number of measurements DIM freqs 10 AS STRING 23 String to be read Reading ASCII formatted data gives results to the correct xesolution Must be read into a string The maximum number of characters that can ever be sent is 20 per measurement Counter at address 3 Select code 7 Used in TOROL Clear screen CALL IOEOI isc amp p state Make sure EOI enabled CALL IOCLEAR source Clear the counter and interface CALL sendhp RST Reset counter and stop autotriggering CALL se
65. e 2 1 and Table 2 2 respectively 3 The section titled RST Response lists the states of all of the commands that are affected by the RST command in Table 2 3 This section also lists commands that are unaffected by RST in Table 2 4 2 2 Programming Guide NOTE Chapter 2 Command Summary Front Panel to SCPI Command Map Front Panel to SCPI Command Map Figures 2 1 and 2 2 are command maps that shows the relationships between the front panel keys and the SCPI commands This map should help you to identify commands if you are already familiar with the front f panel Some SCPI Syntax Conventions An element inside brackets is optional Note the brackets are not part of the command and should not be sent to the Counter 112 Means use either 1 or 2 lt numeric_value gt Means enter a number SENSe Means you must use either all the upper case letters or the entire word The lower case letters are optional For example SENS and SENSE are both valid However SEN is not valid Note SENSe is used here as an example but this convention applies to all SCPI commands When you see quotation marks in a command s parameter shown in the Parameter Form column in Table 2 2 you must send the quotation marks with the command Refer to the section titled Using HP BASIC on l page 3 54 of this guide for details on how to use double quotes or single l quotes to enclose the string parameter of a command l
66. e measurement functions e Refer to Table 4 2 for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions 4 14 Programming Guide Chapter 4 Command Reference MEASure Subsystem COMMAND READ SCALar lt function gt This query provides a method for performing a FETCh on fresh data COMMENTS This command is commonly used in conjunction with a CONFigure command to provide a capability similar to MEASure in which the application programmer is allowed to provide fine adjustments to the instrument state by issuing the corresponding commands between CONFigure and READ When SCALar lt function gt is specified the instrument retrieves the specified result if it matches the current measurement type or can be derived from the current measurement type When SCALar lt function gt is omitted the function specified used by the last CONFigure MEASure READ or FETCh is used if possible Issuing this query while a measurement is in progress aborts the current measurement and idles the measurement cycle before initiating the desired measurement The Counter then waits for the measurement to complete This has the effect of holding off processing of further commands until the desired measurement completes This hold off action can be canceled only by the completion of the measurement Device Clear or power on Ifan lt expected_value g
67. e of 1 indicates ON COMMENT RST OFF RELATED Shift Menu CH1 LPF gt OFF ON FRONT PANEL KEYS Programming Guide 4 9 Chapter 4 Command Reference MEASure Subsystem MEASure Subsystem The MEASure subsystem commands allow you to configure the Counter initiate measurements and place the results in the Output Queue using a minimum number of commands These commands are described in detail in this section Measurement Instructions CONFigure FETCh MEASure READ The purpose of these commands is to acquire data using a set of high level instructions These commands are structured to allow you to trade off interchangeability between instruments The MEASure query provides the ability to configure the instrument take a measurement and store the results in the Output Queue in a single operation When more precise control of the measurement is required the CONFigure and READ commands can be used The CONFigure command is used to configure the instrument for the measurement to be taken and the READ command acquires the data performs any required post processing and then places the results in the Output Queue This allows you to configure the instrument generically using CONFigure and then to customize the measurement with other commands for example commands from the SENSe subsystem The READ command completes the measurement process The READ command is composed of the INITiate IMMedi
68. ed as a guide to the bits used in each of these register groups to monitor the Counter s status Note that a summary of the Standard Status Structure Registers defined by IEEE 488 2 1987 is shown in addition to the Operation Status and Questionable Data Signal Register groups Refer to the section in this chapter titled Programming the Counter for Status Reporting and the flowchart in Figure 3 14 for detailed information on programming the status reporting system Programming Guide 3 25 Chapter 3 Programming Your Counter for Remote Operation Status Reporting fr Questionable Data Status Register Group NOTES Bit 1 The numbers that are in parentheses and positioned Ra above the arrows represent the integer formed by the perg Not Used a Dito 2 binary weighting of the corresponding bit io PowerCal a 3 2 Descriptions of all registers are contained in this section Not Used 133 3 To reset the Counter and initialize status reporting S E Frequency ai perform the following hoy Not Used Hardware Summary 4098 Not Used mmu 43 Command Warning ESBL Ta Not Used me 15 Reset and initialize status reporting LOGICAL OR Use STATus QUEStionable Commands STAT PRES to control and read registers gt Continue Program 4 The value of an unused bit is zero when queried and ignored when set L y Standard Event Status Register Grou Summary of IEEE 408 2 198
69. ement of block expression or string type was received that contained more data than the Counter could handle due to memory or related Counter specific requirements Used where exact value from a list of possible values was expected No valid data available New measurement started but not completed ndicates that a legal program command or query could not be executed because of a hardware problem in the Counter ndicates that a legal program command or query could not be executed because of missing Counter hardware This is the generic device dependent error ndicates that a system error occurred ndicates that the Counter has detected that insufficient memory is available ndicates at least one failure occurred when TST was executed ndicates that there is no room in the error queue and an error occurred but was not recorded This is the generic query error ndicates that a condition causing an INTERRUPTED Query error occurred For example a query followed by DAB or GET before a response was completely sent ndicates that there is no room in the error queue and that an error occurred but was not recorded This is the generic query error ndicates that a condition causing an INTERRUPTED Query error occurred For example a query followed by a DAB or GET before a response was completely sent Programming Guide i Chapter 5 Errors Error Types Table 5 2 Errors Continued Error String Query
70. ent offset so that a measurement can be referenced to a known value RANGE 50 dBm to 10 dBm UNITS dB dBm COMMENT RST 0 RELATED Shift Pwr Offset FRONT PANEL KEYS COMMAND SENSe POWer AC REFerence STATe lt Boolean gt Determines whether amplitude is measured in absolute or relative mode If STATe is ON amplitude is referenced to the value set in REFerence COMMENT RST OFF RELATED Power Offset On Off FRONT PANEL KEYS Programming Guide 4 29 COMMAND QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference SENSe FUNCtion Subtree SENSe ROSCillator Subtree This subtree controls the Reference Oscillator SENSe ROSCillator SOURce lt character_program_data gt Sets or queries the current reference timebase to INTernal or EXTernal A sequence of ASCII encoded bytes INT or EXT RST INT INTernal indicates the timebase is the internal reference EXTernal indicates the signal at the external reference input located on the rear panel of the Counter Reference connector is the reference timebase The Counter does not switch to EXTernal unless a suitable 1 2 5 or 10 MHz signal is present on the Reference connector on the back panel Execution of the command that is explicitly selecting internal or external timebase sets SENS ROSC SOUR AUTO to OFF If this is set toH XT and no valid external signal is available at the ba
71. es the state of the Counter s user settings from a copy stored in local non volatile memory 0 through 9 are valid memory registers Resets the Counter to a known state as defined in this manual Stores the current state of the Counter s user settings in local non volatile memory 0 through 9 are valid memory registers Sets the Service Request Enable register 2 10 Programming Guide Chapter 2 Command Summary HP 53150A 151A 152A Command Summary Table 2 1 IEEE 488 2 Common Commands Continued Command Name Function Service Request Enable Queries the Service Request Enable register Query STB Status Byte Query Queries the Status Byte and Master Summary Status bit This trigger command is the device specific analog of the IEEE 488 1 defined GET It initiates the action specified by the DDT command Mnemonic SRE TRG Trigger T ST Self Test Query Executes an internal self test and reports the results WAI Wait to Continue Makes the Counter wait until all pending operations see Note are completed before executing commands that follow the WAI command Note Pending operations include measurements in progress Programming Guide 2 11 CAUTION Chapter 2 Command Summary HP 53150A 151A 152A Command Summary HP 53150A 1514 152A SCPI Subsystem Commands SCPI Subsystem commands include all measurement functions and s
72. f Identify asserted concurrent with last byte or an EOI asserted concurrent with a lt new line gt as the last byte 3 18 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Using Multiple Commands Using Multiple Commands i Program Messages Program Messages are a combination of one or more properly formatted SCPI Commands Program messages always go from a computer to the Counter They are sent to the Counter over the Counter s HP IB or serial interface as a sequence of ASCII data messages Program Message Syntax Figure 3 8 shows the simplified syntax of a program message You can see Common Commands and Subsystem Commands in the same program message If you send more than one command in one message you must l separate adjacent commands with a semicolon lt new line gt Subsystem Command _ fer NOTE lt new line gt ASCII character decimal 10 AEND EOI asserted concurrent with last byte Figure 3 8 Simplified Program Message Syntax Diagram When using IEEE 488 2 Common Commands with SCPI Subsystem commands on the same line use a semicolon between adjacent commands For example RST SENS AVER ON Programming Guide 3 19 Chapter 3 Programming Your Counter for Remote Operation Using Multiple Commands When multiple subsystem commands are sent in one program message the first command is always referenced to the root node Subsequent ait commands separated
73. f these points contains a frequency value of 1 GHz and the other contains a frequency value equal to the highest frequency the Counter model can measure 53150A 20 GHz 53151A 26 5 GHz 53152A 46 GHz The remaining eight data points contain loss and frequency values of zero This is an event There is no query form of this command Shift Menu PWR CORR MEMory NSTates Queries the Number of available SAV RCL STates in the instrument Numeric data transferred as ASCII bytes in lt NR1 gt format e The value returned is 9 The response value is one greater than the maximum which can be sent as a parameter to the SAV and RCL commands Query only None Programming Guide 4 21 COMMAND COMMENTS RELATED FRONT PANEL KEYS COMMAND RANGE COMMENT RELATED FRONT PANEL KEYS Chapter 4 Command Reference SENSe Subsystem SENSe Subsystem The SENSe subsystem commands are divided into several sections Each section or subtree deals with controls that directly affect instrument specific settings and not those related to the signal oriented characteristics SENSe AVERage STATe lt Boolean gt Turns averaging ON and OFF When averaging is ON each new valid measurement result is the average of the number of measurements specified in the AVERage COUNt command e An ABORt command interrupts the averaging and prevents a valid measurement result e Averaging
74. gister The command error bit is set when an incorrect command is received by the Counter The command SRE 32 tells the Counter to assert the SRQ line when the Event Status Register summary bit is set to 1 If the Counter is serial polled after a command error the serial poll result is 96 Bit 6 Bit 5 Event Status Register ESE 32 Enable for bad command SRE 32 Assert SRQ from Standard Event Status Register summary 3 42 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Using the Operation Status Register to Alert the Computer When Measuring has Completed Example 3 The following command grouping illustrates how to use the Operation Status register and the Status Byte register to alert the computer when measuring has completed This is useful if the Counter is making a long measurement When the measurement is complete the Counter can alert the computer i i i i The first line tells the Counter to watch for a negative transition from true measuring to false non measuring of bit 4 This negative transition indicates that the Counter has completed a measurement The next line tells the Counter to summarize the detected event bit 4 of the Operation Status Register in the Status Byte Register The command SRE 128 tells the Counter to assert SRQ when the summary bit for the Operation Status register is set to 1 A serial poll will return 192 whe
75. gt This query provides a complete measurement sequence configuration measurement initiation and query for result This query is used when generic measurement is acceptable and fine adjustment of Counter settings is not necessary Parameters other than lt source_list gt can be defaulted by substituting the keyword DEFault The lt source_list gt parameter can e defaulted by omitting it The default values are specified by the particular function description For POWer lt resolution gt must be defaulted or set to 0 01 dB e Ifan lt expected_value gt parameter is outside the measuremen capabilities of the Counter model an error is generated and the command does not execute e Issuing this query while a measurement is in progress aborts the current measurement before initiating the measurement specified in he query The Counter then waits for the measurement to complete This has the effect of holding off processing of further commands until he desired measurement completes This hold off action can be canceled only by the completion of the measurement Device Clear or power on e Ifan lt expected_value gt parameter is outside the measurement capabilities of the Counter model an error is generated and the command does not execute e For POWer lt resolution gt must be defaulted or set to 0 01 dB See Descriptions of the Measurement Functions on page 4 16 for a description of each of th
76. he Counter Errors 300 through 399 and all those with positive error numbers are device specific errors Bit 4 Execution Error is an event bit which indicates that a command could not be executed 1 because the parameter was out of range or inconsistent with the Counter s capabilities or 2 because of some condition of the Counter Errors 200 through 299 are execution errors Bit 5 Command Error is an event bit which indicates one of the following has occurred 1 an IEEE 488 2 syntax error 2 a semantic error indicating an unrecognized command or 3 a Group Execute Trigger was entered into the input buffer inside of a program message e Bit 6 is not used Bit 7 Power On is an event bit which indicates that an off to on transition has occurred in the Counter s power supply Standard Event Status Enable Register The Standard Event Status Enable Register selects which events in the Standard Event Status Register are reflected in the ESB summary bit bit 5 of the Status Byte Register as shown in Figure 3 8 Use ESE to write to this register and ESE to read this register Use ESE 0 to clear the register Power on also clears this register 3 32 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Status Reporting The Operation and Questionable Data Status Register Groups The Operation and Questionable Data Status Register Groups have the following registers e acondit
77. he Counter over the HP IB or the RS 232 interface as a sequence of ASCII data messages Examples of a typical Common Command and Subsystem Command are OUTPUT 712 CL8 OUTPUT 712 DISP ENAB ON FREQ RES 1KHz Subsystem Command Syntax Figure 3 6 shows the simplified syntax of a Subsystem Command You must use a space SP between the last command mnemonic and the first parameter in a Subsystem Command Note that if you send more than one parameter with a single command you must separate adjacent parameters with a comma NOTE sp space ASCII character decimal 32 Figure 3 6 Simplified Program Command Syntax Diagram Common Command Syntax Figure 3 7 shows the simplified syntax of a Common Command You must use a space SP between the command mnemonic and the parameter in a Common Command Programming Guide 3 13 NOTE Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Cte h NOTE sp space ASCII character decimal 32 Figure 3 7 Simplified Common Command Syntax Diagram Abbreviated Commands The command syntax shows most keywords as a mixture of upper and lowercase letters Uppercase letters indicate the abbreviated spelling for the command For better program readability you may send the entire keyword The HP 53150A 151A 152A accepts either command form and is not case sensitive For example if the command syntax shows DISPlay then DISP and
78. he bit values of the Questionable Data Event Status Enable Register The value of unused bits is zero when queried and ignored when set e This register is used to enable a single or inclusive OR group of Questionable Data Event Status Register events to be summarized in the Status Byte Register bit 3 e At power on and STAT PRES the Questionable Data Event Status Enable Register is cleared value is 0 i This value is unaffected by RST CLS and SAV RCL RELATED None 0 FRONT PANEL KEYS COMMAND STATus QUEStionable EVENt Queries the status of the Questionable Data Event Status Register QUERY RESPONSE Numeric data transferred as ASCII bytes in lt NR1 gt format Range is 0 to 32 767 The query response value is an integer formed by the binary weighting of bits The value of unused bits is zero COMMENTS Each event bit in the Questionable Data Event Status Register corresponds to a specific condition bit in the Questionable Data Programming Guide 4 37 RELATED FRONT PANEL KEYS Chapter 4 Command Reference STATus Subsystem Condition Status Register this allows the Questionable Data Status Register to detect changes in conditions An event becomes TRUE when the associated condition makes the transition specified by the transition filters The event bits once set are sticky i e they cannot be cleared until they are read even if they do not reflect
79. he current state of the instrument is automatically saved to register 0 Oto 8 1 Shift Menu RECALL gt 0 through 8 4 52 Programming Guide Chapter 4 Command Reference Common Commands RST Reset Command COMMAND RST This event command performs an instrument reset The reset performs the following sets instrument settings to their RST states and places the instrument in Operation Complete Idle State and to Operation Complete Query Idle State COMMENTS See the section titled RST Response on page 2 19 for a complete listing of the RST state Each command description in this chapter includes the RST state in the Comment portion of the definition RELATED Reset Local FRONT PANEL KEYS f Programming Guide 4 53 COMMAND lt NRF gt RANGE lt NRF gt RESOLUTION COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference Common Commands SAV Save Command SAV lt NRf gt lt non decimal numeric gt This command stores the current state of the instrument in register 0 of local non volatile memory when RCL or is executed or Recall is selected from the menu using the front panel controls 1to8 1 e The following states are saved DISPlay WINDow BACKground STATe SINTTiate CONTinous SENSe AVERage STATe SENSel AVERage COUNt SSENSe CORRection CSET SELect SENSe CORRection CSET STATe
80. he error queue is empty Every error in the queue has been read SYSTem ERRor query or the queue was cleared by power on or CLS This is the generic syntax error used if the Counter cannot detect more specific errors A syntactic element contains a character that is invalid for that type For example a header containing an ampersand INP COUP amp AC An unrecognized command or data type was encountered The parser was expecting a separator and encountered an illegal character The parser recognized a data element different than one allowed For example numeric or string data was expected but block data was received A Group Execute Trigger was received within a program message More parameters were received than expected for the header Fewer parameters were received than required for the header An unspecified error was detected in the header A character that is not a legal header separator was encountered while parsing the header The header or character data element contains more than twelve characters The header is syntactically correct but it is undefined for the Counter For example XYZ is not defined for the Counter The value of a numeric suffix attached to a program mnemonic makes the header invalid This error as well as errors 121 through 129 are generated when parsing a data element which appears to be numeric including the non decimal numeric types This particular error message is used when the C
81. his numeric representation has an implicit radix point Table 3 3 contains explanations of response data types CO hrp The maximum number of characters in lt NR1 gt response data is 17 maximum 16 digits 1 sign lt NR2 gt This numeric representation has an explicit radix point LEH The maximum number of characters in lt NR2 gt response data is 17 maximum 15 mantissa digits 1 sign 1 decimal point lt NR3 gt This numeric representation has an explicit radix point and an exponent Lae The maximum number of characters in lt NR3 gt response data is 22 maximum 15 mantissa digits 2 signs 1 decimal point 1 E character 3 exponent digits Not a Number Not a Number is represented by the value 9 91E37 Not a Number is defined in IEEE 754 The Counter responds with this numeric value when queried for a floating point number it cannot provide This value will be formatted as an lt NR3 gt lt Boolean gt A single ASCll encoded byte 0 or 1 is returned for the query of settings that use lt Boolean gt parameters lt literal gt ASCll encoded bytes corresponding to the short form of the literal used as the command parameter Programming Guide 3 23 Chapter 3 Programming Your Counter for Remote Operation Overview of Response Message Formats Table 3 3 Response Message Data Types Continued Description lt string gt A string response
82. hows the model that these register groups follow Table 3 7 Operation Status Register WEIGHT DESCRIPTION Not used 1 3 Not used 16 Measuring Waiting for Trigger Not used Using Internal Reference Not used Acquiring Locked Not used Not used since some controllers may have difficulty reading a 16 bit unsigned integer The value of this bit is always 0 Programming Guide 3 37 Chapter 3 Programming Your Counter for Remote Operation Status Reporting A detailed description of each bit in the Operation Status Register follows e Bits 0 3 are not used Bit 4 Measuring is a condition bit which indicates the Counter is rm actively measuring The condition bit is TRUE one during a measurement and FALSE zero otherwise e Bits 5 Waiting for Trigger The condition bit is TRUE one when the Counter is in the HOLD mode INIT CONT OFF and it has not been triggered e Bits 6 8 are not used Bit 9 Using Internal Reference is a condition bit which indicates the Counter is using the internal reference The condition bit is TRUE one when the Counter is using the internal reference The condition bit is FALSE zero while the Counter is using the external reference The setting of this bit is not affected by the setting of the REF OSC option in the user settings menu e Bit 10 is not used e Bit
83. icrowave Frequency Counters This guide assumes you are familiar with the front panel operation of the Counter See the HP 53150A 151A 152A Operating Guide for detailed information about front panel operation You should use this programming guide together with the operating guide Knowing how to control the Counter from the front panel and understanding the measurements you want to perform makes the programming task much easier The operating guide provides explanations and procedures for all of the Counter s measurement functions and contains the specifications for the Counter By sending Standard Commands for Programmable Instruments SCPI commands you can remotely operate many of the Counter s front panel functions via the Hewlett Packard Interface Bus HP IB or the RS 232 serial interface These programming commands conform to the Standard Commands for Programmable Instruments SCPI Standard Version 1992 0 The SCPI standard does not completely redefine how to program instruments over the Hewlett Packard Interface Bus HP IB or the RS 232 serial interface However it does standardize the structure and content of an instrument s command set to reflect the best programming practices developed by people using HP IB It also establishes standard command mnemonics for similar functions in all of the instruments that conform to the SCPI standard If you have programmed any HP instruments that have been released over the last few years
84. ion of the frequency measurement The allowable settings for lt numeric_value gt and lt frequency unit gt are 1 Hz 10 Hz 100 Hz 1 KHz 10 KHz 100 KHz and 1 MHz RST 1 Hz This command does not affect the unit multipliers of any measurement queries Ifno unit is specified the global frequency unit in effect is used Resol SENSe FREQuency TRACking lt character_program_data gt Selects one of three signal tracking modes SLOW FAST OFF When TRACking is set to SLOW the Counter applies two tracking routines after each measurement when it is set to FAST it uses only one tracking routine when it is set to OFF it dees not use either of the tracking routines e RST FAST The SLOW setting provides the most accurate signal tracking but yields the smallest number of measurements in a given period of time The FAST setting centers the IF in the IF bandwidth after each measurement to improve tracking None 4 26 Programming Guide Chapter 4 Command Reference SENSe FUNCtion Subtree SENSe FUNCtion Subtree This subtree controls the sensor functions COMMAND SENSe FUNCtion OFF lt sensor_function gt lt sensor_function gt Sets or queries the sensor functions to be sensed by the Counter The lt sensor_function gt strings are TIXNONe JFREQuency 1 2 IXNONe POWer 2 QUERY RESPONSE The query form of this command returns a comma sepa
85. ion register one or more transition filters an event register an event enable register Figure 3 13 shows the model that these register groups follow positive transition or negative transition or either transition See Table 3 6 A Event Gondition Transition em Enable egister ilter egister P Register Logical AND gt _o HH bf pee aaieal AND 0 m 1 e mS gt lt 1 LB 2 nd Device Status Continuously N Monitored oe n H a es n PEE Logical OR Summary Bit OSB or QSB Status Byte Register Figure 3 13 Operation and Questionable Data Status Reporting Model Programming Guide 3 33 Chapter 3 Programming Your Counter for Remote Operation Status Reporting Condition Register A condition register continuously monitors the hardware and firmware status of the Counter There is no latching or buffering for this register it is updated in real time Reading a condition register does not change its pe contents To read the condition registers use STATus OPERation CONDition STATus QUEStionable CONDition Transition Filter A transition filter specifies the transition criteria for setting event bits TRUE When the transition filter specifies a positive transition the event becomes TRUE when its associated condition makes a FALSE to TRUE transition only When the tr
86. lags that were set true by initiation of measuring If ABORt is issued If ABORt is issued f ABORt is issue pending operation flag is set false f ABORt is issued while the measurement cycle is idle CINIT CONT OFF and pending operation flag is false the command is ignored while a single measurement is in progress the measurement is aborted and the pending operation flag is set false while repetitive measurements are being made CINIT CONT ON the measurement in progress is aborted and the ending operation flag is set false Then a new measurement is automatically initiated and the pending operation flag is set true while a block of measurements such as an average is in progress the measurement block is aborted and the When a measurement or block of measurements is aborted the Measuring bit in the Operation Status Register is set false Aborting a measurement in progress invalidates the result Reset Local 4 4 Programming Guide Chapter 4 Command Reference DISPlay Subsystem DISPlay Subsystem This subsystem controls the selection and presentation of textual information on the Counter s display This information includes i measurement results DISPlay is independent of and does not modify f how data is returned to the controller See the section titled Programming the Counter to Display Results on page 3 46 of this guide COMMAND DISPlay WINDow BACKground ST
87. lists the Status Byte Register bits and briefly describes each bit Programming Guide 3 27 Chapter 3 Programming Your Counter for Remote Operation Status Reporting Table 3 4 Status Byte Register i WEIGHT SYMBOL DESCRIPTION won Not used rk Not used Error Event Queue Not Empty Questionable Data Signal Status Register Summary Bit MAV Message Available Summary Bit ESB Standard Event Status Register Summary Bit RQS MSS_ Request Service Master Status Summary Bit OSB Operation Status Register Summary Bit A detailed description of each bit in the Status Byte Register follows e Bits 0 1 are not used Bit 2 EAV Summarizes the Error Event Queue This bit is set when the Error Event Queue is not empty e Bit 3 QSB summarizes the Questionable Data Status Event Register This bit indicates whether or not one or more of the enabled Questionable Data events have occurred since the last reading or clearing of the Questionable Data Status Event Register This bit is set TRUE one when an enabled event in the Questionable Data Status Event Register is set TRUE Conversely this bit is set FALSE zero when no enabled events are set TRUE e Bit 4 MAV Message AVailable summarizes the Output Queue This bit indicates whether or not the Output Queue is empty This bit is set TRUE one when the Counter is ready to accept a request by the external computer to output data b
88. lution gt must be defaulted or set to 0 01 dB See Descriptions of the Measurement Functions on page 4 16 for a description of each of the measurement functions e See Table 4 2 for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions CONFigure Queries the function configured by the last CONFigure command or MEASure query e Astring of the form lt function gt lt parameters gt lt source_list gt The leading colon is omitted from the lt function gt e The response is unaffected by RST recall and SENS FUNC e Ifthe instrument state has changed through commands other than CONFigure or the MEASure query the instrument does not track these changes and the query response does not reflect these changes e For POWer lt resolution gt must be defaulted or set to 0 01 dB 4 12 Programming Guide Chapter 4 Command Reference MEASure Subsystem e Ifan lt expected_value gt parameter is outside the measurement capabilities of the Counter model an error is generated and the i command does not execute See Descriptions of the Measurement Functions on page 4 16 for a description of each of the measurement functions See Table 4 2 for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions COMMAND FETCh SCALar lt function gt This quer
89. mands ry IEEE 488 2 Common Commands and Standard Commands for Eom Programmable Instruments SCPI The format of each type of command is described in the following paragraphs Refer to Chapter 2 Command Summary for SCPI conformance information Common Command Format The IEEE 488 2 Standard defines Common Commands as commands that perform functions like reset self test status byte query and identification Common Commands always begin with the asterisk character and may include parameters The command keyword is separated from the first parameter by a space character Some examples of Common Commands are as follows RST IDN RCL 1 SCPI Command and Query Format SCPI commands perform functions like instrument setup A subsystem command has a hierarchical structure that usually consists of a top level or root keyword one or more lower level keywords and parameters The following example shows a command and its associated query DISPlay ENABle ON DISPlay ENABle In this example DISPlay is the root level keyword ENABle is the second level keyword and ON is the command parameter 3 12 Programming Guide NOTE Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Elements of SCPI Commands A program command or query is composed of functional elements that include a header or keywords with colon separators program data and terminators These elements are sent to t
90. mands can be found in Chapter 4 Command Reference Information on the SCPI commands format syntax parameter and response types is provided in Chapter 3 Programming Your Counter for Remote Operation 2 8 Programming Guide Chapter 2 Command Summary HP 53150A 151A 152A Command Summary TEEE 488 2 Common Commands The Common Commands are general purpose commands that are common to all instruments as defined in IEEE 488 2 Common Commands are easy to recognize because they all begin with an for example RST IDN OPC These commands are generally not relat ed to measurement configuration They are used for functions like resetting the instrument identification or synchronization Table 2 1 lists the IEEE 488 2 Common Commands supported by the HP 53150A 151A 152A in alphabetical order by mnemonic name and function More information concerning the operation of IEEE 488 2 status reporting commands and structure can be found in the Status Reporting section of Chapter 3 Standard explanations of the IEEE 488 2 Common Commands can be found in the ANSI IEEE Std 488 2 1987 IEEE Standard Codes Formats Protocols and Common Commands document Programming Guide Table 2 1 IEEE 488 2 Mnemonic CLS DDT lt arbitrary block gt DDT ESE lt NRf gt ESE ESR IDN IST OPC PRE lt NRf gt PRE RCL lt NRf gt RST SAV lt
91. measurement is complete Read the Counter The program waits until the Counter returns a 1 The HP IB timeout must be set so that it is longer than the expected measurement time Using the OPC Command to Assert SRQ This method is recommended when the Counter is interfaced with many other instruments any of which can assert SRQ The commands OPC ESE 1 and SRE 32 are used to assert the SRQ line to alert the computer that the Counter has completed a measurement It is up to the computer to use the serial poll command to determine which of the instruments on the bus requested service Of the three procedures discussed here this one is the most flexible but it is also the most complex AVERAGE COUNT 50 On INIT take N measurements AVERAGE ON Enable averaging ESE 1 Summarize OPC bit for Status Byte Register SRE 32 SRQ when event summary bit is 1 3 50 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements Set up program to specify service routine and enable interrupt when SRQ is asserted INIT Start measurements OPC Enable OPC bit The program can do other things while it is waiting for SRQ When SRQ occurs and the Counter has been identified as the cause of the SRQ ask for the data DATA Ask for data Programming Guide 3 51 Chapter 3 Programming Your Counter for Remote Operation Writing SCPI Program
92. mmary HP 53150A 151A 152A Command Summary Table 2 2 HP 53150A 151A 152A SCPI Command Summary Keyword Syntax Parameter Form Std New Comments Event no query Resets the trigger system and aborts any measurement in progress Places the trigger system in the IDLE state CONFigure See Measurement Instructions in this table DISPlay Subsystem Controls the selection and presentation of textual information on the display ENABIe lt Boolean gt Controls whether or not the entire display is WINDow visible BACKground USTATe lt Boolean gt Turns the LCD display backlight ON or OFF FETCh See Measurement Instructions in this table NITiate Subsystem Controls the initiation of measurements CONTinuous lt Boolean gt Sets the instrument for continuously initiated or user initiated measurements IMMediate Event no query Causes the instrument to initiate and complete one full measurement cycle INPut Subsystem Controls the characteristics of the instrument s Channel 1 input port Filer Subtree Controls a filter that can be inserted in the path of the measurement signal LPASs Subtree Selects the Low PASs filter STATe lt Boolean gt Enables or disables the Channel 1 low pass filter approx 50 KHz MEASure See Measurement Instructions in this table Programming Guide 2 13 Chapter 2 Command Summary HP 53150A 151A 152A Command Summary Table 2 2 H
93. moved 7 printf Frequency d s Hz n i fregq ae Poy printf Press a key to continue n 3 58 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Programming Examples getch Function to send command to HP 5315xA void sendhp hpib cmd char hpib cmd char hpemd 80 Variables used by function int length strepy hpemd hpib_cmd length strlen hpemd error IOOUTPUTS ctr hpemd length Send command to HP 315xA if error 0 printf Error during HP IB d Command s n error hpemd Programming Guide 3 59 Chapter 3 Programming Your Counter for Remote Operation Programming Examples 3 60 Programming Guide Command Reference A Dictionary Chapter 4 Command Reference Introduction Introduction This chapter describes the SCPI Subsystem commands and the TEEE 488 2 Common Commands for the HP 53150A 151A 152A Microwave Frequency Counters The information in this chapter is intended to help you program the Counter over its HP IB or RS 232 serial interface The commands are presented in alphabetical order SCPI Subsystem commands are described on pages 4 4 through 4 43 IEEE 488 2 Common command descriptions start on page 4 44 A description of the Group Execute Trigger command is also included on page 4 7 For each command description Where the phrase Sets or queries is used
94. n The Counter can receive commands and setups from a computer and it can send data and measurement results There is one configurable setting related to HP IB communication the HP IB Address Programming Guide 3 5 l i NOTE NOTE Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer The following section titled Changing the HP IB Address provides instructions for setting the HP IB address from the Counter s front panel Once the Counter is in Remote mode all front panel keys except the Reset Local key are disabled As long as local lockout is off pressing the Reset Local key returns the counter to Local mode Changing the HP IB Address Press and release the Shift key and then press HPIB Resol The HPIB ADDR menu is displayed the current HP IB address is shown to the right of the blinking indicator gt and the LED indicator between the arrow keys flashes Press the right arrow key The blinking indicator changes direction from gt to lt and the current HP IB address blinks Press or press and hold the up arrow or down arrow key to change the HP IB address the available addresses are 1 to 30 When your desired address is displayed press the Enter key The address you selected is assigned and the display returns to its normal operating mode You must press the Enter key to complete the entry To configure the Counter so that the a
95. n Status Group NOTES 1 All of the enable commands used on this figure enable all of the active bits for each event register and the Status Byte Register You do not have 4 to enable all bits Read the description of each register to determine which Use the following bits you want to enable STAT QUES ENAB 20 520 2 Additional analysis should be performed if more than one bit is set This enables any of the available bits to enerate a summary bit to the Status Byte fegister See Note 1 Go to sheet 2 of 2 Figure 3 14 Status Reporting Flowchart 1 of 2 3 44 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting From sheet 1 of 2 Initiate a Counter function For example use the following INIT This initiates the selected measurement Do you want to send a Service Request SRQ interrupt to the computer To read the Status Byte Register use the Use the following following SRE 188 STB enter A This enables any ot the available print A bits to generate the RQS MSS bit to set bit 6 in the Status Byte Register and send an SRQ inter rupt to the Computer See Note 1 This reads the decimal value of the Status Byte Register You can also use the serial poll command to read this value Ht bit 4 MAV is set read the message in p gt the Output Que
96. n a measurement has completed Operation Status Register SSTAT OPER PTR 0 NTR 16 Detect transition from measuring to non measuring STAT OPER ENABLE 16 Enable to detect measuring SRE 128 Assert SRQ on Operation Summary bit Programming Guide 3 43 Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Do you want to do Status Reporting Skip this section Status Reporting Use the following STAT OPER ENAB 6704 This enables any of the available bits to generate a summary bit to the Status Byte Register See Note 1 Reset and initialize the Counter as follows Device Clear RST YOLS SRE 0 ESE 0 STAT PRES continue program Do you want to report a measuremeni complete event from the Operation Status Group Do you want to report events monitored by the Standard Event Status Register Use the following STAT OPER PTR 6688 Use the following SSTAT OPERNTR 16 This enables the negative transition of the measuring event bit to generate a summary bit to the Status Byte Register ESE 189 This enables any of the available bits to generate a summary bit to the Status Byte Register See Note t Do you want to report events monitored by the Questionable Data Signal Status Group Do you want to report events monitored by the Operatio
97. nabled events are set TRUE Service Request Enable Register The Service Request Enable Register selects which summary bits in the Status Byte Register may cause service requests as shown in Figure 3 7 Use SRE to write to this register and SRE to read this register Use SRE 0 to clear the register A cleared register does not allow status information to generate the service requests Power on also clears this register Programming Guide 3 29 Chapter 3 Programming Your Counter for Remote Operation Status Reporting Standard Event Status Register Group Standard Event Standard Event oF al Enable Register Status Register i 0 0 _ Operation Complete i i Not Used i Query Error Device Dependent Error Execution Error Command Error Not Used Power On i To ESB bit bit 5 of the Logical OR Status Byte Register Figure 3 12 Standard Event Status Reporting Standard Event Status Register The Standard Event Status Register contains bits that monitor specific TEEE 488 2 defined events as shown in Figure 3 12 Use ESR to read this register Use ESR or CLS to clear this register Table lists the Standard Event Status Register bits and briefly describes each bit 3 30 Programming Guide NOTE Chapter 3 Programming Your Counter for Remote Operation Status Reporting BIT WEIGHT SYMBOL DESCRIPTION Operation Complete Not used because this instrument cannot request permissi
98. nded to an integer value and expressed in base 2 binary represents the bit values of the Standard Event Status Enable Register The value of unused bits is zero when queried and ignored when set This register is used to enable a single or inclusive OR group of Standard Event Status Register events to be summarized in the Status Byte Register bit 5 a Operation Complete gt Not Used Query Error ao Device Dependent Error Execution Errore oy Command Error 22 4 Not Used mee Power On 128 alo ain Nin Figure 4 3 The Standard Event Status Enable Register See the section titled Standard Event Status Register on page 3 30 of this guide for a detailed description of the Standard Event Status Register Programming Guide 4 47 lt NRF gt RANGE lt NRF gt RESOLUTION QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference Common Commands 0 to 255 1 Numeric data transferred as ASCII bytes in lt NR1 gt format e At power on the Standard Event Status Enable Register is cleared value is 0 e This value is unaffected by RST and SAV RCL Values for ESE may be entered as decimal hexadecimal octal or binary numbers None 4 48 Programming Guide i i I i i Chapter 4 Command Reference Common Commands ESR Event Status Register Query COMMAND ESR Queries the Standard Event St
99. ndhp CLS Clear event registers and error queue CALL sendhp SRE 0 Clear service request enable register CALL sendhp ESE 0 Clear event status enable register CALL sendhp STAT PRES Freset enable registers and transition filters for operation and questionable status structures CALL sendhp func CHR 34 FREQ 2 CHR 34 Measure frequency CLS Clear computer screen FOR 1 TO samples CALE sendhp INIT WAL DATA Initiate a measurement and get the result CALL IOENTERS source ng freqs i 23 ac Read the ASCII characters PRINT Frequency i freqs i NEXT i END Subroutine to send command to HP 5315xA SUB sendhp code CALL iooutputs source code LEN code END SUB Programming Guide 3 57 i Chapter 3 Programming Your Counter for Remote Operation Programming Examples Making a Frequency Measurement C This program configures the counter to make 10 frequency measurements on channel 1 followed by 10 on channel 2 The results a played on the computer monitor The program comments discuss the meaning of each command peg SCII result format is used to preserve resolution LG fiinclude lt stdio h include lt string h pI include CHPIB H include CFUNC H i i void sendhp char function to send command to counter global da
100. ng the Counter to Display Results Configuring the Counter s Display The Counter has three display modes 1 Raw results This display mode is used on power up 2 Relative results results modified by offset values N ar 3 Display Disabled All LCD display segments disabled The following command groupings show how to program the Counter to any of the above display modes 3 46 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Commands for Displaying Results Commands for Displaying Results Command for Displaying Raw Results The following command always causes raw measurement results to be displayed RST Turns off all offsets Commands for Displaying Relative Results FREQ OFFS STAT ON Turns on offsets POW AC REF STAT ON Turns on offsets Commands for Enabling and Disabling the Display The Counter display can be turned on or off The normal condition is for the display to be on DISP ENABLE OFF Disable the display all segments off DISP ENABLE ON Normal display mode Programming Guide 3 47 f f f t f t i Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements Programming the Counter to Synchronize Measurements Synchronizing Measurement Completion There are three commands for synchronizing the end of a measurement and computer transfer of data 1 The WAI command 2 The OPC command
101. nstrument to place a response in the output queue when a triggered action is complete This allows synchronization between a controller and the instrument using the MAV bit in the Status Byte Register Note that this query does not actually read a state as most queries do See the section titled Using the OPC Command on page 3 49 for an example that uses this command QUERY RESPONSE Single ASCII encoded byte 1 RELATED None FRONT PANEL KEYS NOTE The OPC query does not in any way affect the OPC bit in the Standard Event Status Register Programming Guide 4 51 COMMAND QUERY RESPONSE RANGE COMMENTS RELATED FRONT PANEL KEYS COMMAND lt NRF gt RANGE lt NRF gt RESOLUTION RELATED FRONT PANEL KEYS Chapter 4 Command Reference Common Commands PRE Parallel Poll Enable Register PRE Parallel Poll Enable Register Query PRE lt NRf gt PRE Sets or queries the value of the parallel poll enable register lt NRf gt 0 255 The parallel poll enable register is eight bits wide and has the same bit definitions as the status byte e The status byte and parallel poll enable registers are anded together the result determines the value of IST TRUE or FALSE None RCL Recall Command RCL lt NRf gt lt non decimal numeric gt This command restores the state of the instrument from a copy stored in local non volatile memory Before the recall occurs t
102. o The value of unused bits is zero when queried and is ignored when set A TRUE bit in the positive transition filter specifies that a positive FALSE to TRUE transition of the corresponding bit in the Operation Condition Status Register generates the corresponding event in the Operation Event Status Register At power on and STAT PRES the positive transition filter is preset such that each bit is a 1 TRUE This value is unaffected by RST CLS and SAV RCL None STATus PRESet This event command presets the enable registers and transition filters associated with the Operation and Questionable status reporting structures The enable registers and negative transition filters are preset such that each bit is a 0 FALSE The positive transition filters are preset such that each bit is a 1 TRUE Programming Guide 4 35 t f l COMMAND QUERY RESPONSE COMMENTS Chapter 4 Command Reference STATus Subsystem STATus QUEStionable Subtree The STATus QUEStionable subtree commands allow you to examine the status of the Counter monitored by the Questionable Data Signal Status Register Group shown in Figure 4 3 The Questionable Status Group ae consists of a condition register two transition registers an event register and an enable register The commands in this subtree allow you to control and monitor these registers See the sections titled Operation Status Register Group and Que
103. ome general purpose functions SCPI Subsystem Commands use a hierarchy relationship between keywords that is indicated by a colon For example in the SYST ERR query the between SYST and ERR indicates ERR is subordinate to SYST Table 2 2 lists the SCPI Subsystem Commands in alphabetical order by the command keyword The table shows the Subsystem commands hierarchical relationship related parameters if any and any associated information and comments Not all commands have a query form Unless otherwise stated in Table 2 2 commands have both a command and a query form Any command in the table that is shown with a at the end is a Query Only command Std New Column The Std New column in Table 2 2 shows the status of the command with respect to the SCPI standard The Std commands operate as defined in the SCPI standard and as defined in this guide The category of New consists of commands that could be SCPI approved but are not yet in the SCPI manual HP approved and submitted for SCPI approval e Not approved at all The New commands operate as defined in this guide Parameter Form Column Refer to the section titled Parameter Types on page 3 16 Programming Your Counter for Remote Operation for descriptions of the different parameter types such as lt Boolean gt lt NRf gt lt arbitrary block gt etc 2 12 Programming Guide Chapter 2 Command Su
104. on to become active IEEE 488 1 controller in charge Table 3 5 Standard Event Status Register Query Error Device Specific Error Execution Error Command Error Not used because this instrument does not define any local controls as User Request controls Power On A detailed description of each bit in the Standard Event Status Register follows Bit 0 Operation Complete is an event bit which is generated in response to the OPC command This bit indicates that the Counter has completed all pending operations the pending operation condition has transitioned from TRUE to FALSE If AVERage STATe is OFF the command INIT OPC sets the OPC bit once the instrument completes a measurement if AVERage STATe is ON the command INIT OPC sets the OPC bit once the instrument i completes a measurement consisting of AVERage COUNt measurements The OPC bit is not in any way affected by the OPC query Bit 1 is not used Bit 2 Query Error is an event bit which indicates that either 1 an attempt was made to read the Output Queue when it was empty or 2 data in the Output Queue has been lost Programming Guide 3 31 Chapter 3 Programming Your Counter for Remote Operation Status Reporting Errors 400 through 499 are query errors Bit 3 Device Specific Error is an event bit which indicates an operation did not properly complete due to some condition of t
105. ound 2 5 4 5 BASIC 1 4 BAUD 2 7 2 18 4 40 Baud rate 2 18 4 40 Block data error 5 9 Block data not allowed 5 9 Boolean 2 12 C C 1 4 CATalog 4 41 CATalog 2 18 Character data error 5 9 Character data not allowed 5 9 Character data too long 5 9 CLEAR 2 15 4 21 clear 4 45 Clear Status 2 10 CME 3 31 command equivalents 4 41 Command Error 5 6 Command error 5 8 command error definition 5 6 status bit 3 32 Command header error 5 8 Command Maps 2 2 2 3 command warning status bit 3 39 3 40 Common Commands 2 8 2 9 2 10 OLS 2 10 DDT 2 10 DDT 2 10 ESE 2 10 4 47 ESE 2 10 4 47 ESR 2 10 4 49 TDN 2 10 4 50 IST 2 10 4 50 OPC 2 10 4 51 Programming Guide Index 1 Index OPC 2 10 4 51 Service Request Enable Command PRE 2 10 4 55 PRE 2 10 Service Request Enable Query 2 11 RCL 2 10 4 52 4 55 RST 2 10 4 53 Standard Event Status Enable 2 10 SAV 2 11 4 54 Standard Event Status Enable SRE 2 11 4 55 Command 4 47 SRE 2 11 4 55 Standard Event Status Enable STB 2 11 4 57 Query 2 10 4 47 TRG 2 11 4 58 Status Byte Query 2 11 4 57 ST 2 11 4 59 Trigger 2 11 WAT 2 11 4 61 Trigger Command 4 58 Clear Status 2 10 Wait to Continue 2 11 CONFigure 2 18 Wait to Continue Command 4 61 Define Device Trigger Command common commands 2 10 definition 2 9 4 44 Define Device Trigger Query 2 10 summary list 2 10 SPlay 2 13 syntax 2 9 Event Status Register Query 2 10 Common
106. ounter cannot detect a more specific error An invalid character for the data type being parsed was encountered For example a 9 in octal data Numeric overflow The mantissa of a decimal numeric data element contained more than 255 digits excluding leading zeros A legal numeric data element was received but the Counter does not accept one in this position for the header This error can be generated when parsing a suffix This particular error message is used if the Counter cannot detect a more specific error errors 131 through 139 Programming Guide f i i Chapter 5 Errors Error Types Table 5 2 Errors Continued Error String Invalid suffix The suffix does not follow the syntax described in IEEE 488 2 or the suffix is inappropriate for the Counter Suffix too long The suffix contained more than 12 characters Suffix not allowed A suffix was encountered after a numeric element that does not allow suffixes T T Character data error is error can be generated when parsing a character data element is particular error message is used if the Counter cannot detect a more specific error errors 141 through 149 Invalid character data The character data element contains an invalid character Character data too long e character data element contains more than twelve characters T Character data not allowed A legal character data element was encountered where prohibited by the Ti
107. oup Programming Guide 4 31 Chapter 4 Command Reference STATus Subsystem COMMAND STATus OPERation CONDition Queries the status of the Operation Condition Status Register QUERY RESPONSE Numeric data transferred as ASCII bytes in lt NR1 gt format e Rangeis0O to 32 767 e The query response value is an integer formed by the binary weighting of the bits The value of unused bits is zero COMMENTS Query only e The Operation Condition Status Register is cleared at power on a e Bits are not cleared when read RELATED None FRONT PANEL KEYS COMMAND STATus OPERation ENABle lt non decimal numeric gt lt NRf gt Sets or queries the Operation Event Status Enable Register RANGE The range for the lt nen decimal numeric gt or lt NRf gt parameter is 0 to 32 767 QUERY RESPONSE Numeric data transferred as ASCII bytes in lt NR1 gt format COMMENTS The parameter and query response value when rounded to an integer value and expressed in base 2 binary represent the bit values of the Operation Event Status Enable Register e The value of unused bits is zero when queried and is ignored when set e This register is used to enable a single or inclusive OR group of Operation Event Status Register events to be summarized in the Status Byte Register bit 7 At power on and STAT PRES the Operation Event Status Enable Register is cleared value is 0 This value is unaffected by RST and SA
108. ovides you with front panel to SCPI command maps SCPI conformance information and command summary tables Chapter 3 Programming Your Counter for Remote Operation describes how to connect and set up the Counter for remote operation briefly explains the SCPI elements and formats describes status reporting describes how to write programs and provides programming examples for each of the main tasks that you want the Counter to perform Chapter 4 Command Reference is a command dictionary that describes the SCPI subsystems and IEEE 488 2 Common commands Chapter 5 Errors lists all of the error messages the Counter generates and the cause s for each error Index 1 6 Programming Guide Chapter 1 Before You Start Assumptions Assumptions 1 This guide assumes the Counter is correctly installed and interfaced to an external computer If it is not and you intend to use the HP IB see the IEEE HP IB Interconnection information in Hewlett Packard Company Tutorial Description of the Hewlett Packard Interface Bus 1987 See the section in this chapter titled Related Documentation for ordering information If you intend to use the RS 232 serial interface see the section in Chapter 3 titled To Connect With the RS 232 Serial Interface As previously mentioned this guide also assumes you are familiar with the front panel operation of the Counter See the HP 53150A 151A 152A Oper
109. ow to Use This Guide 1 3 HP 531314 132A SCPI Subsystem Commands 2 12 HP BASIC 1 9 HP Basic using 3 54 HP IB 1 2 1 7 1 9 3 2 3 5 address 3 6 operating modes 3 5 HPIB 2 17 HP IB Address 3 5 HP IB address 4 39 HPIB address 2 18 HP IB cable 3 5 HP IB operating modes Addressed talk listen 3 5 I Identification Query 2 10 IEEE 488 1 Group Execute Trigger GET 4 58 IEEE 488 1 Interface capabilities 3 6 IEEE 488 2 2 9 3 2 summary list 2 10 2 11 IEEE 488 2 Common Commands 2 2 2 9 TEEE 488 2 Standard 5 6 IEEE488 1 obtaining copy of standard 1 9 TEEE488 2 common commands 2 9 conformance 2 8 2 9 4 44 obtaining copy of standard 1 9 Ilegal parameter value 5 10 Init ignored 5 10 INITiate 2 13 4 8 4 11 initiate 4 8 initiate measurements 4 8 INITitiate 2 5 INPut 2 7 2 13 4 9 Instrument Status 2 10 4 50 Instrument Status Query 2 10 invalid block data 5 9 invalid character 5 8 invalid character data 5 9 invalid character in number 5 8 invalid expression 5 9 invalid outside macro definition 5 9 Invalid separator 5 8 Invalid string data 5 9 Invalid suffix 5 9 K KEY 2 17 4 41 key codes 2 18 key queue 4 41 L Learning to Program the Counter 1 4 list of errors 5 8 loss values 2 15 Low PASs filter 2 13 low pass filter 2 13 LPASs 2 7 4 9 M Master Summary Status 4 57 Master Summary Status bit 2 11 MAV 3 28 MAV bit 4 51 maximum value 3 16 MEASure 2 13 2 14 4 10 4 14 MEAsure using 4 17
110. r codes that can be generated by the HP 58151A 152A 153A Counters are listed in Table 5 2 Table 5 1 Error Types Error Number Error Type 0 No Error 100 to 199 Command Errors 200 to 299 Execution Errors 300 to 350 Device Specific Errors 400 to 499 Query Errors The first error described in each class for example 100 200 300 400 is a generic error No Error The SYST ERR response 0 No error indicates that there are no errors in the Counter s error queue The error queue is empty when every error in the queue has been read SYST ERR query or the queue was cleared by power on or CLS Programming Guide 5 5 Chapter 5 Errors Error Types Command Error An lt error number gt in the range 100 to 199 indicates that an IEEE 488 2 syntax error was detected by the Counter s parser The occurrence of any error in this class causes the command error bit bit 5 in the Event Status Register to be set This happens when one of the following events oceurs An IEEE 488 2 syntax error is detected by the Counter s parser That is a controller to Counter message was received that is in violation of the IEEE 488 2 Standard Possible violations include a data element that violates the Counter listening formats or whose type is unacceptable to the Counter An unrecognized header was received Unrecognized headers include incorrect Counter specific headers
111. r end and a female DB25 connector at the computer end or a double ended RJ12 cable and an RJ12 to DB25F adapter to interface the Counter with a computer Since pre manufactured RJ12 DB25 cables are rare it is probably most efficient to obtain the necessary parts and assemble the cable yourself Programming Guide 3 7 Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer Assembling the DB 25 RJ12 Adapter and the Cable Use the following procedure to wire the adapter and assemble the cable Obtain a male DB25 to female RJ12 adapter such as the Voltrex MAK206F manufactured by SPC Technology or equivalent and either a 6 conductor male to male RJ12 cable of a suitable length or a similar length of 6 conductor flat telephone cable and two RJ12 plugs RJ12 modular plugs SPC part number TA30 6 and 6 conductor flat telephone cable SPC part number TXW6151 are also available from SPC Technology and other manufacturers Adapter kits like the Voltrex MAK206F usually include a pre wired RJ12 modular receptacle a DB25F connector and the adapter body or wiring shroud Wire the RJ12 receptacle to the DB25F connector according to the diagrams in Figure 3 3 and then assemble the adapter according to the instructions included in the kit DB 25F Female RJ12 140 z RED RXD 150 BLK TXD Gp 160 O4 170 O5 180 Os 130 ee GRN GND 20 5s 210 09 220 O10 20 Su 240
112. r gt lt Serial Number gt lt Firmware ID gt e This query should be the last query in a terminated program message if it is not the last query an error 440 is generated The model number is either 53150A 53151A or 53152A e The number of digits in the serial number is not fixed e The format for the firmware ID is HO nnn where nnn is a three digit number This is followed by the date and time of the firmware release Shift Menu IST Instrument Status IST Queries the current state of the parallel poll response Instrument Status lt NRI gt 0 1 None 4 50 Programming Guide Chapter 4 Command Reference Common Commands OPC Operation Complete Command COMMAND OPC This event command enables the OPC bit bit 0 in the Standard Event Status Register to be set when a triggered action is complete See the section titled Standard Event Status Register on page 3 30 of this guide for a detailed description of the Standard Event Status Register s Operation Complete bit This event command is disabled by CLS RST power on or upon the transition of the measurement cycle from measuring to idle This event command has no query form See the section titled Using the OPC Command to Assert SRQ on page 3 50 for an example that uses this command RELATED None FRONT PANEL KEYS OPC Operation Complete Query COMMAND OPC This query causes the i
113. r to Trap an Incorrect Command Example 2 3 42 Using the Operation Status Register to Alert the Computer When Measuring has Completed Example 3 3 43 Programming the Counter to Display Results 3 46 Configuring the Counter s Display 3 46 Commands for Displaying Results 3 47 Command for Displaying Raw Results 3 47 Commands for Displaying Relative Results 3 47 Commands for Enabling and Disabling the Display 3 47 Programming the Counter to Synchronize Measurements 3 48 Synchronizing Measurement Completion 3 48 Resetting the Counter and Clearing the Interface 3 48 Using the WAI Command 3 49 Using the OPC Command 3 49 Using the OPC Command to Assert SRQ 3 50 Writing SCPI Programs 3 52 Programming Guide v Contents Programming Examples 3 54 Using HP BASIC 3 54 Using C 3 55 List of the Programming Examples 3 55 Making a Frequency Measurement HP BASIC 3 56 Making a Frequency Measurement QuickBASIC 3 57 Making a Frequency Measurement C 3 58 4 Command Reference Introduction 4 2 ABORt Command 4 4 DISPlay Subsystem 4 5 Group Execute Trigger GET 4 7 INITiate Subsystem 4 8 INPut Subsystem 4 9 MEASure Subsystem 4 10 Measurement Instructions CCONFigure FETCh MEASure READ 4 10 Descriptions of the Measurement Functions 4 16 How to Use the Measurement Instruction Commands 4 17 MEMory Subsystem 4 20 SENSe Subsystem 4 22 LSENSe FUNCtion Subtree 4 27 SENSe POWer Subtree 4 29 SENSe RO
114. rated list of functions that are OFF The string omits default nodes XNONe and uses short form mnemonics If the channel specifier s are set to default value s no channel specifier is returned in response If the channel specifier s are not set to default value s they are returned in the response with a single space separating the first channel specifier from the function name For example FREQ is returned for frequency on Channel 1 FREQ 2 is returned for frequency on Channel 2 COMMENTS RST FREQ 2 e This command can be used to turn individual function s OFF without affecting other functions e Ifthe optional channel specification is omitted from the lt sensor_function gt a default channel selection is made For Frequency and Power the default is Channel 2 RELATED Various FRONT PANEL KEYS Programming Guide 4 27 Chapter 4 Command Reference SENSe FUNCtion Subtree COMMAND _ SENSe FUNCtion ON lt sensor_function gt lt sensor_function gt Selects the sensor functions to be sensed by the Counter The supported lt sensor_function gt strings are XNONe JFREQuency 1 2P XNONe POWer 2 QUERY RESPONSE The query form of this command returns a comma separated list of functions that are ON Se E S ees The string omits default nodes XNONe and uses short form mnemonics If the channel specifier s are set to defaul
115. rence SYSTem Subsystem COMMENTS The queue is cleared emptied on CLS power on or upon reading he last error from queue Ifthe Error Queue overflows the last error in the queue is replaced with the error 350 Queue overflow Any time the queue overflows the least recent errors remain in the queue and the most recent error is discarded The maximum length of the Error Queue is 30 The Error Queue is unaffected by RST and SAV RCL It is cleared by CLS RELATED None FRONT PANEL KEYS COMMAND SYSTem KEY CATalog This query returns a list of the Counter s keys that have command equivalents The response is a definite length block that lists the key codes and their meanings There is no command version RELATED None FRONT PANEL KEYS COMMAND SYSTem KEY lt numeric_value gt This command simulates the pressing of a front panel key The lt numeric_value gt is a key code value This command puts an entry in the Key Queue just as any front panel key press does There is no query version of this command The keys and their corresponding key codes are listed in Table 4 3 Programming Guide 4 44 lt NUMERIC_VALUE gt RANGE COMMENTS RELATED FRONT PANEL KEYS COMMAND QUERY RESPONSE RELATED FRONT PANEL KEYS Chapter 4 Command Reference SYSTem Subsystem Table 4 3 Front Panel Keys and Key Codes Key Name Key Code Key Name Key Code Reset Local
116. requency Measurement QuickBASIC 3 Making a Frequency Measurement C NOTE All programming examples use the ASCII format to transfer data from the Counter to the computer The ASCII format is the default format when RST is used Programming Guide 3 55 Chapter 3 Programming Your Counter for Remote Operation Programming Examples Making a Frequency Measurement HP BASIC This program sets up the counter to make 10 frequency pea measurements on channel 2 tol The results are displayed on the computer CRT ASCII format is used to preserve resolution Trae INTEGER I clare variables DIM Freq 10 22 slare string to enter data Usang strings to enter ASCII format data yields results formatted to the orrect resolution ASCIL is the fault format for the counter Take 10 measurements Samples 10 y 1 ASS SIGN Count TO 703 sign I O path for counter pars iii CLEAR 703 r the counter and interface OUTPUT Count RST t the counter OUTPUT Count CLS ar event re ters and error queue OUTPUT Count f rvice request enable register OUTPUT Count oO Yr nt status enable register OUTPUT Count STAT PRES et enable registers and trar on filters for operation and questicnable status structures Measure frequency on channel 1 i t 1 1 o 1 1 i f t OUTPUT Count FUNC FREQ 2 1 CLEAR SCREEN t Clear the computer
117. ror is detected during the Self Test or during operation the Counter automatically sends an error message or messages over the RS 232 interface error messages must be requested over the HP IB For additional information on error messages see Appendix B of the HP 3150A 151A 152A Operating Guide Programming Guide 1 3 Chapter 1 Before You Start How to Use This Guide New Users What You Should Understand As a new user you must have some understanding of a high level language such as BASIC or C before you can use the command set defined in this guide to control the Counter In Chapter 3 Programming Your Counter for Remote Operation there are programming examples provided in HP BASIC Microsoft QuickBASIC and Borland Turbo C However whatever language you use the command strings that control the Counter remain the same Learning to Program the Counter To learn how to program the Counter perform the following Scan the summary tables in Chapter 2 Command Summary to get a feeling for the number and structure of commands available to you Read and study map drawings in the section titled Front Panel to SCPI Command Map in Chapter 2 Read Chapter 3 Programming Your Counter for Remote Operation for an overview of SCPI concepts as they relate to the HP 53150A 53151A and 53152A Frequency Counters Look at the flowcharts which illustrate some of the decisions yo
118. s Writing SCPI Programs Figure 3 15 is a general summation of how to write SCPI programs It shows a typical sequence you might go through in the process of writing a program You do not have to follow this exact sequence but it will help you to become familiar with the Counter s capabilities and to direct you to sections of the guide which will be useful while writing programs 3 52 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Writing SCPI Programs Reset and initialize the Counter as follows Device Clear JABOR Do you want to average SSTAT PRES Configure Averaging Do you want to do Status Reporting See Averaging in Chapter 3 Configure status reporting See section titied Status Reporting in this chapter See Chapter 4 STATus ESE and SRE See Figure 3 14 Initiate a measurement See Figure 2 1 See Chapter 4 INITiate a ake To transfer measurement data want to make a new measurement see Chapter 4 SENS DATA Select the function you want to perform See Figure 2 1 See SENS FUNC in Chapter 4 Figure 3 15 SCPI Programming Flowchart Programming Guide 3 53 Chapter 3 Programming Your Counter for Remote Operation Programming Examples Programming Examples In this section you will see how to program the HP 53150A 151A 152A to make common measuremen
119. s are 1 The Counter sends a command prompt over the RS 232 interface but not the HP IB after receiving and executing each command 2 When an error is detected during the Self Test or during operation the Counter automatically sends an error message or messages over the RS 232 interface error messages must be requested over the HP IB For additional information on error messages see Appendix B of the HP 53150A 151A 152A Operating Guide 3 2 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Introduction Chapter Summary Connecting the Counter to a Computer pg 3 5 Overview of Command Types and Formats pg 3 12 Elements of SCPI Commands pg 3 13 Using Multiple Commands pg 3 19 Overview of Response Message Formats pg 3 21 Status Reporting pg 3 25 Programming the Counter for Status Reporting pg 3 41 Programming the Counter to Display Results pg 3 46 Commands for Displaying Results pg 3 47 gt Programming the Counter to Synchronize Measurements pg 3 48 Writing SCPI Programs pg 3 52 Programming Examples pg 3 54 Programming Guide 3 3 Chapter 3 Programming Your Counter for Remote Operation Introduction Where to Find Some Specific Information To Connect With the HP IB pg 3 5 Configuring the HP IB pg 3 5 IEEE 488 1 Interface Capabilities pg 3 6 To Connect With the RS 232 Serial Interface pg 3 7 Making an RS 232 Cable pg 3
120. s is the generic syntax error if the Counter cannot detect more specific errors This code indicates only that an Execution Error has occurred Trigger error Used if the Counter cannot detect a more specific error from the INIT TRIG or ABOR subsystems String data error Programming Guide 5 9 Chapter 5 Errors Error Types Table 5 2 Errors Continued Number Error String Trigger ignored Init ignored Parameter error Settings conflict Data out of range Too much data legal parameter value Data corrupt or stale Hardware error Hardware missing Device specific error System error Out of memory Self test failed Queue overflow Query error Query INTERRUPTED Queue Overflow Query error Query INTERRUPTED ndicates that a GET or TRG was received and recognized by the Counter but was ignored ndicates that a request for a measurement initiation was ignored as another measurement was in progress ndicates that a program data element related error occurred This error is used when the Counter cannot detect more specific errors ndicates that a legal program data element was parsed but could not be executed due to the current Counter state ndicaies that a legal program data element was parsed but could not be executed because the interpreted value is outside the legal range defined by the Counter Typically the value is clipped to legal limit ndicates that a legal program data el
121. specific HP IB address is automatically assigned each time you turn the Counter on select the address and then save your current settings in SAV 0 The settings in SAV 0 are recalled each time the Counter is turned on IEEE 488 1 Interface Capabilities The HP 53150A 151A 152A Counter has the following IEEE 488 1 Interface capabilities SHI SR1 DT1 AHi RL1 co T6 PP1 E1 L3 DC1 3 6 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer To Connect With the RS 232 Serial Interface The HP 58150A 53151A and 53152A Frequency Counters use an RJ12 modular connector for the RS 232 interface This connector is accessible through the back panel of the counter as shown in Figure 3 2 p il ra HEWLETT paa CE with dormste ark tohage FONON O 001 Oven Time Base O 002 Battery 2I a Y o Ext DE 20 260V OO 120VAG 10 260 240VRG ORAS RS 232 Rd12 Connector Figure 3 2 Location of the RS 232 RJ12 Connector To connect the Counter to a computer using the RS 232 interface you need a serial cable that has an RJ12 modular connector at the Counter end and a female DB25 connector at the computer end Making an RS 232 Cable Most computers use male DB25 connectors for their serial ports Therefore you must use either a cable with an RJ12 plug at the Counte
122. status reporting structure The range of the lt non decimal numeric gt or lt NRf gt parameter is 0 to 32 767 Numeric data transferred as ASCII bytes in lt NR1 gt format e The parameter and the query response value when rounded to an integer value and expressed in base 2 binary represent the bit values of the negative transition filter The value of unused bits is zero when queried and is ignored when set A TRUE bit in the negative transition filter specifies that a negative TRUE to FALSE transition of the corresponding bit in the Operation Condition Status Register generates the corresponding event in the Operation Event Status Register At power on and STAT PRES the negative transition filter is preset such that each bit is a 0 FALSE This value is unaffected by RST CLS and SAV RCL None STATus OPERation PTRansition lt non decimal numeric gt lt NRf gt Sets or queries the positive transition filter for the Operation status reporting structure The range of the lt non decimal numeric gt or lt NRf gt parameters is 0 to 32 767 Numeric data transferred as ASCII bytes in lt NR1 gt format The parameter and the query response value when rounded to an integer value and expressed in base 2 binary represent the bit values of the positive transition filter 4 34 Programming Guide RELATED FRONT PANEL KEYS COMMAND Chapter 4 Command Reference STATus Subsystem
123. stionable Data Status Register Group on pages 3 37 and 3 39 for a detailed description of the Questionable Data Signal Status Register Group Bits Not Used mmi 8 Power 3 Not Used mi 4 Frequency B2 5 Not Used z 6 tO 11 Hardware Summary 4096 12 Not Used __ 13 Command Warning 16384 14 Not Used gt 15 Figure 4 2 The Questionable Data Signal Status Register Group STATus QUEStionable CONDition Queries the status of the Questionable Data Condition Status Register Numeric data transferred as ASCII bytes in lt NR1 gt format e Range is 0 to 32 767 e The query response value is an integer formed by the binary weighting of the bits The value of unused bits is zero The Questionable Data Condition Status Register is cleared at power on t i e Bits are not cleared when read 4 36 Programming Guide Chapter 4 Command Reference STATus Subsystem RELATED None FRONT PANEL KEYS COMMAND STATus QUEStionable ENABle lt non decimal_numeric gt lt NRf gt Sets or queries the Questionable Data Event Status Enable Register RANGE The range of the lt non decimal numeric gt or lt NRf gt parameter is 0 to 32 767 QUERY RESPONSE Numeric data transferred as ASCII bytes in lt NR1 gt format COMMENTS gt The parameter and the query response value when rounded to an integer value and expressed in base 2 binary represent t
124. t parameter is outside the measurement capabilities of the Counter model an error is generated and the command does not execute For POWer lt resolution gt must be defaulted or set to 0 01 dB e See Descriptions of the Measurement Functions on page 4 16 for a description of each of the measurement functions Refer to Table 4 2 for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions Programming Guide 4 15 l COMMAND FUNCTION DESCRIPTION Chapter 4 Command Reference MEASure Subsystem Descriptions of the Measurement Functions Table 4 2 lists the available measurement functions the parameters that can be used with them and the valid values for lt source_list gt Table 4 2 The lt function gt lt parameters gt and lt source_list gt for the Measure Instruction Commands lt Tanations source TebT VOLTage FREQuency lt expected_value gt lt resolution gt 1 2 POWer AC L 2 lt expected_value gt lt resolution gt lt source_list gt uses the same syntax as SCPI lt channel _list gt MEASure SCALar VOLTage FREQuency lt expected_value gt lt resolution gt 1 2 This command measures frequency sexpected_value gt Channel 1 range 10 Hz to 125 MHz MIN MAX DEF Channel 2 range 100 MHz to 20 GHz 53150A 26 5 GHz 53151A 46 GHz 53152A M
125. t value s no channel specifier is returned in response If the channel specifier s are not set to default value s they are returned in the response with a single space separating the first channel specifier from the function name For example FREQ is returned for frequency on Channel 1 FREQ 2 is returned for frequency on Channel 2 The only functions that can be turned ON simultaneously are POW 2 and FREQ 2 COMMENTS RST FREQ 1 This command can be used to turn individual function s ON without affecting other functions Ifthe optional channel specification is omitted from the lt sensor_function gt a default channel selection is made For Frequency and Power the default is Channel 2 RELATED Various FRONT PANEL KEYS mn 4 28 Programming Guide Chapter 4 Command Reference SENSe FUNCtion Subtree COMMAND SENSe FUNCtion STATe lt sensor_function gt This query only command returns a Boolean value that indicates whether the specified lt sensor_function gt is currently ON or OFF COMMENT See SENSe FUNCtion ON on page 4 28 for valid lt sensor_function gt strings SENSe POWer Subtree This subtree controls the power measurement function COMMAND SENSe POWer AC REFerence lt numeric_value gt lt power_units gt This command sets a reference amplitude in dB for display of power measurements It is intended for use as a measurem
126. ta long ctr 703 Counter is at address 03 HP IB is at select code 7 int error H void main long isc 7 sct code 7 KZA int state W1 in IOEOI ba Ant t for loop co ty int sample Nunber of measureme to take wa Max number of bytes per measurements A to hold quency string ef the HP IB interface Sr the counter KA event regi s and error queue ef service re t enable register 7 event stat able register a Preset enable registers and transition filters for operation and questionable status structures tA IOEOI isc state Enable use of EOL sendhp FUNC FREQ 1 Measure frequency on channel 1 Note that the function must be a quoted string The actual string sent to the counter is FREQ 1 for i l i lt samples i sendhp INIT Start a measurement xf IOENTERS ctr freq amp length fetch the data length strlen freq Get length of result so xf the linefeed can be removed s He n i freq ftreq gth 1 0 printf Frequency printf Press a key to continue n getch sendhp FUNC FREQ 2 Change channels i for i l i lt samples it pi baad sendhp INIT WALT DATA Start a measurement LOENTERS ctr freq amp length fetch the data rF Hi length strlen freq Get length of result so Bi Saed freq length 1 0 the Lin ed can be re
127. tem commands The syntax is a pound sign followed by a non zero digit representing the number of digits in the subsequent decimal integer The decimal integer specifies the number of 8 bit data bytes being sent This is followed by the actual data The terminator is a line feed asserted with EOI For example for transmitting 8 bytes of data the format could be Number of digits that follow Actual data Terminator 208 lt 8 bytes of data gt lt new line gt EOI Number of bytes to be transmitted The 2 indicates the number of digits that follow and the two digits 08 indicate the number of data bytes to be transmitted a zero length block has the format 0 lt new line gt EOl lt new line is defined as a single ASCll encoded byte corresponding to 10 decimal 3 16 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Parameter Separator If you send more than one parameter with a single command you must separate adjacent parameters with a comma Query Parameters All selectable lt numeric value gt parameters except Common Commands can be queried to return the minimum maximum and DEFault values they are capable of being set to by sending a MINimum MAXimum or DEFault parameter after the For example consider the AVERage COUNt query If you send the query without specifying a parameter AVER COUN the present
128. the DATA command which requests the results AVERAGE STATE ON Enable averaging AVERAGE COUNT 50 Base the result on 50 measurements INIT Start 50 measurements WAI Wait until 50 measurements are complete before parsing another command At this point commands can be issued to other instruments The Counter stores subsequent commands but ignores them until the measurement is complete DATA Asks for the results of the 50 measurements This command is not executed until all 50 measurements are complete and the average is computed Using the OPC Command This method is useful if you want to hold off execution of the program while you wait for the Counter to complete any pending activity In the WAI example above the line following the WAI command is accepted by the Counter However the Counter does not execute the command Programming Guide 3 49 i i Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements because of the preceding WAI command If this line had been a command to address another instrument it would be immediately executed If you had wanted to hold off the command to another instrument you would use the OPC command instead of the WAI command AVERAGE COUNT 50 On INIT take 50 measurements AVERAGE ON Enable averaging INIT Start making measurements OPC Tell Counter to put a 1 in the output buffer when 50th
129. the SENSe subsystem Frequency on channel 1 or 2 Power on channel 2 Subtree Controls the use of filtering routines in the instrument Turns automatic FM compensation ON or OFF Programming Guide Chapter 2 Command Summary HP 53150A 151A 152A Command Summary Table 2 2 HP 53150A 151A 152A SCPI Command Summary Continued Keyword Syntax SENSe cont FREQuency OFFSet STATe RESolution TRACking FUNCtion OFF ON STATe POWer AC REFerence STATe ROSCillator SOURce Parameter Form lt numeri c_ value gt frequency unit lt Boolean gt lt numeric_value gt frequency unit lt character_data gt FAST SLOW OFF lt sensor_function gt lt sensor_function gt IXNONe FREQuency 1 2 IXNONe POWer 2 lt sensor_function gt lt sensor_function gt XNONe FREQuency 1 2 IXNONe POWer 2 lt sensor_function gt lt numeric_value gt lt Boolean gt lt character_program_data gt INTernal EXTernal Sid New Comments Subtree Controls the frequency measuring capabilities of the instrument Sets a reference frequency for all other absolute frequency settings in the instrument When STATe is ON frequency measurements are modified by the value of FREQ OFFset Sets the frequency measurement resolution Selects one of three signai tracking modes Subiree Selects the lt
130. the current status of a related condition The Questionable Data Event Status Register is cleared by CLS by SSTAT QUES EVEN and at power on None 4 38 Programming Guide Chapter 4 Command Reference SYSTem Subsystem SYSTem Subsystem This subsystem collects together the capabilities that are not related to instrument performance i SYSTem COMMunicate Subtree The SYSTem COMMunicate subtree collects together the configuration of the control communication interfaces The SYSTem COMMunicate SERial subtree controls the physical configuration of the RS 232C port Any command to change the settings takes effect immediately upon receipt of the program message termination These settings are stored in non volatile memory and are unaffected by power on SAV RCL and RST The SYSTem COMMunicate SERial TRANsmit subtree controls parameters associated with transmission The Counter always uses eight data bits one stop bit and no parity COMMAND SYSTem COMMunicate GPIB SELF ADDress lt numeric_value gt Sets the HP IB address that the Counter uses REPLY FORMAT lt NRI gt COMMENTS gt The range for lt numeric_value gt is 0 through 30 The default setting is address 19 This value is unaffected by RST To change the HP IB address used at power on save the instrument settings using the SAV 0 command after changing the HP IB address RELATED Shift
131. the message by using some type of enter statement that includes the device address and an appropriate variable Use a print statement to display the message The following HP BASIC example illustrates how to query the Counter and display the message 10 OUTPUT 703 ROSC SOUR 20 ENTER 703 A 30 PRINT A 40 END Response Message Syntax i Figure 3 9 shows the simplified syntax of a Response Message Response messages may contain both commas and semicolon separators When a single query command returns multiple values a comma is used to i separate each item When multiple queries are sent in the same program message the groups of data corresponding to each query are separated by a semicolon Note that a lt new line gt END is always sent as a response message terminator Programming Guide 3 21 Chapter 3 Programming Your Counter for Remote Operation Overview of Response Message Formats O O NOTE lt new line gt ASCI character decimal 10 AEND EOI asserted concurrent with last byte multiple response separator ASCII character decimal 59 data separator within a response ASCII character decimal 44 lt new line gt Figure 3 9 Simplified Response Message Syntax Diagram 3 22 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Overview of Response Message Formats Response Message Data Types Table 3 3 Response Message Data Types Description T
132. thus alert the computer that the Counter needs attention The following examples show how each of the register groups can be used Figure 3 14 is a flewchart that shows how to program the Counter for Status Reporting Programming Guide 3 41 Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Resetting the Counter and Clearing the Remote Interface Example 1 Before attempting any programming it is a good idea to set the Counter to a known state The following command grouping shows how to reset the Counter Before issuing these commands execute a device clear to reset the interface and Counter Consult your interface card s documentation for how to issue a device clear since the device clear command will be specific to the interface you are using Perform the following 1 Issue an Interface Clear and a Device Clear See your computer or interface card documentation on how to issue this command 2 Issue the following commands RST CLS SRE 0 HSE 0 STAT PRES Using the Standard Event Status Register to Trap an Incorrect Command Example 2 The following command grouping shows how to use the Standard Event Status Register and the Status Byte Register to alert the computer when an incorrect command is sent to the Counter The command ESE 32 tells the Counter to summarize the command error bit bit 5 of the Event Status Register in the Status Byte Re
133. tinuously the ABORt command aborts the current measurement in progress however the value of INITiate CONTinuous is unaffected If CONTinuous was set to ON prior to receiving ABORt it remains ON and a new measurement begins COMMENTS When a single measurement is in progress CINIT CONT is OFF Error 213 Init ignored is generated and the state of INIT CONT is unaffected by INIT CONT ON Error 210 Trigger error is generated by INIT CONT OFF NOTE The Counter powers up with INIT CONT set to ON but RST sets SINIT CONT to OFF i 4 8 Programming Guide Chapter 4 Command Reference INPut Subsystem COMMAND INITiate IMMediate This event command causes the instrument to initiate either a single measurement or a block of measurements COMMENT This command is an overlapped command see IEEE 488 2 Section l 12 Beginning a measurement or block of measurements with an INITiate IMMediate sets the Pending Operation Flag to true Completing the measurement or block of measurements normally or by aborting sets Pending Operation Flag to false RELATED None FRONT PANEL KEYS INPut Subsystem This subsystem controls the characteristics of the Counter s input ports COMMAND INPut FiLTer LPASs STATe lt Boolean gt Sets or queries the state of the Channel 1 low pass filter QUERY RESPONSE Single ASCII encoded byte 0 or 1 A value of 0 indicates OFF a valu
134. ts Examples are provided in the following programming languages HP BASIC Microsoft QuickBASIC e C Using HP BASIC This guide uses doubles quotes to enclose string parameters in syntax descriptions but uses single quotes in the HP BASIC programming examples for readability The Counter allows string parameters to be enclosed by either double or single quotes Each method is discussed in the following sub sections Sending Double Quoted and Single Quoted Strings In HP BASIC OUTPUT statements strings enclosed in double quotes need special consideration For example you can send the FUNC FREQ 1 command as follows OUTPUT 703 FUNC FREQ 1 Note that a pair of double quotes shown in bold is required to embed a double quote within an HP BASIC string For more readable HP BASIC OUTPUT statements you can send the following command instead OUTPUT 703 FUNC FREQ 1 Note that the pair of single quotes shown in bold is more readable Microsoft is a U S registered trademark of Microsoft Corporation Turbo C is a product of Borland International Inc 3 54 Programming Guide i Chapter 3 Programming Your Counter for Remote Operation Programming Examples Using C The C examples assume you have an HP 82335A HP IB Interface card inside your IBM PC or compatible List of the Programming Examples The following examples are provided 1 Making a Frequency Measurement HP BASIC 2 Making a F
135. u must make when programming the Counter Read the section at the end of Chapter 3 titled Programming Examples Modify some of the programming examples to select specific measurement functions If the programs work consider yourself an experienced programmer and use Chapter 4 Command Reference as a reference for detailed information of all the Counter s SCPI commands 1 4 Programming Guide Chapter 1 Before You Start How to Use This Guide Experienced Programmers If you have programmed other HP IB instruments you are probably familiar with many of the concepts and techniques discussed in this guide Using the SCPI commands is also very similar to using the earlier HP IB commands The main difference between the two command sets is the hierarchy of the subsystem commands However this type of structure has previously been used on other instruments Because the SCPI command set and some of the status reporting techniques are new we advise you to use the following sequence to learn the Counter programming requirements Look over the steps for a new user and perform any that you think are applicable to your current level of knowledge In particular look at the measurement techniques and examples provided in Chapter 3 Programming Your Counter for Remote Operation Review the summary tables in Chapter 2 Command Summary If this chapter contains sufficient information to get yo
136. u started write some test programs to explore the Counter s capabilities If you need additional information on any command refer to the applicable command description in Chapter 4 Command Reference Review the remaining information in this guide to determine what is applicable to your programming requirements If you need more information than is contained in this guide see the section in this chapter titled Related Documentation Applications After you have read the appropriate information and written some measurement programs you may want to expand the scope of your applications The following two techniques are explained in detail Ifyou are going to write interrupt driven programs or if you just want to determine the status of the Counter read the section titled Status Reporting in Chapter 3 o Ifyou are going to write programs to transfer data between the Counter and an external computer read the section titled Overview of Response Message Formats in Chapter 3 Programming Guide 1 5 Chapter 1 Before You Start Programming Guide Contents Programming Guide Contents The following information is contained in this guide Table of Contents Chapter 1 this chapter Before You Start is a preface that introduces you to the programming guide Chapter 2 Command Summary is a quick reference that summarizes the Counter s programming commands It pr
137. ue How you do this de pends on what data is expected Are you planning to monitor the OPC bit of the Event Status Register e Note 2 if bit 3 QSB is set use the following STAT QUES EVENt This returns the decimal value of the event register It alsa clears the register so that subsequent events can be monitored Enable OPC bit of Event Status Register OPC ff bit 5 ESB is set use the following ESR This returns the decimal value of the event register it also clears the register so that subsequent events can be monitored Activate the Counter function that you want to monitor For example use the following INIT if bit 7 OSB is set use the following SSTAT OPER EVEN This initiates the selected measurement This returns the decimal value of the event register It also clears the register so that subsequent events can be monitored When an interrupt occurs perform a Serial poll Write the necessary subroutines to determine which events have occured and what actions are required Is SRQ interrupt enabled a subroutine to determine which bits in the Status Byte Register are set Figure 3 14 Status Reporting Flowchart 2 of 2 Programming Guide 3 45 Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Display Results Programmi
138. uery 2 10 parallel poll response 2 10 4 50 parameter error 5 10 arameter not allowed 5 8 parameter types 2 12 3 16 parameters 2 14 4 12 eak to peak voltage 4 27 4 28 eriod 4 27 4 28 hase 4 27 4 28 PON 3 31 ositive pulse width 4 27 4 28 positive transition filter 2 17 ositive transition filter register 3 37 POWer 2 5 2 14 2 16 4 29 power correction 2 15 ower on status bit 3 32 ower correction 4 20 ower on 3 29 3 32 PRESet 2 17 preset 4 35 profile 4 23 profile names 4 20 4 21 4 23 program mnemonic too long 5 8 program the Counter for status reporting 3 41 programming for status reporting 3 41 Programming Guide Contents 1 6 programs examples 3 55 writing SCPI reference flowchart 3 52 PTRansition 2 17 4 34 Q QSB 3 28 Query DEADLOCKED 5 11 query error 5 7 5 10 query form 2 12 Programming Guide Index 5 Index STATus 4 31 Vv OPERation version SCPI 4 42 CONDition 4 32 VOLTage 2 14 an SYSTem 4 39 voltage a subsystem error maximum 4 27 4 28 g SYSTem minimum 4 27 4 28 i ERRor 4 40 om Suffix error 5 8 W Suffix not allowed 5 9 Wait to Continue 2 11 ney Suffix too long 5 9 command 4 61 ad Summary of the Measurement WINDow 4 5 Instruction Commands 4 11 writing programs general 3 52 Syntax error 5 8 syntax error 5 6 SYSTem 2 7 2 18 4 39 4 40 4 41 Communicate Subtree 4 39 ERRor command 5 3 System error 5 10 T time interval 4 27 4 28 Too many digits
139. ulates the pressing of a front panel key Query only Returns a list of defined key codes Query only Returns the SCP version number with which the Counter complies TRIGger SEQuence HOLDoff lt numeric_vaiue gt Subsystem When INIT CONT ON this command specifies the length of the delay between measurements 2 18 Programming Guide Chapter 2 Command Summary RST Response RST Response The IEEE 488 2 RST command returns the instrument to a specified state optimized for remote operation Use CLS to clear the status event registers and the SCPI error queue The states of command settings affected by the RST command are described in Table 2 3 Table 2 4 lists command settings that are unaffected by RST Table 2 3 HP 53150A 151A 152A RST State Command Header Parameter DDT lt arbitrary block gt A4INIT DISPlay WINDow BACKground STATe lt Boolean gt ON DISPlay ENABle lt Boolean gt ON NiTiate CONTinuous lt Boolean gt OFF INPut FilTer LPASs S TATe lt Boolean gt OFF SENSe AVERage STATe lt Booiean gt OFF SENSe AVERage COUNT lt numeric_value gt 1 SENSe FILTer FM AUTO lt Boolean gt ON SENSe CORRection CSET SELect lt character_data gt CORR1 SENSe CORRection CSET STATe lt Boolean gt OFF SENSe FREQuency OFFset lt numeric_value gt frequency unit gt 0 SENSe FREQuency OFFset STATe lt Boolean gt OFF SENSe FREQuency
140. wo to ten comma separated NRf format number pairs The data point number pairs in the named profile are automatically sorted by frequency value before the profile is stored When power correction is in use the Counter uses the data points in the currently selected profile to determine the amount of loss correction to apply If the measured frequency is between two defined data points the Counter uses the two defined data points to linearly interpolate the appropriate correction value If the measured frequency is above the highest frequency value in the profile or below the lowest frequency value the Counter determines a loss correction value by using the two highest or lowest defined data points to extrapolate a linear extension to the curve above the highest data point or below the lowest data point Shift Menu PWR CORR 4 20 Programming Guide COMMAND COMMENTS RELATED FRONT PANEL KEYS COMMAND QUERY RESPONSE COMMENTS RELATED FRONT PANEL KEYS Chapter 4 Command Reference MEMory Subsystem MEMory CLEAR NAME lt name gt Resets the contents of the named power correction profile to the default configuration Valid profile names CORR1 CORR2 CORR9 The data currently stored in non volatile memory for the named correction profile is discarded e The default power correction profile configuration consists of two data points both having loss values of zero One o
141. y returns the measurement taken by the INITiate or READ command or the MEASure query QUERY RESPONSE If no valid result is available no result is returned and error 230 is generated COMMENTS When SCALar lt function gt is specified the instrument retrieves the specified result if it matches the current measurement type or can be derived from the current measurement type When SCALar lt function gt is omitted the function specified used by the last CONFigure MEASure READ or FETCh is used if possible Issuing this query while a measurement is in progress prevents further commands from being processed until the measurement completes This hold off action can only be canceled by the completion of the measurement Device Clear or power on Ifan lt expected_value gt parameter is outside the measurement capabilities of the Counter model an error is generated and the command does not execute For POWer lt resolution gt must be defaulted or set to 0 01 dB See Descriptions of the Measurement Functions on page 4 16 for a description of each of the measurement functions Refer to Table 4 2 for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions Programming Guide 4 13 COMMAND COMMENTS Chapter 4 Command Reference MEASure Subsystem MEASure SCALar lt function gt lt parameters gt lt source_list
142. ycle 4 27 4 28 E ENABle 2 17 4 32 4 37 enable registers 4 35 ERRor 4 40 error command 5 6 execution 5 6 how to query 5 3 list 5 8 messages 5 8 query 3 31 4 40 5 7 queue 5 4 syntax 5 6 type 5 5 error message 1 3 3 2 error number 5 6 Error Queue 2 17 5 3 5 4 overflow 5 4 Error Types 5 5 ERRor 2 18 errors list 5 8 ESB 3 29 EVENt 2 17 4 33 4 37 Event Enable Register 3 38 3 36 3 37 Event Register 3 33 3 35 3 37 Event Status Register Query 2 10 4 49 EXE 3 31 execution error 5 6 5 9 definition 5 6 status bit 3 32 expected_value 4 12 4 13 exponent too large 5 8 expression data not allowed 5 9 expression error 5 9 F fall time 4 27 4 28 FETCh 2 13 2 14 4 10 FETCh 4 11 4 13 FILTer 2 7 2 15 4 9 4 24 ilter 2 13 FM 2 15 4 24 FM compensation 2 15 4 24 M signals 2 15 4 24 REQuency 2 5 2 14 2 15 4 25 4 26 requency 4 16 4 17 4 27 4 28 yequency modulation 4 24 requency ratio 4 27 4 28 requency unit 2 16 frequency values 2 16 ront panel to SCPI command maps 2 3 FUNCtion 2 5 2 16 4 28 4 29 unction 2 14 4 12 4 18 4 27 4 28 G general purpose functions 2 12 GET 2 10 2 11 4 7 GET not allowed 5 8 Getting Started 1 3 GPIB 2 18 4 39 Group Execute Trigger GET 4 7 5 6 H hardware error 5 10 hardware missing 5 10 header separator error 5 8 header suffix out of range 5 8 Programming Guide Index 3 Index HOLDoff 2 18 holdoff 4 61 H
143. you have probably seen a general trend toward the techniques specified in the SCPI standard For example several instruments are already using a hierarchy of commands that is similar to the command structure defined by the SCPI standard 1 2 Programming Guide NOTE Chapter 1 Before You Start Getting Started Getting Started Before attempting to program the Counter take some time to familiarize yourself with the content of this guide The remainder of this chapter contains the following information e An explanation of how you should use the programming guide based on your experience programming instruments and your testing requirements e Adescription of the guide contents Astatement of assumptions that are made in the guide e A list of related documentation How to Use This Guide How you use this guide depends upon how much you already know about programming instruments and how complex your measurement requirements are Let s start by establishing your programming background and then discuss the type of measurements you want to perform With two minor exceptions the only difference between programming the Counter using the HP IB interface and the RS 232 serial interface is the manner in which you connect the Counter to the computer These exceptions are 1 The Counter sends a command prompt over the RS 232 interface but not the HP IB after receiving and executing each command 2 When an er
144. ytes that is the 3 28 Programming Guide Chapter 3 Programming Your Counter for Remote Operation Status Reporting Output Queue is not empty This bit is set FALSE zero when the Output Queue is empty Bit 5 ESB summarizes the Standard Event Status Register This bit indicates whether or not one of the enabled Standard Event Status Register events have occurred since the last reading or clearing of the Standard Event Status Register This bit is set TRUE one when an enabled event in the Standard Event Status Register is set TRUE Conversely this bit is set FALSE zero when no enabled events are set TRUE Bit 6 RQS MSS summarizes IEEE 488 1 RQS and Master Summary Status When a serial poll is used to read the Status Byte Register the RQS bit indicates if the device was sending SRQ TRUE The RQS bit is set FALSE by a serial poll When STB is used to read the Status Byte Register the MSS bit indicates the Master Summary Status The MSS bit indicates whether or not the Counter has at least one reason for requesting service Bit 7 OSB summarizes the Operation Status Event Register This bit indicates whether or not one or more of the enabled Operation events have occurred since the last reading or clearing of the Operation Status Event Register This bit is set TRUE one when an enabled event in the Operation Status Event Register is set TRUE Conversely this bit is set FALSE zero when no e
Download Pdf Manuals
Related Search
Related Contents
Gebrauchsanleitung Instructions for Use Mode d`emploi Philips MCM166 10W Classic micro music system 1. Capa_Introdução_Sumário.p65 - Tribunal Regional Eleitoral do Manual do Proprietário Samsung Galaxy Ace Plus Bruksanvisning Manuel d`utilisation Kingdom Hall Audio 3 - iDo Technology, Inc. Copyright © All rights reserved.
Failed to retrieve file