Home
HP 132A User's Manual
Contents
1. The following lines will provide the fastest throughput regardless of the state of the counter before these lines ar xecuted CALL sendhp FREQ ARM STAR SOUR IMM These 3 lines enable using CALL sendhp FREQ ARM STOP SOUR IMM time arming with a 0 1 second CALL sendhp EVENT1 LEVEL 0 Set trigger level on channel 1 This also disables auto trigger CALL sendhp CALC MATH STATE OFF Make sure all post processing CALL sendhp CALC2 LIM STATE OFF is turned off CALL sendhp CALC3 AVER STATE OFF CALL sendhp HCOPY CONT OFF Do not update printing operations CALL sendhp ROSC SOUR INT CALL sendhp ROSC EXT CHECK OFF CALL sendhp DIAG CAL INT AUTO OFF Disable automatic interpolator calibration The most recent calibration factors will be used in the calculation for frequency CALL sendhp DDT 15FETC Define trigger as fetc CALL sendhp DISP ENABLE OFF Turn off the display CALL sendhp READ FREQUENCY Read th xpected frequency CALL IOENTERS source fregqstring 1 maxelem S actual CALL sendhp FREQ EXP1 freqstring l1 Send th xpected frequency CALL sendhp INIT CONT ON Start making measurements PRINT Making measurements FOR i 1 TO samples
2. include lt stdio h gt used for printf include lt string h gt used for strlen include CHPIB H HP IB library constant declarations include CFUNC H HP IB library function prototypes void sendhp char function to send command to counter global data long ctr 703 Counter is at address 03 HP IB is at select code 7 int error void main long isc 7 Select code 7 int status Used in IOSTATUS int state 1 Used in IOEOI inti Used for loop counter float exp_freq Expected frequency value int readings 1000 Number of measurements to take int length 23 Max number of bytes per measurement char freq 1001 23 Array to hold measurements char destination 130 Used for expected frequency IORESET isc Clear the HP IB interface sendhp RST Reset the counter sendhp CLS Clear event registers and error queue sendhp SRE 0 Clear service request enable register sendhp ESE 0 Clear event status enable register sendhp STAT PRES Preset enable registers and transition IOEOI isc state hi sendhp FUNC FREQ 1 sendhp FREQ ARM STAR SOUR sendhp FREQ ARM STOP SOUR sendhp EVENT1 LEVEL 0 3 96 filters for operation and questionable status structures Enable use of EOI
3. Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Perform a Time Interval Calibration HP BASIC Continued CLEAR Count OUTPUT Count RST Reset the HP 53131A OUTPUT Count CLS Clear event registers and error queue OUTPUT Count SRE 0 Clear service request enable register OUTPUT Count ESE 0 Clear event status enable register OUTPUT Count STAT PRES Preset enable registers and transition filters for operation and questionable status structures RETURN Unsecure Routine UNSECURES the device OUTPUT Count CAL SEC STAT Query the current security status ENTER Count Device_secure Check SECURED 1 UNSECURED 0 WHILE Device_secure 1 If device is SECURED INPUT Enter security code to unsecure counter Code OUTPUT Count CAL SEC STAT OFF Code UNSECURE the device OUTPUT Count CAL SEC STAT verify it is SECURED ENTER Count Device_secure IF Device_secure 1 THEN On operator error loop PRINT Wrong code try again GOSUB Read_errors END IF END WHILE RE
4. Make a frequency measurement IMM These 2 lines enable the IMM AUTO arming mode Set a trigger level for channel 1 This disables the auto trigger throughput increasing Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Optimize Throughput Turbo C Continued sendhp ROSC SOURCE INT Use internal oscillator If you want to use an external timebase you must select it and turn off the automatic detection using ROSC EXT CHECK OFF sendhp DIAG CAL INT AUTO OFF Disable automatic interpolater calibration The most recent calibration values are used in the calculation of frequency sendhp DISP ENABLE OFF Turn off the counter display sendhp HCOPY CONT OFF sendhp CALC MATH STATE OFF Disable any post processing sendhp CALC2 LIM STATE OFF sendhp CALC3 AVER STATE OFF sendhp DDT 15FETC Define the Trigger command This means the command FETC does not need to be sent for every measurement decreasing the number of bytes transferred over the bus sendhp INIT CONT ON Put the counter in Run mode sendhp FETCH FREQ Fetch the frequency to be IOENTER ctr amp exp_freq E fot th xpected frequency st
5. 2 33 SENSe Cont FUNCtion ON PHASe ARM START SLOPe SOURce Chapter 2 Command Summary HP 53131A 132A Command Summary Table 2 2 HP 53131A 132A SCPI Command Summary Continued New lt sensor_function gt See below EJIXNONe DCYCle 1 EJIXNONe PDUTycycle 1 EJ IXNONe FALL TIME 1 EJIXNONe FTIMe 1 EJ XNONe FREQuency 1 2 3 IIXNONe FREQuency RATio 1 2 1 3 2 1 Say EJIXNONe JNWIDth 1 EJ IXNONe PERiod 1 2 3 EJIXNONe PHASe 1 2 EJ XNONe PWIDth 1 EJ XNONe RISE TIME 1 EJIXNONe RTIMe 1 EJ IXNONe TINTerval 1 2 IXNONe TOTalize 1 IXNONe VOLTage MAXimum 1 2 IIXNONe VOLTage MINimum 1 2 J XNONe VOLTage PTPeak 1 2 POSitive NEGative IMMediate EXTernal Subtree Selects the lt sensor function gt to be sensed by the instrument Sets the lt sensor function gt to be sensed by the instrument Positive duty cycle on channel 1 Positive duty cycle on channel 1 Fall Time on channel 1 Fall Time on channel 1 Frequency on channel 1 2 or 3 Frequency Ratio 1 to 2 1 to 3 2 to 1 or 3 to 1 Negative Pulse Width on channel 1 Period on channel 1 2 or 3 Phase of channel 1 relative to channel 2 Positive Pulse Width on channel 1 Rise Time on channel 1 Rise Time on channel 1 Time Interval channel 1 to channel 2
6. 3 66 M STAR SOUR IMM 20 1 Note that the function must be a quoted string The actual string sent to the counter is PER These thr lines enabl time arming with a 0 01 second gate time j Computing Statistics bit in Operation status register When statistics are complete the bit will go from high to low so a negative transition is needed to enable the bit that is summarized in the Status Byte Register This is the bit from the Operation Status register that is summarized in the Status Byte Register When it goes high SRQ will be asserted Programming Guide 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 OOO roO Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Use Limits to Filter Data Before Measuring Stats HP BASIC Continued Count CALC3 LFIL STATE ON Count CALC3 LFIL LOWER Lower Count CALC3 LFIL UPPER Upper Count CALC3 AVER ON Count CALC3 AVER COUNT Num_meas Enable statistics filter Set the lower limit Set the upper limit Enable statistics Set number of measurements for stats Enable limit testing This must happen in order to see the limit graph Set the limits lower limit Set th
7. Definite Length Block e The query response will be 256 lt 56 calibration data bytes gt terminated with a new line and EOI e This command does not affect the interpolator calibration data e Ifthe lt arbitrary block gt command parameter has the incorrect number of bytes or does not checksum error 220 is generated e If the update to EEPROM fails error 2013 is generated e The calibration data updated by this command is stored in non volatile memory so cycling power will not reset these values The only way to update the calibration data is through this command or by initiating the individual calibrations see DIAG CAL e The calibration data updated by this command is unaffected by power on save recall and RST Programming Guide 4 27 Chapter 4 Command Reference CALibration Subsystem CALibration SECurity Subtree This subtree provides capabilities related to the security of the Counter s calibration factors Note early versions of the Counter do not support any of the CALibration SECurity commands CALibration SECurity CODE lt NRf gt lt NRf gt Range lt NRf gt Resolution Comments Related Front Panel key Sets the calibration security code To change the security code the Counter must first be unsecured To unsecure the Counter use the CALibration SECurity STATe command 0 to 9999999 1 e No query e The calibration code is stored in non volatile memory and is un
8. NOW query status to assess 1320 ENTER Count Status PASS FAIL status of the 1330 calibration 1340 O PASS 1 FAIL 1350 IF Status lt gt 0 THEN 1360 PRINT Fine TI calibration failed 1370 END IF 1380 RETURN 1390 3 71 Programming Guide 400 410 420 1430 1440 450 460 470 1480 1490 1500 1510 1520 1530 1540 1550 1560 1570 1580 1590 1600 1610 1620 1630 1640 1650 1660 1670 1680 1690 1700 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Perform a Time Interval Calibration HP BASIC Continued Restore_cal Restores the calibration data previously saved IF Status 0 THEN INPUT Calibration successful restore backup anyway AnswerS ELSE INPUT Calibration unsuccessful restore backup Answer END IF IF AnswerS 1 1 y OR Answer 1 1 Y THEN PRINT Restoring saved data OUTPUT Count CAL DATA Head1S amp Cal_data Send calibration data END IF GOSUB Read_errors RETURN Wait_for_input INPUT Input signal ready Answers WHILE Answer 1 1 lt gt Y AND Answer 1 1 lt gt y INPUT Input signal ready Answers END WHILE RETURN j d_errors PEAT OUTPUT Count SYST ERR ENTER Count Err_num Err_string IF Err _num lt gt 0 TH PRINT Err_num END IF NTIL Err_num 0 T rr_string t H3 G ZO
9. The current instrument state is saved in register 0 when RCL or front panel recall is executed lt NRf gt Range 1 to 20 lt NRf gt 1 Resolution Comments The following states are not saved EMC ESE OPC SRE CALibration COUNt CALibration DATA CALibration SECurity CODE CALibration SECurity STATe CONFigure response DIAGnostic CALibration INTerpolator AUTO DISPlay ENABle DISPlay MENU STATe DISPLay WINDow TEXT RADix FETCh implied function READ implied function SENSe FREQuency EXPected 11213 SENSe FREQuency EXPected 112I3 AUTO SENSe ROSCillator EX Ternal CHECk SENSe ROSCillator SOURCe SENSe ROSCillator SOURCe AUTO STATus OPERation ENABle STATus OPERation NTRansition STATus OPERation PTRansition STATus QUEStionable EN ABle STATus QUEStionable NTRansition STATus QUEStionable PTRansition SYSTem COMMunicate SERial CONTrol DTR SYSTem COMMunicate SERial TRANsmit BAUD SYSTem COMMunicate SERial TRANsmit PACE SYSTem COMMunicate SERial TRANsmit PARity TY PE HP IB Address Error Queue Key Queue 4 138 Programming Guide Chapter 4 Command Reference Introduction SRE lt NRf gt Service Request Enable Command SRE Service Request Enable Query SRE lt NRf gt SRE lt NRf gt Range lt NRf gt Resolution Query Response Comments Sets or queries the Service Request Enable Register shown in Figure 4 6 The parameter and query respo
10. e Read the section at the end of Chapter 3 titled Programming Examples for Making Common Measurements which provides programming examples e 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 Experienced Programmers If you have programmed other HP IB instruments you will probably be familiar with many of the concepts and techniques discussed in this guide Also you will find that using the SCPI commands is very similar to using the older HP IB commands The main difference is the hierarchy of the subsystem commands However this type of structure has been previously used on other instruments Because the SCPI command set and some of the status reporting techniques are new you may want to use the following sequence to learn the Counter programming requirements e 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 provide in Chapter 3 Programming Your Universal Counter for Remote Operation e Review the summary tables in Chapter 2 Command Summary If this chapter contains sufficient information to get you started write some programs to explore the Counter s capabili
11. e gt INPut3 COUPling INPut3 IMPedance Note in firmware revisions 3317 3335 and 3402 use 0 xk Note in firmware revisions 3317 3335 and 3402 use 100 Figure 2 1 Input Channels Conditioning Keys to SCPI Command Map Part 2 of 2 Programming Guide 2 5 Chapter 2 Command Summary Front Panel to SCPI Command Maps Instrument Control Utility Recall and Save amp Print Keys to SCPI Command Map Figure 2 2 Instrument Control Utility Recall and Save amp Print Keys to SCPI Command Map Part 1 of 2 2 6 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Instrument Control Utility Recall and Save amp Print Keys to SCPI Command Map Cont 1 a IDN No command SENSe ROSCillator SOURce INTernal SENSe ROSCillator SOURce EXTernal SENSe ROSCillator SOURce AUTO ON No command see Calibration menu Figure 2 6 No command No command TST SYSTem COMMunicate SERial T RANsmit BAUD lt numeric_value gt SYSTem COMMunicate SERial T RANsmit PARity T YPE EVEN ODD NONE SYSTem COMMunicate SERial T RANsmit PACE XON NONE SYSTem COMMunicate SERial CONTrol DTR LIMit SYSTem COMMunicate SERial CONTrol DTR IBFull SYSTem COMMunicate SERial CONTrol DTR ON DISPlay W INDow TEXT RADix DPOint DISPlay W INDow TEXT RADix COMMa 2 SAV lt Nrf gt 3 INITiate CONTinuous OFF if running OR ABORT if single measurement in pro
12. SENSe FREQuency Subtree 4 85 SENSe FREQuency ARM Subtree 85 SENSe PHASe Subtree 4 91 SENSe PHASe ARM Subtree 4 91 SENSe ROSCillator Subtree 4 92 SENSe TINTerval Subtree HP 53131A and HP 53132A With S N Prefix Below 3646 4 95 SENSe TINTerval ARM Subtree HP 53131A and HP 53132A With S N Prefix Below 3646 4 95 SENSe TINTerval Subtree HP 53132A With S N Prefix 3646 and Above 4 98 SENSe TINTerval ARM ESTART and ESTOP Subtrees HP 53132A With S N Prefix 3646 and Above 4 98 SENSe TOTalize Subtree 4 104 SENSe TOTalize ARM Subtree 4 104 STATus Subsystem 4 107 STATus OPERation Subtree 4 107 STATus QUEStionable Subtree 4 110 SYSTem Subsystem 4 114 SYSTem COMMunicate Subtree 4 114 TRACe Subsystem 4 119 TRIGger Subsystem 4 121 CAL Calibration Query 4 122 CLS Clear Status Command 4 123 DDT lt arbitrary block gt Define Device Trigger Command 4 124 DMC lt string gt lt arbitrary block gt Define Macro Command 4 125 EMC lt NRf gt Enable Macro Command 4 126 EMC Enable Macro Query 4 126 ESE lt NRf gt Standard Event Status Enable Command 4 127 ESE Standard Event Status Enable Query 4 127 ESR Event Status Register Query 4 128 GMC lt string gt Get Macro Contents Query 4 129 Programming Guide ix Contents IDN Identification Query 4 130 LMC Learn Macro Query 4 131 OPC Operation Complete Command 4 132 OPC Operation Complete Q
13. The response is in the following form lt error_number gt lt error_description gt 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 The queue is cleared emptied on CLS power on or upon reading the last error from queue If the 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 This query clears any displayed error message from the front panel display The Error Queue is unaffected by RST and save recall SYSTem KEY lt numeric_value gt 4 116 Programming Guide lt numeric_value gt Range Query Response Chapter 4 Command Reference Introduction This command simulates the pressing or 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 The length of the Key Queue is 500 The keys and their corresponding key codes are listed in the following table Sr o ooo CO s 1 id Channel 1 DC AC Stop Single Chann
14. st enab Clear event status le register nabl register Preset enable registers and transition filters for operation and questionable status structures l l l Clear service requ l l l l l Call subroutines to make measurements CONF and READ A LINPUT Press RETURN for CONF INIT and FETC AS Measure Use the MEAS TINT 1 2 command and collect data PRINT Time Interval from OUTPUT Count MEAS TINT ENTER Count Tints PRINT PRINT Time Interval 1 to PRINT RETURN Conf_read Use CONF and RI 3 60 The MEAS TINT 1 2 query initiates a complet sequence It configures the counter for a 2 channel time interval measurement starts the measurement and asks for the data T command is the simplest and least flexible measurement Make sure there are signals at both counter inputs way to mak he MEAS 1 to 2 measured using MEAS TINT 1 2 Configure for time interval and query counter for results 2 Tints EAD command Prog a measurement 1 2 ramming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Easiest Way to Make a Measurement HP BASIC Continued The following commands will measure the frequency on channel 1 The MEAS query can be broken down into CONF
15. 220 OUTPUT Count CAL DATA Ask for data 230 ENTER Count USING 4A Head1 240 ENTER Count USING K Cal_data 250 PRINT Calibration data now in array Cal_data 260 You may want to store Cal_data S and Head1 on a disk 270 If at some later point you need to send the calibration data 280 back to the counter you would use the following command 290 OUTPUT Count CAL DATA Head1S amp Cal_data S Send calibration data 300 REPEA 310 l OUTPUT Count SYST ERR 320 ENTER Count Err_num Err_string 330 IF Err_num lt gt 0O THEN 340 PRINT Err_num Err_string 350 END IF 360 UNTIL Err_num 0 370 END 3 68 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Perform a Time Interval Calibration HP BASIC Early versions of the Counter cannot execute this program since they do not INTERVAL calibration requiring a simple calibration signal and calibration the additional steps required ECURE the counter prior to calibration ibration values before recalibrating as a backup ld calibration data ld error message Assign I O path for Counter Assign I O path for Calibrator used only for the FINE calibration NOTE support calibration security or fine time interval calibration 10 This prog
16. 3 72 Programming Guide 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 10 20 30 40 50 60 70 80 90 pBRBHHBHH AH HP A Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Optimize Throughput HP BASIC This program shows provides the least fastest possible rate the counte the arming how to set up Note that resolution of The program comments discuss the all arming meaning of r to transfer data at the mode is AUTO This mode modes each command ASCII result format is to preserve resolution j CLEAR SCREEN INTEGER I DIM AS 200 22 Dummy 22 ASSIGN Count TO 703 CLEAR 703 Clear the counter and interface OUTPUT Count RST Reset the counter OUTPUT Count CLS Clear event registers and error queue OUTPUT Count SRE 0 Clear service request enable register OUTPUT Count ESE 0 Clear event status enable register OUTPUT Count STAT PRES Preset enable register and transition filters for operation and quest
17. 400 Status_byte SPOLL 703 asserted Serial poll counter 410 OUTPUT Count FETCH PERIOD Query the counter 420 ENTER Count Result Read the period 430 PRINT Out of limits measurement is ResultS seconds 440 PRINT Status byte is Status_byte Should be 72 64 8 450 LOCAL 703 Return counter to local 460 END Programming Guide 3 63 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 10 20 30 40 50 60 70 80 490 500 510 This program instructs t The counter is told to s TRIG COUNT AUTO ON Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Measure the Statistics of 50 Measurements HP BASIC The counter is put into SINGLE measurements to take is programmed using CALC3 AVER COUNT 50 top after 50 measurements using 5 At the end of 50 measurements sent to the computer he counter to take 50 period measurements measurement mode The number of the statistics are calculated and ASCII format is used to preserve resolution In this example The OPC the sta command and the tus reporting structure is used to alert tistics are ready RSE 1 command are used together to generate an output from the The output of this register is the m
18. CALL IOTRIGGER source Query the counter for data CALL IOENTERS source fregqstring i 22 actual Read the ASCII characters NEXT i PRINT Measurements complete END SUB sendhp code CALL iooutputs source code LEN codeS END SUB Programming Guide 3 87 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Use Macros QuickBASIC his program is useful for writing macros for the counter are available at the status of the macros ECLARE SUB sendhp code REM SINCLUDE QBSETUP BAS DIM SHARED source AS LONG DIM maxlength AS INTEGER DIM actual AS INTEGER DIM length AS INTEGER maxlength 6400 DIM answer AS STRING DIM namemacro AS STRING DIM commandmacro AS STRING DIM results AS STRING 6400 DIM macros AS STRING source 703 isc amp 7 state 1 CLS CALL IOEOI isc amp states CALL sendhp RST CALL sendhp CLS CALL sendhp SRE 0 CALL sendhp ESE 0 CALL sendhp STAT PRES CALL sendhp INIT CONT OFF KEY 1 Free KEY 2 Enable KEY 3 Display KEY 4 Query KEY 5 Define KEY 6 Deletel KEY 7 Purge KEY 8 Disable KEY 9 Send KEY 10 QUIT FOR i 1 TO 10 KEY i ON NEXT i KEY ON 3 88 he SUB sendhp sends commands to the HP 53131A Softkeys the bo
19. HP 53131A 132A SCPI Subsystem Commands pg 2 24 e RST Response pg 2 40 1The section titled Front Panel to SCPI Command Maps provides maps that show the front panel keys and their corresponding or related SCPI commands 2The section titled HP 53131A 132A Command Summary lists the IEEE 488 2 Common and the SCPI Subsystem commands in tables 2 1 and 2 2 respectively 3The section titled RST Response lists the states of all of the commands that are affected bythe 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 Maps Front Panel to SCPI Command Maps Figures 2 1 through 2 6 provide maps that show the one to one relationship of the front panel keys and the SCPI commands These maps should help with identifying commands if you are already familiar with the front 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 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 is true for all SCPI commands When
20. MEASure 4 51 MEMory 4 79 MEMory DELete MACRo 4 79 MEMory FREE MACRo 4 79 MEMory NSTates 4 79 STATus 4 107 STATus OPERation 4 107 STATus PRESet 4 110 STATus QUEStionable 4 110 SYSTem 4 114 SSYSTem COMMunicate 4 114 SYSTem ERRor 4 116 SYSTem KEY 4 117 SYSTem KEY LOG 4 118 SYSTem VERSion 4 118 TRACe 4 119 TRACe CATalog 4 119 TRACe DATA OFFSET 4 119 TRACe DATA SCALE 4 120 TRIGger 4 121 TRIGger TRIGger COUNt AUTO 4 121 SENSe SENSe DATA 4 80 SENSe EVENt 112 4 80 SENSe EVENt3 4 84 SENSe FREQuency 4 85 SENSe FREQuency EXPected 11213 4 88 SENSe FREQuency EXPected 112I3 AUTO ON 4 88 SENSe FUNCtion ON 4 89 SENSe PHASe 4 91 SENSe ROSCillator 4 92 SENSe TINTerval 4 95 4 98 SENSe TOTalize 4 104 Measurement Instructions 4 52 CONFigure 4 53 4 54 CONFigure 4 54 FETCh 4 55 MEASure query 4 56 READ 4 57 Descriptions of the Measurement Functions lt function gt 4 60 How to Use the Measurement Instruction Commands 4 75 4 11 suffix elements 3 12 multiplers 3 13 Index 6 suffix multipler 3 13 suffixes 3 12 summary bits 3 21 synchronizing measurements 3 46 syntax program messages 3 14 response messages 3 16 T terminator command 3 13 throughput 3 35 time interval 4 73 4 89 4 95 4 98 totalize 4 73 4 74 4 89 4 104 transition filter 3 28 negative 4 112 posi
21. Related Gate amp ExtArm Front Panel Keys SENSe TINTerval ARM STOP SOURce IMMediate TiMer Sets or queries the stop arm that is the delay for Time Interval measurements Query Response A sequence of ASCII encoded bytes IMM or TIM Comments e RST IMMediate e This SENS TINT ARM STOP SOUR command has no affect on the following measurements Risetime Falltime Duty Cycle and Pulse Width Related Gate amp ExtArm Front Panel Keys SENSe TINTerval ARM STOP TIMer lt numeric_value gt S Sets or queries the time used to delay the stop arm for Time Interval measurements lt numeric_value gt e For short gate time 0 1E 3 to 99 99E 3 seconds Range e For long gate time 100E 3 to 10 000 seconds lt numeric value gt e For short gate time 0 01E 3 seconds Resolution e For long gate time 1E 3 seconds For HP 53131A with firmware revisions below 3427 the minimum gate time is 1 ms For HP 53132A with firmware revisions below 3646 the minimum gate time is 1 ms 4 96 Programming Guide Chapter 4 Command Reference Introduction Query Response Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits Comments RST 10E 3 S e Only applies when SENS TINT ARM STOP SOUR TIM is selected e This SENS TINT ARM STOP TIM command has no affect on the following measurements Risetime Falltime Duty Cycle and Pulse Width Related Gate amp ExtArm Front Panel Keys
22. SENSe TINTerval ARM ESTART LAYer2 SLOPe POSitive Query Response Comments Related Front Panel Keys NEGative Sets or queries the slope of the external start arm signal used in external arming time interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measurements A sequence of ASCII encoded bytes POS or NEG e RST POSitive e Only applies when SENS TINT ARM ESTART LAY2 SOUR EXT is selected Gate amp ExtArm SENSe TINTerval ARM ESTART LAYer2 SOURce IMMediate Query Response Comments Related Front Panel Keys EXTernal Sets or queries the start arm for time interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measurements A sequence of ASCII encoded bytes IMM or EXT RST IMMediate Gate amp ExtArm SENSe TINTerval ARM ESTART LAYer 1 ECOunt lt numeric_value gt Range lt numeric_value gt Resolution Query Response Comments lt numeric_value gt Sets or queries the number of events used to delay the start arm for Time Interval measurements 1 to 99 999 999 Numeric data transferred as ASCII bytes in lt NR1 gt format e RST 1 e Only applies when SENS TINT ARM ESTARTT LA Yer 1 SOUR INTernal1 is selected 4 100 Programming Guide Chapter 4 Command Reference Introduction e The SENS TINT ARM EST ART LA Yer 1 ECO command has no affect on the following measurements Risetime F
23. This command causes post processing to occur in the CALCulate2 subsystem as well as the CALCulate subsystem 4 8 Programming Guide Chapter 4 Command Reference Introduction CALCulate 1 IMMediate AUTO lt Boolean gt Query Response Comments Sets or queries whether post processing recalculation will automatically occur whenever any changes are made to the CALCulate 1I2 subsystems With CALC IMM AUTO set to OFF CALCulate 1I2 only produces new results when new SENSe data is acquired or when the CALCulate IMMediate command is received Once CALC IMM AUTO is set to ON the CALCulate 1I2 subsystems produce new results when any CALCulate 1I2 command is processed even when new SENSe data is not being acquired This allows the user to make configuration changes in the CALCulate 11I2 subsystems and immediately have new CALCulate 1I2 results on the same SENSe data e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON e 6 RST OFF e This command affects all of the post processing subsystems settings CALC IMM AUTO e Note that the Counter powers up with CALC IMM AUTO set to ON but RST sets it to OFF gt CALCulate 1 MATH Subtree This subtree collects together the commands related to math scale offset processing See the TRACe subsystem for commands used to set the scale and offset Many of these commands are query only because the Counter has only one fixed
24. lt function gt data Queries the result The lt function gt and corresponding lt parameters gt and lt source list gt are defined by the following listing in this table see next page 2 30 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2 HP 53131A 132A SCPI Command Summary Continued New VOLTage DCYCle or VOLTage PDUTycycle VOLTage FALL TIME or VOLTage FTIMe VOLTage FREQuency VOLTage FREQuency RATio VOLTage MAXimum VOLTage MINimum VOLTage NWIDth VOLTage PERiod VOLTage PHASe VOLTage PTPeak VOLTage PWIDth VOLTage RISE TIME or VOLTage RTIMe VOLTage TINTerval VOLTage TOTalize CONTinuous VOLTage TOTalize TIMed lt reference gt lt reference gt lt lower_reference gt upper_reference gt lt lower_reference gt upper_reference gt lt expected_value gt lt resolution gt lt expected_value gt lt resolution gt lt reference gt lt expected_value gt lt resolution gt lt reference gt lt lower_reference gt upper_reference gt lt lower_reference gt upper_reference gt lt gate_time gt ks 2 3 1 2 1 2 1 1 The only functions which can be derived using FETC or READ from the stored data are period to from frequency maximum to from minimum max
25. 1 Since the primary purpose of these front panel keys is to change the function the corresponding SENSe FUNCtion ON command is listed in the menu map above The front panel keys however invoke couplings which affect other settings whereas the SENSe FUNCtion ON command does not Figure 2 3 MEASURE Keys to SCPI Command Map Part 2 of 2 Programming Guide 2 9 Freq Period Ratio HP 53131A 132A Auto Arming a GATE AUTO Digits Arming b GATE DIGITS C DIGITS lt digits gt Time Arming d GATE TIME e TIME lt time gt External Arming GATE EXTERNL START POS NEG STOP AUTO STOP NEG POS STOP TIME TIME lt time gt Chapter 2 Command Summary Front Panel to SCPI Command Maps Gate amp ExtArm Key to SCPI Command Map HP 53131A 132A Auto Arming a ARM AUTO Totalize HP 53131A 132A Auto Arming a GATE AUTO Rise Time Fall Time Width Dutycycle HP 53131A 132A Auto Arming a ARM AUTO Time Interval HP 53131A and HP 53132As with S N prefix below 3646 See page 2 14 for HP 53132A with S N prefix 3646 and above Auto Arming a ARM b4 DELAY bo DELAY c TIME AUTO NONE TIME lt time gt External Arming b ARM EXTERNL C SLOPE POS NEG Time Arming b GATE TIME Cc TIME lt time gt External Arming GATE EXTERNL START POS NEG TIME NEG POS lt time gt STOP STOP TIM
26. 2 at the end is a Query Only command Std New Column The Std New column in Table 2 2 gives 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 e SCPI approved but are not yet in the SCPI manual e 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 11 in Chapter 3 Programming Your Universal 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 24 Programming Guide CALCulate 1 IMMediate AUTO MATH EXPRession CATalog DEFine NAME SELect STATe CALCulate2 FEED IMMediate AUTO LIMit CLEar AUTO IMMediate DISPlay FAIL Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2 HP 53131A 132A SCPI Command Summary New ABORt ee Event no query Aborts measurement in progress LJSENSe 1 lt Boolean gt SCALE_OFFSET lt Boolean gt CALCulatef1 lt Boolean gt lt Boolean gt GRAPh NUMBer Programming Guide Subsystem Performs post acquisition math processing scale and offset and
27. FALL TIME Cont lt source_list gt range 1 default 1 MEASure SCALar VOLTage FREQuency lt expected_value gt lt resolution gt 1 2 3 Measures Frequency The measurement arming mode is set to digits The Counter uses the lt expected_value gt and lt resolution gt parameters to configure the number of digits of resolution arming setting The Channel 1 or Channel 2 trigger settings are coupled so that the measurement channel has auto trigger enabled at 50 with a positive slope Chi Ch2 lt expected_value gt range 100 Hz to 225 MHz resolution lt expected value gt should be within 10 of input frequency for optimum arming configuration default 10 MHz Ch1 Ch2 lt resolution gt description value indicates decade corresponding to least significant digit of the result range 1E 16 to 1E6 Hz value which indicates 3 to 15 digits of resolution for the specified lt expected value gt resolution lt resolution gt should use a mantissa of 1 0 and be an even power of 10 Programming Guide 4 63 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage FREQuency Cont default Ch3 lt expected_value gt range resolution default Ch3 lt resolution gt description range resolution default lt source_list gt range de
28. Figure 2 4 Gate amp ExtArm Key to SCPI Command Map Part 2 of 6 Programming Guide 2 11 Chapter 2 Command Summary Front Panel to SCPI Command Maps Gate amp ExtArm Key to SCPI Command Map Cont Totalize Auto Arming a SENSe TOTalize ARM STARt SOURce IMMediate SENSe TOTalize ARM STOP SOURCe IMMediate Time Arming by SENSe TOTalize ARM STARt SOURce IMMediate bo SENSe TOTalize ARM STOP SOURce T IMer ce SENSe TOTalize ARM STOP TIMer lt numeric_value gt S External Arming d SENSe TOTalize ARM STARt SOURce EXTernal e SENSe TOTalize ARM STARt SLOPe POSitive NEGative f4 SSENSe TOTalize ARM STOP SOURCce TIMer f2 SENSe TOTalize ARM STOP SOURCce EXTernal SENSe TOTalize ARM STOP SLOPe POSitive NEGative g SENSe TOTalize ARM STOP TIMer lt numeric_valu e gt S Rise Time Fall Time Pulse Width Dutycycle Auto Arming a SENSe TINTerval ARM STARt SOURce IMMediate External Arming b SENSe TINTerval ARM STARt SOURce EXTernal c SENSe TINTerval ARM STARt SLOPe POSitive NEGative Figure 2 4 Gate amp ExtArm Key to SCPI Command Map Part 3 of 6 2 12 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Gate amp ExtArm Key to SCPI Command Map For HP 53131A and HP 53132A With S N Prefix Below 3646 Time Interval HP 53131A and HP 53132A With S N Prefix Below 3646 Auto Arming a SENSe TINTerval ARM
29. Figure 2 5 LIMITS and MATH Keys to SCPI Command Map Part 2 of 2 Programming Guide 2 17 Chapter 2 Command Summary Front Panel to SCPI Command Maps Calibration Menu to SCPI Command Map Figure 2 6 Calibration Menu to SCPI Command Map Part 1 of 2 2 18 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Calibration Menu to SCPI Command Map Cont 1 a CALibration SECurity STATe b DIAGnostic CALibration INPut1 OFFSet AUTO ONCE DIAGnostic CALibration INPut2 OFFSet AUTO ONCE DIAGnostic CALibration INPut1 GAIN AUTO ONCE DIAGnostic CALibration INPut2 GAIN AUTO ONCE DIAGnostic CALibration TINTerval QUICk DIAGnostic CALibration TINTerval FINE 1 2 3 4 DIAGnostic CALibration ROSCillator AUTO ONCE c4 CALibration SECurity CODE lt new_code gt Ae SAE ON lt present_code gt c2 CALibration SECurity STATe OFF lt present_code gt d CALibration COUNt e No command The Calibration Menu is accessed by holding the Scale amp Offset key and cycling POWER key Figure 2 6 Calibration Menu to SCPI Command Map Part 2 of 2 Programming Guide 2 19 Chapter 2 Command Summary HP 53131A 132A Command Summary HP 53131A 132A Command Summary This section summarizes both the IEEE 488 2 Common and HP 53131A 132A Standard Commands for Programmable Instruments SCPI commands in tabular format IEEE 488 2 Common commands are listed first followed by SCPI commands SCPI
30. LINPUT Enter the name of the macro Name IF NameS THEN SUBEXIT OUTPUT 703 GMC amp CHRS 39 amp NameS amp CHRS 39 is defined as follows g Guide Enter the macro name and commands to be sent Send 3 75 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Use Macros HP BASIC Continued 520 SUB Define_macro Define a macro for the counter 530 DIM Name 25 MacroS 200 Send 255 Headers 2 540 CLEAR SCREEN 550 LINPUT Enter the name of the macro Name 560 LINPUT Enter the counter commands Macro 570 Length LEN Macro S 580 Num_char INT LGT Length 1 Determine of characters for header 590 HeaderS amp VALS Num_char 600 SendS DMC amp CHRS 39 amp NameS amp CHRS 39 amp amp HeaderS amp VALS Length amp Macro 610 OUTPUT 703 Send 620 SUBEND 630 SUB Macro_query Ask for the definition of a macro 640 DIM Name 25 Macros 255 650 CLEAR SCREEN 660 CALL Display_macros 670 LINPUT Enter the name of the macro you want to see NameS 680 IF Name THEN SUBEXIT 690 OUTPUT 703 GMC amp CHRS 39 amp NameS amp CHRS 39 700 ENTER 703 Macro 710 PRINT 720 PRINT Macro Name is defined as follows 730 PRINT 740 PRINT MacroS VAL Macro 2 2 3 Display command portion of macro 75
31. STARt SOURce IMMediate b4 SENSe TINTerval ARM STOP SOURCce IMMediate bo SENSe TINTerval ARM STOP SOURce TIMer c SENSe TINTerval ARM STOP TIMer lt numeric_value gt S External Arming d SENSe TINTerval ARM STARt SOURce EXTernal e SENSe TINTerval ARM START SLOPe POSitive NEGative f4 SENSe TINTerval ARM STOP SOURce IMMediate f2 SENSe TINTerval ARM STOP SOURce T IMer g SENSe TINTerval ARM STOP TIMer lt numeric_value gt S Figure 2 4 Gate amp ExtArm Key to SCPI Command Map Part 4 of 6 Programming Guide 2 13 Chapter 2 Command Summary Front Panel to SCPI Command Maps Gate amp ExtArm Key to SCPI Command Map Cont For HP 53132A With S N Prefix 3646 and Above Time Interval HP 53132A With S N Prefix 3646 and Above Auto Arming a START AUTO b4 DELAY NONE bo DELAY TIME bg DELAY EVENT C Tk lt time gt d E lt events gt External Arming e START EXT f SLOPE POS NEG Q4 DELAY NONE g2 DELAY TIME g3 DELAY EVENT h T lt time gt i amp E lt events gt j4 STOP AUTO j2 STOP EXT k SLOPE POS NEG m4 DELAY NONE Mg DELAY TIME m3 DELAY EVENT n Te lt time gt Oo E lt events gt Figure 2 4 Gate amp ExtArm Key to SCPI Command Map Part 5 of 6 2 14 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Gate amp ExtArm Key to SCPI Command Map Cont For HP 53132A With
32. Since this query will not respond until the measurement cycle transitions from measuring to idle the only way to cancel the query holdoff is by Device Clear page 4 31 or power on See the section titled Using the OPC Command page 3 47 in Chapter 3 for an example using this command Single ASCII encoded byte 1 The OPC query does not in any way affect the OPC bit in the Standard Event Status Register Programming Guide 4 133 Chapter 4 Command Reference OPT Option Identification Query OPT Option Identification Query OPT Query Response Comments Queries the instrument to identify any installed options The following options can be installed in the instrument e Option 001 Medium Stability Oven Timebase e Option 010 High Stability Oven Timebase e Option 012 Ultra High Stability Oven Timebase e Option 030 3 0 GHz RF Input Channel Channel 3 e Option 050 5 0 GHz RF Input Channel Channel 3 e A sequence of ASCII encoded bytes indicating lt timebase option gt lt 3 0 GHz RF Input option gt terminated with a new line and EOI The lt timebase option gt is 001 010 or 0 Note that the counter responds with 010 for either the high stability or ultra high stability oven timebase The lt 3 0 GHz RF Input option gt is 030 or 0 Note that the counter responds with 030 for either the 3 0 GHz or 5 0 GHz RF Input option A missing option is identified by an ASCII 0
33. 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 e 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 414400 Programming Guide Chapter 4 Command Reference Introduction TRG Trigger Command TRG This command is the device specific analog of the IEEE 488 1 Group Execute Trigger GET interface message page 4 42 and has exactly the same effect The TRG command will perform the action defined by the DDT command page 4 124 Programming Guide 0 AA Chapter 4 Command Reference TST Self Test Query TST Self Test Query TST Query Response Comments This query causes an internal self test and the response indicates whether any errors were detected Error 330 is generated when the self test fails e Numeric data transferred as ACSII bytes in lt NR1 gt format e A response value of zero indicates the self test has completed without errors detected while a non zero value indicat
34. effect of holding off further commands from being processed until the desired measurement completes This hold off action can only be canceled by the measurement completing Device Clear or power on Programming Guide 4 57 Query Response Comments Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ e Result will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used numeric data is transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range from 1 to 15 depending on the measurement resolution e Refer to the sub section in this section titled Descriptions of Measurement Functions for descriptions of each measurement function e Refer to Table 4 1 for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions e If READ is executed while the Counter is configured to make an automatically armed Totalize measurement Not a Number 9 91E37 is returned and error 221 is generated INITiate and ABORt should be used to begin and terminate the measurement FETCh should be used to retrieve the terminated measurement result 4 58 Programming Guide Chapter 4 Command Reference Introduction Table 4 1 The lt function gt associated lt parameters gt and lt source_list gt for the Measure Instruction Commands lt function gt lt parameters gt lt sour
35. lt numeric_value gt HZ S lt numeric_value gt Range lt numeric_value gt Resolution IDEG Sets or queries the statistics filter lower limit If limit filtering is enabled CALC3 LFIL STAT ON any measurements below this value will not be combined into the statistics computation If math is enabled CALC MATH STATe ON the limit value specified should take into account that the filtering is on measurements that have been scaled and offset 9 9999990000E 12 to 1 0000000000E 13 0 0000000000 1 0000000000E 13 to 9 9999990000E 12 11 digits Programming Guide 4 23 Query Response Comments Chapter 4 Command Reference CALCulate3 Subsystem Numeric data transferred as ASCII bytes in lt NR3 gt format with eleven significant digits RST 0 0000000000 e This command couples CALC2 LIM LOW to the same value e Updating the lower limit value causes the limit counts CALC2 LIM FCO CALC2 LIM PCO to be cleared e The front panel menu item is not always able to display all of the significant digits of this value When this is the case the displayed value is different from the actual value in that the displayed value has been rounded However using the front panel Enter key while this value is in the 11 digit display will update the actual value to the displayed rounded value CALCulate3 LFiLter STATe lt Boolean gt Query Response Comments Related Front Panel Keys Sets or queries the st
36. 2 are not used Bit 3 QSB summarizes the Questionable Data Signal Status Event Register This bit indicates whether or not one or more of the enabled Questionable Data Signal events have occurred since the last reading or clearing of the Questionable Data Signal Status Event Register This bit is set TRUE one when an enabled event in the Questionable Data Signal Status Event Register is set TRUE Conversely this bit is set FALSE zero when no enabled events are set TRUE Bit 4 MAV 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 bytes that is the Output Queue is not empty This bit is set FALSE zero when the Output Queue is empty Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands e 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 e Bit 6 RQS MSS summarizes IEEE 488 1 RQS and Master Summary Status When a serial poll is used to read the Statu
37. 4 89 G GET 4 42 Getting Started 1 6 group execute trigger 4 42 Group Execute Trigger GET 4 42 H How to Use This Guide 1 6 HP 53131A 132A SCPI Subsystem Commands 2 24 HP Basic using 3 58 HP IB configuration 3 4 operating modes 3 4 HP IB operating modes Addressed talk listen 3 4 Talk only 3 4 hysteresis 4 81 HZ 3 12 I IEEE 488 2 summary list 2 22 IEEE 488 2 Common Commands 2 21 TEEE488 1 conformance 3 7 obtaining copy of standard 1 10 TEEE488 2 common commands 2 21 conformance 2 20 2 21 obtaining copy of standard 1 11 syntax 3 8 implied channel 3 10 in limit event status bit 3 30 3 31 initiate 4 44 initiate measurements 4 44 input attenuation 4 48 coupling 4 48 4 50 impedance 4 49 4 50 Programming Guide Index low pass filter 4 48 interpolator automatic calibration 4 32 calibration 4 26 4 33 K key queue 4 117 keyword 3 9 optional 3 9 separator 3 9 L Learning to Program the Counter 1 7 level 4 83 limit fail 4 14 fail count 4 15 graph 4 14 lower 4 16 pass count 4 17 test 4 11 enable 4 17 upper 4 18 limit testing 4 11 list of errors 5 7 literal 3 11 3 18 local 3 6 M macros 3 52 define 3 52 4 125 get contents 4 129 labels 4 131 memory 4 79 purge 4 135 math 4 7 enable 4 10 offest scale 4 7 offset 4 10 scale 4 10 math limit operations 3 49 MAV 3 22 MAXimum 3 12 4 19 maximum value 3 11 mean 4
38. 4 9 CALCulate 1 MATH 4 9 CALCulate2 CALCulate2 FEED 4 11 CALCulate2 IMMediate 4 11 CALCulate2 IMMediate AUTO 4 12 CALCulate2 LIMit 4 12 Programming Guide CALCulate3 4 19 CALCulate3 A VERage 4 19 CALCulate3 DATA 4 22 CALCulate3 FEED 4 23 CALCulate3 LFILter 4 23 CALCulate3 PATH 4 25 CALibration 4 26 CALibration COUNt 4 26 CALibration DATA 4 27 CALibration SECurity 4 28 CALibration ALL 4 26 CONFigure 4 30 DIAGnostic 4 32 DIAGnostic CALibration SINPut 112 GAIN AUTO 4 32 DIAGnostic CALibration SINPut 112 OFFSet AUTO 4 33 DIAGnostic CALibration INTerpolator AUTO 4 33 DIAGnostic CALibration ROSCillator AUTO 4 34 DIAGnostic CALibration STATus 4 34 DIAGnostic CALibration TINTerval FINE 4 35 DIAGnostic CALibration TINTerval QUICKk 4 36 DISPlay 4 37 DISPlay WINDow TEXT FEED 4 38 DISPlay ENABle 4 37 DISPlay MENU STATe 4 37 DISPlay WINDow TEXT RADix 4 39 FETCh 4 40 FORMat 4 41 FORMat DATA 4 41 HCOPy 4 43 INITiate 4 44 INITiate AUTO 4 44 INITiate CONTinuous 4 44 SINITiate IMMediate 4 46 INPut 112 4 48 SINPut 112 ATTenuation 4 48 INPut 112 COUPling 4 48 INPut 112 FILTer LPASs FREQuency 4 49 INPut 112 FILTer LPASs STATe 4 48 SINPut 112 MPedance 4 49 INPut3 4 50 INPut3 COUPling 4 50 Index 5 Index INPut3 IMPedance 4 50
39. A sequence of ASCII encoded bytes IMM EXT or TIM e RST TIMer e When both start and stop arm are set to IMMediate use INIT IMM to begin totalizing and ABORt to terminate No valid totalize result will exist until the auto totalize measurement is terminated Gate amp ExtArm SENSe TOTalize ARM STOP TIMer lt numeric_value gt Range lt numeric_value Resolution Query Response Comments Related Front Panel Keys lt numeric_value gt S Sets or queries the gate time used in arming Totalize measurements e For short gate time 1E 3 to 99 99E 3 seconds e For long gate time 100E 3 to 1000 000 seconds e For short gate time 0 01E 3 seconds e For long gate time 1E 3 seconds Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits e RST 100E 3 S e Only applies when SENS TOT ARM STOP SOUR TIM is selected Gate amp ExtArm 4 106 Programming Guide Chapter 4 Command Reference Introduction 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 2 The Operation Status Register group consists of a condition register two transition registers an even
40. AS 1 Store the cal data ina file PUT 1 1 CALDATA CLOSE 1 The following lines show how to open a file with calibration data and send it back to the counter PRINT PRINT Sending calibration data to counter OPEN CALDATA DAT FOR BINARY AS 1 GET 1 1 CALDATA CLOSE 1 CALL sendhp CAL DATA CALDATA Send the data just read to counter END SUB sendhp code CALL iooutputs source code LEN codeS END SUB Programming Guide 3 85 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Optimize Throughput QuickBASIC This program sets up the counter make 1000 frequency as fast as possible Note that the arming is set to AUTO but at the least resolution the counter can provide quickly This allows measurements to be taken See the program comments for details Requires an HP 82335A B HPIB interface card to a PC F SUB sendhp code REM SINCLUDE QBSETUP BAS DIM SHARED source AS LONG DIM i AS INTEGER DIM samples AS INTEGER samples 1000 DIM freqstring 1000 maxelemS 22 actual 0 source amp 703 isc amp 7 o state 1 CLS 0 CALL IOEOI isc amp state CALL IOCLEAR source amp CALL sendhp RST CALL sendhp CLS CALL sendhp SRE 0 CALL sendhp ESE 0 CALL sendhp
41. 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 11 Chapter 1 Before You Start Related Documentation 1 12 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 e Front Panel to SCPI Command Maps pg 2 3 Some SCPI Syntax Conventions pg 2 3 Input Channels Conditioning Keys to SCPI Command Map pg 2 4 Instrument Control Utility Recall and Save amp Print Keys to SCPI Command Map pg 2 6 MEASURE Keys to SCPI Command Map pg 2 8 Gate amp ExtArm Key to SCPI Command Map pg 2 10 Gate amp ExtArm Key to SCPI Command Map For HP 53131A and HP 53132A With S N Prefix Below 3646 Time Interval Arming Commands pg 2 13 Gate amp ExtArm Key to SCPI Command Map For HP 53132A With S N Prefix 3646 and Above Time Interval Arming Commands pg 2 14 LIMITS and MATH Keys to SCPI Command Map pg 2 16 Calibration Menu to SCPI Command Map pg 2 18 e HP 53131A 132A Command Summary 2 pg 2 20 SCPI Conformance Information pg 2 20 IEEE 488 2 Common Commands pg 2 21
42. Counter for Remote Operation Elements of SCPI Commands Examine the portion of the SENSe subsystem shown below SENSe FREQuency ARM STOP SOURce EXTernal The root level keyword SENSe is an optional keyword To set the Counter s frequency stop arm to external you can use either of the following SENS FREQ ARM STOP SOUR EXT or FREQ ARM STOP SOUR EXT Implied Channel Optional Numeric Keyword Suffix Some commands allow specifying a channel with an optional numeric keyword suffix These commands will show the channel numbers within square brackets The brackets are not part of the command and are not sent to the Counter For example NPut 1I2 COUPling AC DC represents coupling commands for channels 1 and 2 INPut 1 COUPling AC DC INPut2 COUPling AC DC If you do not specify the channel number the implied channel is 1 For example you can send either of the following to configure channel 1 s coupling to AC INPut1 COUPling AC or INPut COUPling AC 3 10 Programming Guide Chapter 3 Programming Your Universal 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 Query Parameter Types TYPE EXPLANATIONS AND EXAMPLES lt numeric value gt lt Boolean gt
43. Counter to Synchronize Measurements How to Program the Counter to Synchronize Measurements Synchronizing Measurement Completion The Counter has three different methods for synchronizing the end of a measurement and computer transfer of data The three methods are 1 Using the WAI command 2 Using the OPC command 3 Using the OPC command to assert SRQ The following discussion shows how to use all three methods Resetting the Counter and Clearing the HP IB Interface Before attempting any programming it is a good idea 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 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 a Device Clear See your computer or interface card documentation for how to issue this command 2 Issue the following commands RST CLS SRE 0 ESE 0 STAT PRES Using the WAI Command This method 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 statistics for these 50 measurements After the INIT command is issued the Counter is instructed to hold off execution of any mor
44. E happen in order graph Set lower limit Set upper limit nable limit tes ummarized in the Status Byte from the Operation that is summarized te Register to 1 MHz to 2 MHz nable statistics nts for stats ting This must to see limit E ef Display limit graph the measurement to complete printf Waiting for measurement to complete n Start making measurements sendhp INIT do IOSTATUS isc c delay 200 while status Measurement CONT ON ondition amp status r is complete 3 94 Check status byte Wait 200 milliseconds if 1 then measurement complete get the data Programming Guide tr mean amp length Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Use Limits to Filter Data Before Measuring Statistics Turbo C Continued Serial poll counter for status ferring and processing data IT CONT OFF C3 AVERAGE TYPE MIN CALC3 DATA r minimum amp length C3 AVERAGE TYPE MAX CALC3 DATA r maximum amp length LC3 AVERAGE TYPE MEAN CALC3 DATA lA Oo EV CALC3 DATA Set counter to Run Get the data from the counter Get the data from the counter Get
45. EVEN2 FEED INP1 to select common mode Time Interval When the sensor function is changed to Rise Time the Channel 1 trigger level is set to 10 the Channel 2 trigger level is set to 90 and auto triggering is enabled When the sensor function is changed to Fall Time the Channel 1 trigger level is set to 90 the Channel 2 trigger level is set to 10 and auto triggering is enabled When the sensor function is changed to Duty Cycle or Pulse Width the Channel 1 trigger level is set to 50 the Channel 2 trigger level is set to 50 and auto triggering is enabled 4 90 Programming Guide Related Front Panel Keys Chapter 4 Command Reference Introduction e When the sensor function is changed resulting in auto trigger being enabled the Counter will wait until a measurement is initiated before performing the first auto trigger and updating the absolute level s e This command has no direct effect on FETCh READ or CONFigure e When the sensor function is Totalize Voltage Minimum Voltage Maximum or Voltage Peak to Peak then INIT IMM always initiates a single measurement Freq amp Ratio Time amp Period and Other Meas SENSe PHASe Subtree This subtree controls the Phase measuring capabilities of the instrument SENSe PHASe ARM Subtree This subtree is used to synchronize the Phase start arm with events STARt SOURce Front Panel Arming Mode EXTernal EXTERNAL SENSe PHASe ARM
46. KEY 1 LABEL Macro Free 1 CAL ON KEY 2 LABEL Enable Macros 1 CAL ON KEY 3 LABEL Display Macros 1 CAL ON KEY 4 LABEL Macro Query 1 CALL ON KEY 5 LABEL Define Macro 1 CALL ON KEY 6 LABEL Delete Macro 1 CALL ON KEY 7 LABEL Send Macro 1 CALL ON KEY 8 LABEL Disable Macros 1 CAI op_h GOTO Loop_h EN SU Send_macros LL Disable_macro Display memory available for macros Macro_free PUT 703 MEM FRE E MACRO U NTER 703 Macro_free ISP Macro memory f OCAL 703 SUB Macro_enable OUTPUT 703 EMC 1 DISP Macros Enabled LOCAL 703 SUBEND SUB Disable_macro OUTPUT 703 EMC 0 DISP Macros Disable SUBEND SUB Display_macros EAR SCREEN IM Macros 6500 UTPUT 703 LMC NTER 703 Macros RINT RINT The following RINT RINT Macros SUBEND SUB Send_macros EAR SCREEN CALL Display_macros uvunryumhouUuaAa DIM Name 25 Macro S 200 Send 255 ree Macro_free Enable macros Default is disabled tw Disable macros ai Display available macros macros are available Send a macro command to the counter A list of macros to choose from is shown on the computer ENTER 703 Macro PRINT PRINT Macro Name PRINT PRINT Macro LINPUT OUTPUT 703 Send SUBEND Programmin
47. MHz Basic Language Model 360 HP 82335A Card Processor Time Interval 1 to 2 Auto Arming Frequency Time Arming 001 Frequency Auto Arming 200 190 195 Programming Guide 3 37 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter for Status Reporting How to Program 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 3 6 are e Operation Status Register Group e Questionable Data Signal Register Group e Standard Event Status Register Group e 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 of the HP IB and thus alert the computer that the Counter needs attention The following examples show how each of the register groups can be used Figure 3 10 is a flowchart diagram of how to program the Counter for Status Reporting Resetting the Counter and Clearing the HP IB 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 Cons
48. Measuring Stats e To Read and Store Calibration Data e To To Perform a Time Interval Calibration e To Optimize Throughput e To Use Macros Where to Find QuickBASIC Programming Examples e To Make a Frequency Measurement e To Perform Limit Testing e To Measure the Statistics of 50 Measurements e To Use Limits to Filter Data Before Measuring Stats e To Read and Store Calibration Data e To Optimize Throughput e To Use Macros pg 3 88 Where to Find Turbo C Programming Examples e To Make a Frequency Measurement e To Use Limits to Filter Data Before Measuring Stats e To Optimize Throughput Programming Guide Ps pg Pg Ps Pg p8 Pg p8 Ps p8 Ps Pg p8 pg ps p8 Pg Ps Ps p8 pg p8 3 11 3 13 3 14 3 16 3 59 3 62 3 63 3 64 3 66 3 68 3 69 3 73 3 75 3 77 3 78 3 80 3 82 3 85 3 86 3 91 3 93 3 96 3 3 Chapter 3 Programming Your Universal Counter for Remote Operation Configuring the HP IB Configuring the HP IB This section gives information on connecting and configuring the HP IB to enable remote operation of the Counter The Counter has two HP IB operating modes e Addressed talk listen This mode is for bi directional communication The Counter can receive commands and setups from the computer and can send data and measurement results To select the talk listen operating mode set the Counter s HP IB address from 0 to 30 Refer to the following section titled
49. Nember of dg karpin Acurmnal dnin Temmm br a F208 lt 8 bytes of data anew line BO we be maas miad 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 EOI lt new line gt is defined as a single ASCll encoded byte corresponding to 10 decimal 3 18 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Status Reporting The HP 53131A 132A status registers conform to the SCPI and IEEE 488 2 standards Figure 3 6 shows all the status system register groups and queues in the Counter This is a high level drawing that does not show all the registers that are contained in each group It is intended as a guide to the bits used in each of these register groups to monitor the Counter s status Note that besides the Operation Status and the Questionable Data Signal Register groups a summary of the Standard Status Structure Registers defined by IEEE 488 2 1987 is shown Refer to the section in this chapter titled How to Program the Counter for Status Reporting and the flowchart in Figure 3 10 for detailed information on programming the status reporting system Programming Guide 3 19 Chapter 3 Programming Your Universal Counter for Remote Operation Status Reporting gT usstorable Oa biSignal SB bus Rogar Group y NO T
50. Operation Status register that is summarized in the Status Byte Register CALL sendhp FREQ ARM STAR SOUR IMM CALL sendhp FREQ ARM STOP SOUR TIM CALL sendhp FREQ ARM STOP TIM 01 CALL sendhp STAT OPER ENABLE 256 CALL sendhp STAT OPER NTR 256 CALL sendhp STAT OPER PTR 0 enable the CALL sendhp SRE 128 This is it goes CALL sendhp CALC3 LFIL STATE ON CALL sendhp CALC3 LFIL LOWER STRS lower CALL sendhp CALC3 LFIL UPPER STRS upper CALL sendhp CALC3 AVER ON CALL sendhp CALC3 AVER COUNT STRS nummeas CALL sendhp CALC2 LIM STATE ON CALL sendhp CALC2 LIM LOWER STRS lower CALL sendhp CALC2 LIM UPPER STRS upper CALL sendhp CALC2 LIM DISP GRAPH ON PEN GOSUB getstats PEN ON CALL IOPEN isc amp priorityS PRINT Making Period measurements CALL sendhp INIT CONT ON Loophere IF complete THEN GOTO Loophere getstats complete 1 CALL IOSPOLL source amp CAL GOTO endprogram statusbyte sendhp INIT CONT OFF Programming Guide When SRQ will be asserted high Enable statistics filter Set lower stats limit Set upper stats limit Enable statistics Set number of measurements to use in statistics calculation Enable limit testing Must do this to s
51. Programming Guide 4 97 Chapter 4 Command Reference SENSe Subsystem SENSe TINTerval Subtree HP 53132A With S N Prefix 3646 and Above This subtree controls the time interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measuring capabilities of the instrument Refer to page 4 95 for Time Interval arming capabilities of the HP 53131A and the HP 53132A with a serial number prefix below 3646 SENSe TINTerval ARM ESTART and ESTOP Subtrees HP 53132A With S N Prefix 3646 and Above These subtrees are used to synchronize the time interval start and stop arm with events The following table defines the valid combinations of start stop arming for Time Interval only HP recommends that SCPI programs issue arming commands in the order shown in the following table that is from left to right beginning with setting up ESTART and concluding by setting up ESTOP arming 4 98 Programming Guide Chapter 4 Command Reference Introduction Front Panel Arming Settings ESTART LAY2 ESTART LAY1 ESTOP LAY2 ESTOP LAY1 START DELAY STOP DELAY SOURce SOURce SOURce SOURce IMMediate IMMediate IMMediate IMMediate AUTO AUTO NONE E C wo om The following table is for Risetime Falltime Duty Cycle and Pulse Width Front Panel Arming Setting ESTART LAY2 SOURce ARM IMMediate AUTO EXTernal EXTERNAL Programming Guide 4 99 Chapter 4 Command Reference SENSe Subsystem
52. Reference Introduction CALCulate 1 Subsystem Performs post acquisition math scale offset processing on the data acquired by a SENSe function and data transfer of the scaled offset result See the TRACe subsystem for commands used to set the scale and offset Not until CALCulate 1 MATH STATe is set to ON will any of the CALCulate 1 settings or TRACe DATA settings be used CALCulate 1 DATA Query Response Comments Queries the current scaled and offset measurement result e Result will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used numeric data is transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range from 1 to 15 depending on the measurement resolution Only significant digits will be returned e Tfno valid result exists Not a Number 9 91E37 is returned and error 230 is generated e If the current measurement is Totalize or Voltage Peaks Not a Number 9 91E37 is returned and error 221 is generated e Query only e If this command is issued when math is enabled and while a measurement is in progress no response will be produced until the measurement completes e This command holds off subsequent commands from being processed until a measurement completes This holdoff action can only be canceled by the measurement completing a device clear or power cycle e The last calculated result remains valid until a new comp
53. S N Prefix 3646 and Above Time Interval HP 53131A and HP 53132A With S N Prefix Below 3646 Auto Arming a SENSe TINTerval ARM ESTART LAYer2 SOURce IMMediate SENSe TINTerval ARM ESTOP LAYer2 SOURce IMMediate by SENSe TINTerval ARM ESTOP LAYer 1 SOURce IMMediate bo SENSe TINTerval ARM ESTOP LAYer 1 SOURce TIMer b3 SENSe TINTerval ARM ESTOP LAYer 1 SOURce INTernal2 c SENSe TINTerval ARM ESTOP LAYer 1 TIMer lt numeric_value gt S d SENSe TINTerval ARM ESTOP LAYer 1 ECOunt lt numeric_value gt External Arming e SENSe TINTerval ARM ESTART LAYer2 SOURce EXTernal f SENSe TINTerval ARM ESTART LAYer2 SLOPe POSitive NEGative g4 SENSe TINTerval ARM ESTART LA Yer 1 SOURce IMMediate Qo SENSe TINTerval ARM ESTART LAYer 1 SOURce TIMer g3 SENSe TINTerval ARM ESTART LAYer 1 SOURce INTernal 1 h SENSe TINTerval ARM ESTART LAYer 1 TIMer lt numeric_value gt S i SENSe TINTerval ARM ESTART LAYer 1 ECOunt lt numeric_value gt j4 SENSe TINTerval ARM EST OP LAYer2 SOURce IMMediate jo SENSe TINTerval ARM EST OP LAYer2 SOURce EXTernal k SENSe TINTerval ARM EST OP LAYer2 SLOPe POSitive NEGative m4 SENSe TINTerval ARM ESTOP LAYer 1 SOURce IMMediate m SENSe TINTerval ARM ESTOP LAYer 1 SOURce TIMer m3 SENSe TINTerval ARM ESTOP LAYer 1 SOURCe INTernal2 n SENSe TINTerval ARM ESTOP LAYer 1 TIMer lt numeric_value gt
54. SCPI Commands To Read and Store Calibration Data QuickB ASIC Before calibrating the counter it is a good idea to read and store the current calibration values in case something goes wrong with the calibration This program reads the cal values and stores them in a file on the computer hard drive It then reads the data from the file and sends it back to the counter he SUB sendhp sends commands to the counter DECLARE SUB sendhp code REM SINCLUDE QBSETUP BAS Required by HP 82335A DIM SHARED source AS LONG Address and select code DIM CALDATA AS STRING 61 Strings to be read source amp 703 Counter at address 3 isc amp 7 Select code 7 state 1 CLS 0 CALL IOEOI isc amp state Make sure EOI enabled CALL IOCLEAR source amp Clear the counter and interface CALL sendhp RST Reset HP counter CALL sendhp 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 Preset enable registers and transition filters for operation and questionable status structures PRINT Reading Calibration Data CALL sendhp CAL DATA CALL ioenters source amp CALDATA 61 actf Read the ASCII characters OPEN CALDATA DAT FOR BINARY
55. STAT PRES The following commands will provid AS STRING 23 The data is sent in ASCII format to preserve resolution The SUB sendhp sends commands to the counter Required by HP 82335A Address and select code i is used for loops Number of measurements String to be read Reading ASCII formatted data gives results to the correct resolution Must be read into a string Also provides the fastest data transfer Maximum number of characters expected Returns actual characters received Counter at address 3 Select code 7 Used in IOEOI Make sure EOI enabled Clear the counter and interface Reset counter Clear event registers and error queue Clear service request enable register Clear event status enable register Preset enable registers and transition filters for operation and questionable status structures the fastest measurement throughput independent of the state of the counter prior to these commands CALL sendhp FORMAT ASCII CALL sendhp FUNC CHRS 34 The function must be a quoted string counter is FREQ 1 3 86 FREQ 1 CHRS 34 ASCII give fastest throughput Measure frequency The actual string sent to the Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Optimize Throughput QuickBASIC Continued
56. a condition Therefore the transition filters have no effect on this bit The Counter does not monitor the condition indicating whether the last measurement was in or out of limit Hence the In Limit Event bit does NOT represent the transition from an out of limit measurement to in limit measurement Bits 11 15 are not used Questionable Data Signal Status Register Group The Questionable Data Signal Status Register Group monitors SCPI defined conditions Table 3 8 lists the Questionable Data Signal Status Register bits and briefly describes each bit Table 3 8 Questionable Data Signal Status Register 3 32 WEIGHT DESCRIPTION Time Time Interval Rise Time Fall Time Pulse Width Duty Cycle and Period z 5 Not used since some controllers may have difficulty reading a 16 bit unsigned integer The value of this bit shall always be 0 weer i Ea 2 are ca i ae ee Lad re Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands A detailed description of each bit in the Questionable Data Signal Status Register Group follows Bits 0 1 are not used Bit 2 Time is a condition bit which indicates that the Time measurements Period Time Interval Rise Fall Time Pulse Width and Duty Cycle may be affected by the disabling of automatic interpolator calibration The condition bit is TRUE when automatic interpolator calibration i
57. amp Lower 4 16 Programming Guide Chapter 4 Command Reference Introduction CALCulate2 LIMit PCOunt TOTal Queries the total Pass COunt that is the number of measurements that passed the limit test Query Response Comments Query Response Comments Related Front Panel Keys Numerical data transferred as ASCII bytes in lt NR1 gt format If CALC2 LIM STATe is OFF 0 is returned and error 221 is generated If no valid result exists 0 is returned and error 230 is generated If the current measurement is Totalize or Voltage Peaks 0 is returned and error 221 is generated Query only CALCulate2 LIMit STATe lt Boolean gt Sets or queries the limit test enable Single ASCII encoded byte 0 or 1 A value of 0 indicates OFF a value of 1 indicates ON RST OFF When CALC2 LIM STAT OFF is sent it causes the Counter to Invalidate the limit data and clear the information in gt CALC2 LIM FAIL CALC2 LIM FCOunt and gt CALC2 LIM PCOunt Turn off the front panel display s Limit annunciator Set the Limit Detect output to the in limit voltage level Limit Modes Programming Guide 4 17 Chapter 4 Command Reference CALCulate2 Subsystem CALCulate2 LIMit UPPer DATA lt numeric_value gt lt numeric_value gt Range lt numeric_value gt Resolution Query Response Comments Related Front Panel Keys HZ S DEG Sets or queries the upper limit used for limit t
58. and the parameter in a Common Command 3 8 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands oeth peeh NOTE sp space ASCII character decimal 32 Figure 3 3 Simplified Common Command Syntax Diagram Abbreviated Commands The command syntax shows most keywords as a mixture of upper and lower case letters Upper case letters indicate the abbreviated spelling for the command For better program readability you may send the entire keyword The HP 53131A 132A accepts either command form and is not case sensitive For example if the command syntax shows CALCulate then CALC and CALCULATE are both acceptable forms Other forms of CALCulate such as CALCU or CALCULA will generate an error You may use upper and or lower case letters Therefore CALCULATE calculate and CaLcUIAtE are all acceptable Keyword Separator A colon always separates one keyword from the next lower level keyword as shown below INPut COUPling 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 Programming Guide 3 9 Chapter 3 Programming Your Universal
59. 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 Programming Guide 3 17 Chapter 3 Programming Your Universal Counter for Remote Operation Overview of Response Message Formats Table 3 3 Response Message Data Types Continued 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 lt string gt lt definite length block gt ASCll encoded bytes corresponding to the short form of the literal used as the command parameter For example if the CALC3 AVER TYPE MAXimum command is sent to the Counter the CALC3 AVER TYPE response would be MAX A string response 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 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 might be
60. cycle is initiated The pending operation condition is set FALSE when the measurement cycle terminates If the TRIGger COUNt AUTO is ON and statistics are enabled and the function is set to Totalize or Voltage Peaks then the pending operation condition is set TRUE when a block of measurements is initiated The pending operation condition is set FALSE when the block of measurements completes that is when the last measurement in the block completes 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 Errors 400 through 499 are query errors Programming Guide 3 25 Chapter 3 Programming Your Universal Counter for Remote Operation Status Reporting e Bit 3 Device Specific Error is an event bit which indicates an operation did not properly complete due to some condition of the Counter Errors 300 through 399 and all those with positive error numbers 2000 through are device specific errors e 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 e Bit 5 Command Error is an event bit which indicates one of the following has occurred 1 an IEEE 48
61. description Chi Chi range for Ch2 Ch3 Ch2 Ch3_ range for Chi Chi Programming Guide 1 00E 10 to 1 00E11 1 00E 11 to 1 00E10 lt expected_value gt should be within 10 of ratio for optimum arming configuration 1 value indicates decade corresponding to least significant digit of the result 1E 25 to 1E8 value which indicates 3 to 15 digits of resolution for the specified lt expected gt 1E 26 to 1E7 value which indicates 3 to 15 digits of resolution for the specified lt expected gt 4 65 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage FREQuency RATio Cont resolution lt resolution gt should use a mantissa of 1 0 and be an even power of 10 default value which indicates 4 digits of resolution for the specified lt expected_value gt lt source_list gt range 1 2 1 3 2 1 3 1 default 1 2 MEASure SCALar VOLTage MAXimum 1 2 Measures Voltage Maximum lt source_list gt range 1 1 2 default 1 MEASure SCALar VOLTage MINimum 1 2 Measures Voltage Minimum lt source_list gt range 1 1 2 default 1 4 66 Programming Guide Chapter 4 Command Reference Introduction Descriptions of the Measurement Functions lt function gt Cont MEASu
62. event command causes the instrument to initiate either a single measurement or a block of measurements When TRIG COUN AUTO is OFF or gt CALC3 AVER STAT is OFF or SENS FUNC ON is Totalize function or SENS FUNC ON is any Voltage Peaks function then INIT IMM initiates a single measurement When TRIG COUN AUTO is ON and gt CALC3 AVER STAT is ON and SENS FUNC ON is not Totalize or Voltage Peak function then INIT IMM initiates a complete block of measurements See TRIG COUN AUTO for specifics 4460 Programming Guide Comments Related Front Panel Keys Chapter 4 Command Reference Introduction e When TRIG COUN AUTO is ON and CAL3 AVER STAT is ON the Counter clears the statistics results and the statistics current count on SINIT IMM e Ifthe instrument is already in the process of making a measurement or if INITiate CONTinuous is set to ON an MMediate command has no affect and an error 213 Init ignored is generated e When CALC2 LIM CLE AUTO is ON the Counter performs the following whenever the NIT IMM command is sent invalidates the limit data clears CALC2 LIM FAIL CALC2 LIM FCOunt and gt CALC2 LIM PCOunt information turns off the front panel display s Limit annunciator and sets the Limit Detect output to the in limit voltage level e This command is an overlapped command see IEEE 488 2 Section 12 Beginning a measurement or b
63. h gt include CHPIB H ies include CFUNC H x void sendhp char E global data long ctr int erro low of bit 8 in the Operation Status register used for printf used for delay HP IB library constant declarations HP IB library function prototypes function to send command to counter 7033 Counter is at address 03 HP IB is at select code 7 r void main long isc 7 int condition 1 int s int s char char char char int 1 Cleese tatus tate 1 mean 23 minimum maximum sdev 23 ength 23 r 23 23 IORESE isc sendh sendh sendh sendh sendh p RST XSRE 0 ESE 0 p p p iT p CLS 3 3 1 1 jy Tis LA STAT PRES Select code 7 Used in IOSTATUS Used in IOSTATUS Used in IOEOI mean variable minimum variable maximum variable standard deviation variable Used in IOENTERS Clear the computer CRT Clear the HP IB interface Reset the counter Clear event registers and error queue Clear service request enable register Clear event status enable register Preset enable registers and transition filters for operation and questionable status structures Programming Guide 3 93 Chapter
64. 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 New Users What You Should Understand As a new user you should understand that you must have some understanding of a high level language such as Pascal BASIC C or FORTRAN before you can use the command set defined in this guide to control the Counter In Chapter 3 Programming Your Universal Counter for Remote Operation there are programming examples provided in HP BASIC Microsoft QuickBASIC and Borland Turbo C However whatever language you use command strings that control the Counter remain the same 1 6 Programming Guide Chapter 1 Before You Start Programming Guide Contents Learning to Program the Counter To learn how to program the Counter perform the following e Scan the summary tables in Chapter 2 Command Summary to get a feeling for the number and structure of commands available to you e Read and study map drawings in the section titled Front Panel to SCPI Command Maps in Chapter 2 e Read Chapter 3 Programming Your Universal Counter for Remote Operation for an overview of the SCPI concepts as they relate to the HP 53131A 132A Universal Counter Look at the flowcharts which illustrate some of the decisions you must make when programming the Counter
65. length fetch the data length strlen freq Get length of result so freq length 1 0 the linefeed can be removed r printf Frequency d s Hz n i freq printf Press a key to continue n getch Function to send command to HP 53131A void sendhp hpib_cmd char hpib_cmd char hpcemd 80 Variables used by function int length strcpy hecmd hpib_cmd length strlen hpcmd error IOOUTPUTS ctr hpemd length Send command to HP 53131A if error 0 printf Error during HP IB d Command s n error hpcmd 3 92 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Use Limits to Filter Data Before Measuring Statistics Turbo C This program instructs the counter to determine the statistics of high filters 50 Period measurements that are within programmed test limit values Periods that are outside of the limits are not included in the statistics The Limit graph is displayed so you can s if measurements are in limit To alert the program that the statistics are ready bit 8 in the Operation Status Register is used When statistics are being calculated this bit is when they are complete this bit goes low By using the transition an SRQ can be generated when statistics are complete the transition from high to include lt stdio h gt TE include lt dos
66. lt arbitrary block gt Sets or queries the command that the device will execute when it receives the IEEE 488 1 Group Execute Trigger GET interface message page 4 42 or a TRG common command Query Response Comments There are only three valid commands that the Counter will accept INITiate IMMediate READ or FETCh otherwise error 224 is generated If a zero length lt arbitrary block gt is specified as the parameter the Counter will do nothing when it receives a GET or TRG command Definite length block The query response will be one of the following 14INIT 15FETC 15READ 0 terminated with a new line and EOL RST 14INIT When defining the device trigger to FETCh or READ note that these definitions do not allow the specification of a particular function This lack of a function specification results in each DDT using the function specified used by the last CONFigure FETCh READ or MEASure command if possible 442400 Programming Guide Chapter 4 Command Reference Introduction DMC lt string gt lt arbitrary block gt Define Macro Command DMC lt string gt lt arbitrary block gt Comments This command assigns a sequence of zero or more commands queries to a macro label The sequence is executed when the label is received as a command or query The lt string gt parameter specifies the macro label The macro label may not be a common command query header It may be
67. 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 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 Only positive integers are used for NRf parameters in the Counter 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 program 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 subsystem commands The syntax is a pound sign followed by a non
68. math operation CALCulate 1 MATH EXPRession CATalog Query Response Comments Queries defined equation name The string SCALE_OFFSET is returned Query only Programming Guide 4 9 Chapter 4 Command Reference CALCulate 1 Subsystem CALCulate 1 MATH EXPRession DEFine Queries equation used for math operation Query Response A sequence of ASCII encoded bytes SENS SCALE OFFSET terminated with a new line and EOI Comments Query only e This query should be the last query in a terminated program message otherwise error 440 is generated CALCulate 1 MATH EXPRession NAME SCALE OFFSET or CALCulate 1 MATH EXPRession SELect SCALE_OFFSET Sets or queries the name of the expression selected for math processing Query Response A sequence of ASCII encoded bytes SCALE_OFFSET Comments RST SCALE_OFFSET CALCulate 1 MATH STATe lt Boolean gt Sets or queries the math enable This enable specifies whether or not measurement SENSe data will be scaled and offset Query Response e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of indicates ON Comments e RST OFF e Updating the math enable causes the limit counts CALC2 LIM FCO CALC2 LIM PCO to be cleared Related Scale amp Offset Front Panel Keys 4 10 Programming Guide NOTE Chapter 4 Command Reference Introduction CALCulate2 Subsystem This subsystem performs post acq
69. parameter and query response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the negative transition filter The value of unused bits is zero when queried and 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 The range of the lt non decimal numeric gt or lt NRf gt parameter is 0 to 65 535 Numeric data transferred as ASCII bytes in lt NR1 gt format e At power on and STAT PRES the negative transition filter is preset such that each bit is a 0 FALSE e This value is unaffected by RST and save recall STATus OPERation PTRansition Range Query Response lt non decimal numeric gt lt NRf gt Sets or queries the positive transition filter for the Operation status reporting structure The parameter and query response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the positive transition filter The value of unused bits is zero when queried and 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 The
70. parameters gt and lt source_list gt for each of the measurement functions Programming Guide 4 53 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ e This command disables math statistics and limit testing e Ifan absolute trigger level is not specified in the lt parameters gt then when this command executes for functions other than Voltage Peaks maximum minimum peak to peak or Totalize auto trigger is enabled auto trigger level s are set auto trigger is invoked on measurement channel s CONFigure Query Response Comments Queries the function configured by the last CONFigure or MEASure query If the instrument state has changed through commands other than CONFigure or MEASure query the instrument will not track these changes and the query response will not reflect these changes e 6A string of the form lt function gt lt parameters gt lt source_list gt omitting the leading colon from the lt function gt e The Rise Time Fall Time and Duty Cycle functions each have two ways of being specified This query response will use RTIM FTIM or DCYC to indicate these functions e The response is unaffected by RST recall and SENS FUNC e At power on this query generates an error and returns an empty string e Refer to the sub section in this section titled Descriptions of Measurement Functions for descriptions of each meas
71. range of the lt non decimal numeric gt or lt NRf gt parameters is 0 to 65 535 Numeric data transferred as ASCII bytes in lt NR1 gt format Programming Guide 4 109 Chapter 4 Command Reference STATus Subsystem Comments e At power on and STAT PRES the positive transition filter is preset such that each bit is a 1 TRUE e This value is unaffected by RST and save recall 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 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 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 section titled Operation Status Register Group and Questionable Data Signal Status Register Group on page 3 32 in Chapter 3 for a detailed description of the Questionable Data Signal Status Register Group Caitreton Emer Net Lebed Cut of Limit Evart Not Leed Figure 4 3 The Questionable Data S
72. sent to the counter as PERDE OUTPUT Count FREQ ARM STAR SOUR IMM These thr lines enabl OUTPUT Count FREQ ARM STOP SOUR TIM time arming with a 0 01 OUTPUT Count FREQ ARM STOP TIM 01 second gate time OUTPUT Count DISP TEXT FEED CALC3 Display statistics OUTPUT Count CALC3 AVER TYPE SDEV Display the standard deviation OUTPUT Count CALC3 AVER ON Enable statistics OUTPUT Count CALC3 AVER COUNT Num_meas Do statistics on num_meas measurements OUTPUT Count TRIG COUNT AUTO ON Take Num_meas measurements OUTPUT Count ESE 1 ESE 1 is used so bit 5 of the service request register will allow OUTPUT Count SRE 32 an SRQ when measurement complete ON INTR 7 GOTO Get_averages Goto Get_averages on interrupt ENABLE INTR 7 2 Enable interrupt on counter SRQ PRINT Waiting for measurement to complete 3 64 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Measure the Statistics of 50 Measurements HP BASIC Continued 520 OUTPUT Count INIT OPC Enable OPC bit and starts measurement 530 Loop_here GOTO Loop_here Wait here until measurement complete 540 550 Get_averages Data ready 560 Serial_poll SPOLL 703 570 OUTPUT Count CALC3 AVERAGE TYPE MAX CALC3 DATA 580 ENTER Count Maximum 590 OUTPUT Count CALC3 AVERAGE TYPE MIN CAL
73. subsystem to the SENSe EVENt2 subsystem corresponds to common The string INP or INP2 is returned e RST INPut2 e Only the Time Interval function allows either the separate or common setting All of the other functions have a fixed input route setting Trigger Sensitivity SENSe EVENt 1 2 HYSTeresis RELative lt numeric_value gt PCT The operation of this command is determined in part by the firmware revision of the Counter Current Firmware Revision Sets or queries the size of the hysteresis window as a percentage of the allowable hysteresis For example 0 is the minimum hysteresis setting and 100 is the maximum hysteresis setting Specifying 100 or MAXimum provides the greatest noise immunity lowest sensitivity while specifying 0 or MINimum provides the least noise immunity most sensitive Prior Firmware Revisions 3317 3335 and 3402 Sets or queries the sensitivity of the input channel as a percentage of the allowable sensitivity For example 0 is the minimum sensitivity setting and 100 is the maximum sensitivity setting Specifying 100 or MAXimum provides the most sensitivity least noise immunity while specifying 0 or MINimum provides the lowest sensitivity greatest noise immunity Programming Guide 4 81 lt numeric_value gt Range Query Response Comments Related Front Panel Keys Chapter 4 Command Reference SENSe Subsystem 0 50 or 100 PCT Nu
74. the Questionable Data Event Status Enable lt NRf gt Register EVENt Query only Queries the Questionable Data Event Status Register NTRansition lt non decimal numeric gt Sets the positive transition filter for the lt NRf gt Questionable Data status reporting structure PTRansition lt non decimal numeric gt Sets the negative transition filter for the lt NRf gt Questionable Data status reporting structure 2 36 Programming Guide SYSTem COMMunicate SERial CONTrol DTR TRANsmit BAUD PACE PARity TYPE ERRor VERSion TRACe CATalog DATA DATA DATA DATA TRIGger COUNt AUTO Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2 HP 53131A 132A SCPI Command Summary Continued New IBFull ON LIMit lt numeric_value gt XON NONE EVEN ODD NONE lt numeric_value gt OFFSET lt numeric_value gt HZ S DEG SCALE lt numeric_value gt OFFSET SCALE lt Boolean gt Programming Guide Subsystem Collects the functions that are not related to instrument performance Subtree Collects together configuration of control communication interfaces Subtree Controls the physical configuration of the RS 232C port Subtree Sets the usage of the DTR line of the RS 232 port Subtree Affects parameters associated with transmission Sets the baud rate Sets the software pacing scheme Subtree Controls the p
75. the same as an instrument specific command query header in this case provided macros are enabled the macro expansion is executed and the instrument specific command query may be executed by disabling macros The lt arbitrary block gt contains the sequence of commands queries being labeled Parameters may be passed to the sequence during execution Placeholders for parameters appear in the sequence as a dollar sign followed by a single digit in the range one to nine inclusive The first parameter following the macro label is substituted for the parameter placeholder labeled 1 and so on up to nine parameters See the section titled How to Program the Counter to Define Macros in Chapter 3 of this guide e The maximum macro label length is 12 characters e Redefining an existing macro causes an execution error e The Counter allows up to four levels of recursion e There is no query form Use GMC see page 4 129 to query the current definition of a macro label Programming Guide 4 125 Chapter 4 Command Reference EMC lt NRf gt Enable Macro Command EMC lt NRf gt Enable Macro Command EMC Enable Macro Query EMC lt NRf gt EMC lt NRf gt Range lt NRf gt Resolution Query Response Comments Sets or queries the Enable for defined macros Macro definitions are not affected by this command One use of this command is to turn off macro expansion in order to execute an instrument specific c
76. you change the limits or scale offset values The section in this chapter titled How to Program the Counter to Display Results uses the CALC IMM technique to make sure the results are properly displayed Using the Scale and Offset Over HP IB Using the scale and offset values over the bus is different from setting any other value The commands for setting the scale and offset are in the TRACE subsystem For example if you make a frequency measurement and want to set the scale to 5 0 and the offset to 100 Hz send the following commands TRACE SCALE 5 Set scale value 7TRACE OFFSET 100 Set offset value The above commands just set the values To enable them Math must be turned on and the results processed as described in the previous section gt CALC1 MATH STATE ON Enable math CALC IMM Process results using scale and offset If you then wanted the to have the Counter s display show the processed results the following commands must be issued DISP MENU OFF Clear any menu items that may be on display DISP TEXT FEED CALC2 Show the non statistical result CALC2 LIM DISP NUMBER Use the numeric display mode 3 50 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands If you need to query the scale and offset values you need to know if you are in ASCII or REAL data format The values returned from the following query will be sent using the form
77. 0 050 is installed 4 50 Programming Guide Chapter 4 Command Reference Introduction MEASure Subsystem Refer to the Measurement Instructions section on page 4 52 in this chapter for a description of MEASure Programming Guide 4 51 MEASure query CONFigure READ CONFigure INITiate FETCh Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ 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 with fine control of the measurement process The MEASure query provides a complete capability where the instrument is configured a measurement is taken and the results are stored in the Output Queue in one operation When more precise control of the measurement is required the CONFigure and READ commands can be used CONFigure performs the configuration portion of the measurement READ performs the data acquisition and post processing if any and then it places the results in the Output Queue This allows generic configuration of the instrument using CONFigure and then customization of the measurement with other commands for example from the SENSe subsystem READ completes the measurement process The READ command in turn is composed of the INITiate IMMediate and FETCh comma
78. 0 Measurements QuickBASIC 3 80 To Use Limits to Filter Data Before Measuring Stats QuickBASIC 3 82 To Read and Store Calibration Data QuickBASIC 3 85 To Optimize Throughput QuickBASIC 3 86 To Use Macros QuickBASIC 3 88 To Make a Frequency Measurement Turbo C 3 91 To Use Limits to Filter Data Before Measuring Statistics Turbo C 3 93 To Optimize Throughput Turbo C 3 96 Programming Guide vii Contents 4 Command Reference viii Introduction 4 2 ABORt Command 4 4 CALCulate Subsystems 4 5 CALCulate 1 Subsystem 4 7 CALCulate 1 MATH Subtree 4 9 CALCulate2 Subsystem 4 11 CALCulate2 LIMit Subtree 4 12 CALCulate3 Subsystem 4 19 CALCulate3 AVERage Subtree 4 19 CALCulate3 LFILter Subtree 4 23 CALibration Subsystem 4 26 CALibration SECurity Subtree 4 28 CONFigure Subsystem 4 30 Device Clear 4 31 DIAGnostic Subsystem 4 32 DISPlay Subsystem 4 37 FETCh Subsystem 4 40 FORMat Subsystem 4 41 Group Execute Trigger GET 4 42 HCOPy Subsystem 4 43 INITiate Subsystem 4 44 INPut 1I2 Subsystem 4 48 INPut3 Subsystem 4 50 MEASure Subsystem 4 51 Measurement Instructions CONFigure FETCh MEASure READ 4 52 Using MEAsure 4 75 Using CONFigure with READ 4 76 Using CONFigure with INITiate and FETCh 4 76 Firmware Revision Work Around Commands 4 77 MEMory Subsystem 4 79 SENSe Subsystem 4 80 SENSe EVENt 1 2 Subtree 4 80 Programming Guide Contents SENSe EVENt3 Subtree 4 84
79. 0 SUBEND 760 SUB Delete_macro Delete a macro 770 DIM Name 25 780 CALL Display_macros 790 LINPUT Enter the name of the macro you want to delete Name S 800 IF Name THEN SUBEXIT 810 OUTPUT 703 MEM DELETE MACRO CHRS 39 amp NameS amp CHR 39 820 SUBEND 3 76 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Make a Frequency Measurement QuickBASIC his program sets up the counter to make 10 frequency measurements on channel 1 using a 0 1 second gate time The results are printed on the computer CRT Data is sent in ASCII format to preseve resolution The SUB sendhp sends commands to the counter DECLARE SUB sendhp code REM SINCLUDE QBSETUP BAS Required by HP 82335A DIM SHARED source AS LONG Address and select code DIM i AS INTEGER i 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 resolution Must be read into a string The maximum number of characters that can ever be sent is 20 per measurement source amp 703 Counter at address 3 isc amp 7 Select code 7 state 1 Used in IOEOI CLS Clear screen CALL IOEOI isc amp state M
80. 0 measurements INIT Start making measurements OPC Tell Counter to put a 1 in the output buffer when 50th measurement is complete Read the Counter The program will wait here until the Counter returns a 1 CALC3 AVERAGE ALL Ask for statistics Using the OPC Command to Assert SRQ This method is recommended when the Counter is on the HP IB with many other instruments any of which can assert SRQ The commands OPC ESE 1 and Programming Guide 3 47 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter to Synchronize Measurements 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 is the most flexible but also the most complex CALC3 AVERAGE ON Enable statistics CALC3 AVERAGE COUNT 50 Base statistics on 50 measurements TRIG COUNT AUTO ON On INIT take N measurements ESE 1 Summarize OPC bit for Status Byte Register SRE 32 SRQ when event summary bit is 1 Set up program to specify service routine and enable interrupt when SRQ is asserted INIT Start measurements OPC Enable OPC bit Program could be doing other things while waiting for SRQ When SRQ occurs and the Counter has been identified as the cause of the SRQ ask for the da
81. 00 ns Ss top measuring and send the out of ECLARE SUB sendhp code EM SINCLUDE QBSETUP BAS IM SHARED source AS LONG U Wv U DIM period AS STRING 23 DIM complete AS INT DIM statusbyte AS INT EGER EGER If a measurement falls outside of these limits limits period to the computer he out of limit period is sent in ASCII format to preserve resolution he SUB sendhp sends commands to the counter the counter will Required by HP 82335A Address and select code Period string of characters that can ever be sent is 23 Status byte variable upper 000001 Upper period lower 0000005 lower period source amp 703 Counter at address 3 isc amp 7 Select code 7 complete 0 Used to check if stats received state 1 Used in IOEOI priority 1 Used in IOPEN CLS Clear the screen CALL IOEOI isc amp state Make sure EOI enabled CALL IOCLEAR source amp Clear the counter and interface CALL sendhp RST Reset counter CALL sendhp CLS clear event registers and error queue CALL sendhp SRE 0 clear service request enable register CALL sendhp ESE 0 clear event status enable registers CALL sendhp STAT PRES preset filters for oper
82. 000000 e Updating the offset causes the limit counts CALC2 LIM FCO CALC2 LIM PCO to be cleared e The front panel menu item is not always able to display all of the significant digits of this value When this is the case the displayed value is different from the actual value in that the displayed value has been rounded However using the front panel Enter key while this value is in the 11 digit display will update the actual value to the displayed rounded value Programming Guide 4 119 Chapter 4 Command Reference TRACe Subsystem Related Scale amp Offset Front Panel Keys TRACe DATA SCALE lt numeric_value gt or TRACe DATA SCALE lt arbitrary block gt TRACe DATA SCALE Sets or queries the scale value lt numeric_value gt 9 999999E 12 to 1 000000E 13 0 000000 1 000000E 13 to Range 9 999999E 12 lt numeric_value gt 7 digits Resolution Query Response e Response will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used the numeric data is transferred as ASCII bytes in lt NR3 gt format with eleven significant digits Comments e RST 1 000000 e Updating the scale causes the limit counts CALC2 LIM FCO CALC2 LIM PCO to be cleared e The front panel menu item is not always able to display all of the significant digits of this value When this is the case the displayed value is different from the actual value in that the displayed v
83. 005 Limit values upper 000001 actual S 0 Used in IOENTERS maxelems 23 Used in IOENTERS source amp 703 Counter at address 3 isc amp 7 Select code 7 complete 0 Used to check if stats received state 1 Used in IOEOI priority 1 Used in IOPEN CLS CALL IOEOI isc amp state Make sure EOI enabled CALL IOCLEAR source amp Reset counter and interface CALL sendhp RST Reset counter CALL sendhp CLS Clear event registers and error queue CALL sendhp SRE 0 Clear service request enable register CALL sendhp ESE 0 Clear event status enable registers CALL sendhp STAT PRES Preset filters for Operation and Questionable Status structures CALL sendhp FUNC CHRS 34 PER 1 CHRS 34 Measure period The function must be a quoted string The actual string sent to the counter is PER 1 3 82 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Use Limits to Filter Data Before Measuring Stats QuickB ASIC Continued When stats are complete will go from high to low These 3 lines enable tim arming with a 0 01 second gate time Computing statistics bit in Operation Status Register the bit soa negative transition is needed to bit that is summarized in the Status Byte Register the bit from the
84. 19 measure 4 52 using 4 75 measurement functions 4 89 See function 4 60 measurement instructions commands definition 4 52 measuring status bit 3 30 3 31 memory 4 79 messages Programming Guide program 3 14 response 3 16 MINimum 3 12 4 19 minimum value 3 11 multipliers 3 13 N N 4 20 negative pulse width 4 67 4 89 negative transition filter register 3 27 new line 3 11 3 18 non decimal numeric 3 11 Not a Number 9 91E37 3 17 NR1 3 17 NR2 3 17 NR3 3 17 NRf 3 11 numeric value 3 12 O offset scale 4 7 OHM 3 12 OPC 3 24 operation complete 4 132 operation complete status bit 3 24 3 25 operation status register group 3 27 3 30 optimizing throughput 3 35 Optimizing Throughput Results for Different Computers 3 37 optional keyword 3 9 options identifying 4 134 OSB 3 22 3 23 oscillator reference 4 92 out of limit event status bit 3 32 3 34 P parameter separator 3 12 parameter types 3 11 Boolean 3 11 literal 3 11 string 3 11 pass limit test 4 17 PCT 3 12 peak to peak voltage 4 70 4 89 period 4 68 4 89 phase 4 70 4 89 4 91 PON 3 24 positive pulse width 4 70 4 89 positive transition filter register 3 27 post processing 4 9 4 19 Index 3 Index power on status bit 3 24 3 26 power on 3 23 3 26 3 30 preset 4 110 print 4 43 prior firmware revisions 3317 3335 and 3402 2 32 3317 3335 and 3402 4 81 program messages definition 3 14 synt
85. 3 Programming Your Universal Counter for Remote Operation Programming Examples To Use Limits to Filter Data Before Measuring Statistics Turbo C Continued IOEOI isc state sendhp FUNC FREQ 1 sendhp FREQ ARM STAR SOUR IMM sendhp FREQ ARM STOP SOUR TIM sendhp FREQ ARM STOP TIM 001 sendhp STAT OPER ENABLE 256 sendhp STAT OPER NTR 256 sendhp STAT OPER PTR 0 sendhp SRE 128 sendhp CALC3 LFIL STAT ON sendhp CALC3 LFIL LOWER 1 MHz sendhp CALC3 LFIL UPPER 2 MHz sendhp CALC3 AVER ON sendhp CALC3 AVER COUNT 50 sendhp CALC2 LIM STAT ON sendhp CALC2 LIM LOWER 1 MHz sendhp CALC2 LIM UPPER 2 MHz sendhp CALC2 LIM DISP GRAPH Waiting for Enable use of EOL Make a frequency measurement These 3 lines enable time arming with a OO01 second gate time Computing statistics bit in Operation Status register he bit will go O ded to enabl hen statistics are complete Ey from high to low a negative transition is the bit that is egister his is the bit tatus register et lower limit et upper limit n the Status By nable statistics filter GHnNNARPNHHK HYwDAtS se 50 measurem Dp
86. 317 3335 or 3402 MINimum or 0 percent corresponded to low sensitivity and MAXimum or 100 percent corresponded to high sensitivity 1 4 Programming Guide Chapter 1 Before You Start Programming Guide Contents CONFigure TOTalize TIMed CONFigure TOTalize CONTinuous MEASure TOTalize TIMed If your Counter contains firmware revisions 3402 and below the Totalize Measurement Instruction commands shown above are not available to disable auto trigger In the firmware revisions 3402 and below these commands enabled auto trigger at the 50 level HP 53132A Time Interval Delay Arming HP 53131A and HP 53132A Counters with a serial number prefix below 3646 are identical in their TI arming modes Both only offer Time Interval Delay where the STOP trigger of a time interval measurement can be delayed by a user specified time Programming Guide 1 5 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 A description of the guide contents e A statement of assumptions that are made in the guide e 6A list of related documentation How to Use This Guide How you use this guide depends upon
87. 8 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 e 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 26 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Operation Status Register Group and Questionable Data Signal Status Register Group The Operation Status Register Group and the Questionable Data Signal Status Register Group each have a complete set of registers that consists of the following a condition register a positive transition filter register a negative transition filter register an event register an event enable register Figure 3 9 shows the model that these register groups follow A postive aratia oF meglio rarciton or cither raraibion Sew Tabhe 5 Ewrt Condition Tharator Bort Erabi Figure 3 9 Operation and Questionable Status Reporting Model Prog
88. 970 ENTER Count Status 980 IF Status lt gt 0 THEN 990 PRINT Quick TI calibration failed 1000 END IF 1010 RETURN 1020 1030 1040 Cal_fine Calibrates using the FINE TI calibration 1050 Code below includes the commands required to drive 1060 the HP 59992 JO6 Time Interval Calibrator 1070 PRINT Connect 10 MHz signal to calibrator back panel input 1080 PRINT Connect calibrator Channel A B outputs to 53131 Channel 1 2 1090 GOSUB Wait_for_input 1100 PRINT Recalibrating 1110 OUTPUT Cal B1 Bl Button 1 on calibrator 1120 OUTPUT Count DIAG CAL TINT FINE1 Counter processes Bl signal 1130 OUTPUT Count DIAG CAL STATUS Query status only to force 1140 program to wait until prior 1150 command has completed 1160 ENTER Count Status Response comes back when box 1170 is ready for next CAL command 1180 l 1190 OUTPUT Cal B2 B2 Button 2 on calibrator 1200 OUTPUT Count DIAG CAL TINT FINE2 Counter processes B2 signal 1210 OUTPUT Count DIAG CAL STATUS Query status only to wait 1220 ENTER Count Status 1230 1240 OUTPUT Cal B3 B3 Button 3 on calibrator 1250 OUTPUT Count DIAG CAL TINT FINE3 Counter processes B3 signal 1260 OUTPUT Count DIAG CAL STATUS Query status only to wait 1270 ENTER Count Status 1280 1290 OUTPUT Cal B4 B4 Button 4 on calibrator 1300 OUTPUT Count DIAG CAL TINT FINE4 Counter processes B4 signal 1310 OUTPUT Count DIAG CAL STATUS
89. A 132A Command Summary 2 20 SCPI Conformance Information 2 20 IEEE 488 2 Common Commands 2 21 HP 53131A 132A SCPI Subsystem Commands 2 24 Std New Column 2 24 Parameter Form Column 2 24 RST Response 2 40 3 Programming Your Universal Counter for Remote Operation Introduction 3 2 Chapter Summary 3 2 Where to Find Some Specific Information 3 2 Where to Find HP BASIC Programming Examples 3 3 Where to Find QuickBASIC Programming Examples 3 3 Where to Find Turbo C Programming Examples 3 3 Configuring the HP IB 3 4 To Set the HP IB Mode and Address 3 4 To Connect the Counter toa Computer 3 6 Remote Local Operation 3 6 Overview of Command Types and Formats 3 7 Common Command Format 3 7 SCPI Command and Query Format 3 7 Elements of SCPI Commands 3 8 Subsystem Command Syntax 3 8 Common Command Syntax 3 8 Abbreviated Commands 3 9 Keyword Separator 3 9 Optional Keyword 3 9 Implied Channel Optional Numeric Keyword Suffix 3 10 Parameter Types 3 11 Parameter Separator 3 12 Query Parameters 3 12 Programming Guide Contents Suffixes 3 12 Suffix Elements 3 12 Suffix Multipliers 3 13 Command Terminator 3 13 Using Multiple Commands 3 14 Program Messages 3 14 Program Message Syntax 3 14 Overview of Response Message Formats 3 16 Response Messages 3 16 Response Message Syntax 3 16 Response Message Data Types 3 17 Status Reporting 3 19 Status Byte Register and Service Request Enable Register 3 21 Status
90. ALC2 LIM STATE ON CALC2 LIM DISP GRAPH CALC IMM These commands can all be replaced by a macro called limitdisplay defined as follows DMC limitdisplay 290 DISP MENU OFF DISP TEXT FEED CALC2 CALC2 LIM STATE ON gt CALC2 LIM DISP GRAPH CALC IMM There is a finite amount of memory available in the Counter for storing macros If you find that you are running low on memory you can shorten the commands as follows 1 Do not send the complete path unless it is necessary 2 Use 1 and 0 instead of ON and OFF for lt Boolean gt parameters 3 Use the short form for keywords INP for INPut FUNC for FUNCtion and so on The above example for switching to the limit display can be significantly decreased in length using these shortcuts Programming Guide 3 53 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter to Define Macros DMC limitdisplay 268 DISP MENU 0 TEXT FEED CALC2 CALC2 LIM STAT 1 DISP GRAP CALC IMM Programming examples using macros are provided in the following section titled Programming Examples The first macro program listing starting on page 3 75 uses HP BASIC for an HP 9000 series 300 computer The second Macro program listing starting on page 3 88 is for an IBM PC or clone and HP 82335A B card Both are softkey driven and can be used to define macros enable or disable macros determine what macros are available an
91. ALCulate3 A VERage settings be used The statistics results are unaffected by post processing invoked with CALC 112 IMM CALCulate3 A VERage Subtree This subtree collects together the commands associated with the statistics capabilities The statistics results combine successive measurements to produce a composite result Not until CALCulate3 AVERage STATe is set to ON will any of one CALCulate3 A VERage settings be used CALCulate3 AVERage ALL Query Response This query returns all four statistics i e mean standard deviation maximum and minimum Statistics should be enabled CALC3 AVER STATe ON before attempting to query results e Numeric data transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range from 1 to 15 depending on the measurement resolution e Numbers are separated by commas The ordering of numbers within the response is mean standard deviation minimum and maximum e If CALC3 AVER STATe is OFF four comma separated Not a Number 9 91E37 values are returned and error 221 is generated e If no valid result exists four comma separated Not a Number 9 91E37 values are returned and error 230 is generated Programming Guide 4 19 Chapter 4 Command Reference CALCulate3 Subsystem e Ifthe current measurement is Totalize or Voltage Peaks Not a Number 9 91E37 is returned and error 221 is generated Comments Query only e The last calc
92. ASIC This program sets up the counter to determine the statistics of 50 period measurements that are within limits defined by the variables UPPER and LOWER Periods that are outside of the limits are not included in the statistics The Limit graph is displayed so you can see if measurements are in limit To alert the program that the statistics are ready bit 8 in the Operation Status register is used When statistics are being calculated this bit is high when they are complete the bit goes low By using the transition filters an SRQ can be generated when statistics are complete The SUB sendhp sends commands to the counter DECLARE SUB sendhp code REM SINCLUDE QBSETUP BAS Required by HP 82335A DIM SHARED source AS LONG Address and select code DIM status AS INTEGER Status byte variable DIM complete AS INTEGER Variable used in the program DIM statusbyte AS INTEGER Status Byte variable DIM maximum AS STRING 23 Strings used to enter stats DIM minimum AS STRING 23 DIM mean AS STRING 23 DIM sdev AS STRING 23 DIM nummeas AS INTEGER Number of measurements DIM lower AS SINGLE Lower limit DIM upper AS SINGLE Upper limit nummeas 50 Number of statistics measurements lower 0000
93. ASure group of instructions to quickly and easily make any of the counter s In this program time interval frequency and period can make measurements using any of the other However the MEASure group counter functions The program is composed of The second subroutine uses each method INTEGER I DIM Freq 22 DIM Periods 22 DIM Tint 22 The following commands reset the counter ASSIGN Count TO 703 CLEAR 703 OUTPUT Count RST OUTPUT Count CLS OUTPUT Count SRE 0 OUTPUT Count ESE 0 OUTPUT Count STAT PRES Gl CI GOSUB Measure LINPUT Press RETURN for GOSUB Conf_read GOSUB Init_fetc STOP three subroutines The first uses only the MEAS TINT 1 2 command to make a time interval measuremen measurements will be measured CONF FREQ and READ to mak a meas The third uses CONF FREQ INIT and FETCH to make a measurement The comments at the start of each subroutine explain t Declare variables Declare string to e Using strings to en I data yields results correct resolution default format for Assign I O path for Clear the counter a Reset the counter he bene nter da ter ASC format ASCII the cou counte nd inte uremen fits of ta II format ted to the is the nter r rface Clear event registers and error queue
94. Alert the Computer When Measuring has Completed Example 4 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 For example a frequency measurement with a gate time of 10 seconds When the measurement is complete the Counter can alert the computer 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 when a measurement has completed Operation Status Register STAT 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 3 40 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands to stabs NO ye Sip this section Stes Reporting Fapatirg Lise the idling STATOFEREME 1809 Reset ond initelitethe Courter aa tolona Denice Clear Ths cradles ary of the av
95. Byte Register 3 21 Service Request Enable Register 3 23 Standard Event Status Register Group 3 24 Standard Event Status Register 3 24 Standard Event Status Enable Register 3 26 Operation Status Register Group and Questionable Data Signal Status Register Group 3 27 Condition Register 3 28 Transition Filter 3 28 Event Register 3 29 Event Enable Register 3 29 Operation Status Register Group 3 30 Questionable Data Signal Status Register Group 3 32 Command Settings for Optimizing Throughput 3 35 Commands to Set Counter for Optimal Throughput 3 35 Typical Optimizing Throughput Results for Different Computers 3 37 How to Program the Counter for Status Reporting 3 38 Determining the Condition of the Counter 3 38 Resetting the Counter and Clearing the HP IB Interface Example 1 3 38 Using the Standard Event Status Register to Trap an Incorrect HP IB command Example 2 3 39 Programming Guide Contents vi Event Status Register 3 39 Using the Questionable Data Signal Status Register to Alert the Computer When Automatic Interpolator Calibration is Disabled Example 3 3 39 Questionable Data Status Register 3 40 Using the Operation Status Register to Alert the Computer When Measuring has Completed Example 4 3 40 Operation Status Register 3 40 How to Program the Counter to Display Results 3 43 Configuring the Counter s Display 3 43 Commands for Displaying Non Scaled Offset Results 3 43 Commands for Displaying Scaled Offset Res
96. C2 LIM DISP is GRAPh the measurement results are displayed symbolically on a graph the measurement result is represented by an asterisk while the upper and lower limits are each represented by a colon A sequence of ASCII encoded bytes GRAP or NUMB e RST NUMBer e This command updates the display mode immediately The display update is independent of CALC2 IMM AUTO state e See the section titled How to Program the Counter to Display Results in Chapter 3 for programming examples Limit Modes CALCulate2 LIMit FAIL Query Response Comments Queries the status of the last measurement that was limit tested e Single ASCII encoded byte 0 or 1 e A value of zero indicates the last tested measurement passed the limit test A value of one indicates the last tested measurement failed e If no valid result exists 0 is returned and error 230 is generated e Query only e If this command is issued when limit testing is enabled and while a measurement is in progress no response will be produced until the measurement completes e This command holds off subsequent commands from being processed until a measurement completes This holdoff action can only be canceled by the measurement completing a device clear or power cycle 44400 6 lt C lt i lt i Programming Guide Query Response Comments Chapter 4 Command Reference Introduction e If the current measurement is Totalize o
97. C3 DATA 600 ENTER Count Minimums 610 OUTPUT Count CALC3 AVERAGE TYPE MEAN CALC3 DATA 620 ENTER Count Means 630 OUTPUT Count CALC3 AVERAGE TYPE SDEV CALC3 DATA 640 ENTER Count Sdevs 650 PRINT 660 PRINT Serial Poll Serial_poll Should be 96 670 PRINT 680 PRINT USING 21A 22A X 8A Minimum Period Minimum seconds 690 PRINT USING 21A 22A X 8A Maximum Period Maximum seconds 700 PRINT USING 21A 22A X 8A Mean Period Mean seconds 710 PRINT USING 21A 22A X 8A Standard Deviation SdevS seconds 720 LOCAL 703 730 END Programming Guide 3 65 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 10 20 30 40 50 60 70 80 90 BPR BAB AB ADA A W Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Use Limits to Filter Data Before Measuring Stats HP BASIC displayed so you can s This program instructs the counter to determine the statistics of 50 Period measurements that are within the limits defined by the variables Upper and Lower the limits are not included in the statistics The Limit graph is if measurements are in limit Periods that are outside of n tatistics are complete INT
98. CY Cle lt reference gt 1 Measures Duty Cycle The measurement arming is coupled to auto The lt reference gt specifies the point on the pulse where the duty cycle is determined This point can be specified as either a percentage or an absolute voltage The default units are percent The lt reference gt parameter is used to configure the trigger settings When the lt reference gt is specified as a percentage or defaulted auto trigger is enabled and auto trigger levels are set to the specified or defaulted reference value When the lt reference gt is specified in volts auto trigger is disabled and the absolute trigger levels are set to the specified reference value lt reference gt percent range percent resolution voltage range voltage resolution default lt source_list gt range default 0 to 100 PCT 10 For volts if X1 Attenuation 5 125V to 5 125V For volts if X10 Attenuation 51 25V to 51 25V For volts if X1 Attenuation 005V For volts if X10 Attenuation 05V 50 PCT 1 1 4 61 Programming Guide Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage FALL TIME lt lower_reference gt upper_reference gt 1 Measures Fall Time The measurement arming is coupled to auto The Counter uses the lt low
99. Comments Queries the SCPI version number with which the Counter complies 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 1992 and the V represents the approved version for that year 0 The instrument complies with SCPI Standard 1992 0 and returns this value as the response to this query 4 118 Programming Guide Chapter 4 Command Reference Introduction TRACe Subsystem This subsystem provides access to the scale and offset values The TRACe subsystem used in conjunction with the CALCulate 1 subsystem scales and offsets measurement results TRACe CATalog Queries list of intrinsic constants The Counter has two constants scale and offset Query Response A comma separated list of strings SCALE OFFSET TRACe DATA OFFSET lt numeric_value gt HZ S DEG or TRACe DATA OFFSET lt arbitrary block gt TRACe DATA OFFSET Sets or queries the offset value lt numeric_value gt 9 9999990000E 12 to 1 0000000000E 13 0 0000000000 1 0000000000E Range 13 to 9 9999990000E 12 lt numeric_value gt 11 digits Resolution Query Response e Response will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used the numeric data is transferred as ASCII bytes in lt NR3 gt format with eleven significant digits Comments RST 0 0000
100. Conformance Information The SCPI commands used in the HP 53131A 132A are in conformance with the SCPI Standard Version 1992 0 The SCPI command set consists of the following e Common commands as defined in IEEE 488 2 1987 listed and summarized in Table 2 1 e SCPI Subsystem commands as confirmed and listed in the SCPI Standard the commands defined in Table 2 2 as Std e 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 53131A 132A commands can be found in Chapter 4 Command Reference of this programming guide Information on the SCPI commands format syntax parameter and response types is provided in Chapter 3 Programming Your Universal Counter for Remote Operation of this programming guide 2 20 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps IEEE 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 related to measurement configuration They are used for functions like resetting the instrument identification or synchronization Table 2 1 lists the Common Commands in alphabetical order by mnemonic name an
101. D ES HP 1033A BCD HP4B Cable Figure 3 1 HP IB Interconnection Remote Local Operation At power up the Counter is under front panel local control Once in remote the Counter settings cannot be affected by the front panel controls The Save amp Print key may be used to manually return to local control only if local lockout is off 3 6 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Overview of Command Types and Formats There are two types of HP 53131A 132A programming commands IEEE 488 2 Common Commands and Standard Commands for Programmable Instruments SCPI The IEEE 488 2 Common Commands control and manage communications between the HP 53131A 132A and the controller or personal computer The SCPI commands control instrument functions 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 the 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 li
102. E External Arming b ARM EXTERNL C SLOPE POS NEG External Arming ARM EXTERNL SLOPE POS NEG NONE TIME lt time gt DELAY DELAY TIME Figure 2 4 Gate amp ExtArm Key to SCPI Command Map Part 1 of 6 2 10 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Gate amp ExtArm Key to SCPI Command Map Cont 1 Freq Period Ratio Auto Arming a SENSe FREQuency ARM STARt SOURCce IMMediate SENSe FREQuency ARM STOP SOURCe IMMediate Digits Arming b SENSe FREQuency ARM STARt SOURce IMMediate SENSe FREQuency ARM STOP SOURGce DIGits c SENSe FREQuency ARM STOP DIGits lt numeric_value gt Time Arming d SENSe FREQuency ARM STARt SOURCce IMMediate SENSe FREQuency ARM STOP SOURce TIMer e SENSe FREQuency ARM STOP TIMer lt numeric_value gt External Arming f SENSe FREQuency ARM STARt SOURce EXTernal g SENSe FREQuency ARM STARt SLOPe POSitive NEGative h4 SENSe FREQuency ARM STOP SOURce IMMediate ho SENSe FREQuency ARM STOP SOURce EXTernal SENSe FREQuency ARM STOP SLOPe POSitive NEGative hg SENSe FREQuency ARM STOP SOURCce TIMer I SENSe FREQuency ARM STOP TIMer lt numeric_value gt S Phase Auto Arming a SENSe PHASe ARM STARt SOURce IMMediate External Arming b SENSe PHASe ARM STARt SOURce EXTernal c SENSe PHASe ARM STARt SLOPe POSitive NEGative
103. E in the front panel Utility menu sets the RS 232 DTR line to indicate when the device is ready to receive When the number of received bytes in the input buffer of the Counter reaches a stop thresholdrhhhe the Counter will de assert the DTR line When the number of bytes has been reduced to a start threshold the Counter will assert DTR indicating that it can receive input again The Counter will also monitor the state of the DSR Data Set Ready line which is pin 6 of the RS 232 connector and will stop transmission if either of those lines becomes de asserted Choose the IBFull parameter when the printer and cable you are using require handshaking for counter to printer communication The LIMit parameter which is equivalent to DTR LIMIT in the front panel Utility menu indicates that the RS 232 DTR line will be used to indicate out of limit The LIMit parameter will force the DTR line HIGH if the measurement is in limit and LOW if the measurement is out of limit a4 0 Programming Guide Query Response Comments Related Front Panel Keys Chapter 4 Command Reference Introduction A sequence of ASCII encoded bytes IBF ON or LIM e This value is stored in non volatile memory It is unaffected by power on save recall and RST e The start and stop thresholds are not user configurable Utility POWER SYSTem COMMunicate SERial TRANsmit BAUD lt numeric_value gt Range Query Response Comments Related Front Panel K
104. EE TOFSR armeele nthe Sapte Set iaoa ardarctienath Sear igure 25 SeacChapter 4 Chute ard TRACE OA TA ton Hoa bo Prog am tha Conker for Mathylinat Oper vor in thes chapter Configure RS 232 ard enable ning Seer que 22 Seathapter 4 6 Tem COM Municabe and HECE y Sak limte ard arabia limk tasting Saa Figura 5 Saa phe 4 TALOA RAR Saa programming ampia To Patom Limit Tasting inthis chapter Lea lt ALCT1 ZEM adta to invoke post proosssirig To raneta TF MEGET GRA tae Chapter S BECAT To rareta Eais amp reel see hepar 4 ALCL MATHDATAT To ret limit best rasie saa 4 SCALELSLIMAF ML SALE SLIMAPOOUA TAL SLIM EF OE Figure 3 11 SCPI Programming Flowchart Sheet 1 of 2 3 56 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands A From sheet 1 of 2 Sed oct the function yowank bo patom Soa Figure 23 Sea GS BNS FUNC IN TERA 4 Brats ad comique Rias Sat the inpet conditions and tigger sattings bo Sem Figure 25 nekch your signal Sea Chopts 4 N C tzba gt and Seve Figure 21 peace Saa Chapter 4 INFut aod SENS FEV ENt aapa To Macara Ai tapp iin pemali and To LPa i baite ts bo Fibat Daka Before Maasuring Sate in his checher Sadat amingga stings Soe Figure 2 Soa 4 SEEFF REA Fit intiza ablock of mercurcen ake ESEE JE HASA Pid SENS TOT ARM Sa 4 TRG Or OOUM AUTO of S
105. EGER I Num_meas alculated this bit is high To alert the program that the statistics are ready bit 8 in the Operation Status register is used When statistics are being Cc when they are complete the bit goes low By using the transition filters an SRO can be generated when ASCII format is used to preserve resolution DIM Sdev 22 Mean 22 Minimum 22 Maximums 22 Num_meas 50 Statistics based on num_meas measurements Upper 1 10E 7 Upper period to be included in statistics Lower 1 00E 7 Lower period to be included in statistics CLEAR SCREEN ASSIGN Count TO 703 CLEAR 703 Clear the counter and interface OUTPUT Count RST Reset the counter OUTPUT Count CLS Clear event registers and error queue OUTPUT Count SRE 0 Clear service request enable register OUTPUT Count ESE 0 Clear event status enable register OUTPUT Count STAT PRES Preset enable registers and transition filters for operation and questionable status structures OUTPUT Count FUNC PER Measure frequency on channel 1 OUTPUT Count FREQ ARI OUTPUT Count FREQ ARM STOP SOUR TIM OUTPUT Count FREQ ARM STOP TIM OUTPUT Count STAT OPER ENABLE 256 OUTPUT Count STAT OPER NTR 256 OUTPUT Count STAT OPER PTR 0 OUTPUT Count SRE 128
106. ENSE TINTA Fe zs P al g Saa Pa 20 WH Ged EmMa SAE T Optimizing Trouget inthis chagter Sere PROSE TAMIN a TOOptinina ed pi pa Aprann a Inizia a msceuremerk Saa Figure 2 Saa Chapter 4 INTIA Sot aiaosa aderchiamah Soar que 25 Sea tcipoter 4 ALOA ard TRACA TA Sen Hoey to Prog am the Courter for Mayline Oper ore in thes copter Sak limits and erable link basting Som Figure 25 Saa Chopher CAL Ousba To traretes roar naccunamert cata saa Chapter 4 S ENS DA TAT Soa example To Perform Limit To rareta scladnitset rast saa Chapter 4 CRLCT MATHDATA TEAN nine C To trareter limit bast ras A OLCALIMIC FAILY Ut saa SCALCSLIMICE Ory CALCSLIMIRPES To rancia ste tics results Seat tapte 4 CALCaAVERALL Figure 3 11 SCPI Programming Flowchart Sheet 2 of 2 Programming Guide 3 57 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples Programming Examples In this section you will see how to program the HP 53131A 132A to make many common measurements Examples are provided in the following programming languages e HP BASIC e Microsoft QuickBASIC version 4 5 e Borland Turbo 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 discus
107. ES Net ved a_ O thor le tov r apresar be Ftoae fred Ey Bs Not Used a binary waghting of the corresponding bit tino 2 2 Descriptions of al regatos ao conteined in this section Net Lbed sana 2 To reset the Counter erdinticiie she repoting Frequency Stes porone ho riaiing Finse 6 H3 Remtand ini blizo Neud S aia Lic reper Ing Caditraton Emor Slate g Netbods a 9 Cut of Limit bret AENA Go een TT Commandwaming ES aq Net Used E Lee STATIS QUE Storabis Commands to ania ard read registers jem Sbrechrd Dents b lux Register Group a N 4 The value of inibedbib is rero when quetied and igncted whan Set Summary olEEE4Ss 2 4567 SermhrdS bus ob Siuro a 2a 77 Sabie Request Brabioands blaz By Regza my ne cerana ws Read by Soa Pdl w Read with STE l o ss lt ieee A i ees OpsrationConptets aE 3 Used Toba netsa 4 Gosea oH eH pin ay Error i 2 o ERTE L3 ila Saves EFROF z TE a OF Oeics Depencort nor 3 Wis WE aE ation Enor 1i fonnnen Commend Eno Sef s f in j NRUset af SYST ERRO Powar O to query the Emer Chisum use ESPR EE ary ahd ESE to cork and reedregobra J Operation S bls Regist Group Bik Calibrating prams E Te2 AA Meuring E 8 e Needa Seo z Com puting Statistics Ss L 8 a Using Intern Rotororce ery E a 9 In Limit Bore Ea Not Leed iib is Use ST TA OFERaton Comnord Cort Of and read rege ters Figure 3 6
108. ETURN definemacro Define a macro CLS INPUT Enter the name of the macro to be defined namemacro INPUT Enter the commands to be sent commandmacro length LEN commandmacro numchar INT LOG length LOG 10 1 headerS LTRIMS STRS numchar PRINT headers acrocommandsS headerS LTRIMS STRS length commandmacro m code DMC CHRS 39 namemacro CHR 39 macrocommands PRINT code R CALL iooutputs source code LEN code ETURN quit PRINT End of Program STOP RETURN SUB sendhp code CALL iooutputs source code LI END SUB GI N code S 3 90 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Make a Frequency Measurement Turbo C This program sets up the counter on channel 1 using a 0 1 second The results are displayed on The program comments discuss include lt stdio h gt include lt string h gt include CHPIB H include CFUNC H to make 10 freqeuncy measurements gate time the computer CRT the meaning of each command ASCII result format is used to preserve resolution void sendhp char function to send command to counter global data long ctr 703 Counter is at address 03 HP IB is at select code 7 Ei int error void main long isc 7 int state 1 in
109. FETCh PTPeak The command listed below should NOT be used when the function choice is Voltage Peaks READ The work around command sequence which should be substituted is listed below INIT WAI FETCh When the function is set to Voltage Peaks and the Counter is in SINGLE mode the HP IB command FETCh will hang the HP IB if the measurement has not completed The work around inserts a command which enforces correct timing The work around command sequence is listed below INIT WAI FETCh When the function is set to Voltage Peaks and the Counter is in RUN mode the HP IB command FETCh should not be used The work around puts the box into SINGLE mode and inserts a command which enforces correct timing The work around command sequence is listed below INIT CONTinuous OFF INIT WAI FETCh 4 78 Programming Guide Chapter 4 Command Reference Introduction MEMory Subsystem This subsystem manages the instrument s memory The MEMory capabilities of an instrument are not part of the instrument state and are not affected by reset RST or recall RCL In this instrument the macro capabilities will not survive a power cycle but the SAV RCL states will MEMory DELete MACRo lt string gt Comments Deletes the macro with the name specified by the string parameter The new IEEE 488 2 1992 command RMC Remove Macro Command may also be used it performs exactly the same action as MEMor
110. G SIGN UNTIL THE INDICATED CONDITIONS ARE FULLY UNDERSTOOD AND MET CAUTION Damage to equipment or incorrect measurement data may result from failure to heed a caution Do not proceed beyond a CAUTION sign until the indicated conditions are fully understood and met For additional safety and acoustic noise information see back matter 1 2 Contents Before You Start Introduction 1 2 Differences Between Prior and Current Revisions of the HP 53131A 132A 1 3 HP 53131A Containing Firmware Revisions 3317 3335 or 3402 1 3 HP 53132A Time Interval Delay Arming 1 5 Getting Started 1 6 How to Use This Guide 1 6 New Users 1 6 What You Should Understand 1 6 Learning to Program the Counter 1 7 Experienced Programmers 1 7 Applications 1 8 Programming Guide Contents 1 9 Assumptions 1 9 Related Documentation 1 10 Command Summary Introduction 2 2 Chapter Summary 2 2 Front Panel to SCPI Command Maps 2 3 Some SCPI Syntax Conventions 2 3 Input Channels Conditioning Keys to SCPI Command Map 2 4 Instrument Control Utility Recall and Save amp Print Keys to SCPI Command Map 2 6 MEASURE Keys to SCPI Command Map 2 8 Gate amp ExtArm Key to SCPI Command Map 2 10 Gate amp ExtArm Key to SCPI Command Map For HP 53131A and HP 53132A With S N Prefix Below 3646 2 13 LIMITS and MATH Keys to SCPI Command Map 2 16 Programming Guide jii Contents Calibration Menu to SCPI Command Map 2 18 HP 53131
111. HP 53131A 132A SCPI Status Reporting Summary Functional Diagram 3 20 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Status Byte Register and Service Request Enable Register Figure 3 7 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 7 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 The Status Byte Register is altered only when the state of the overlying status data structures is altered The entire Status Byte Register can be cleared by sending the CLS command by itself in a program message to the Counter Table 3 4 lists the Status Byte Register bits and briefly describes each bit Programming Guide 3 21 Chapter 3 Programming Your Universal Counter for Remote Operation Status Reporting Table 3 4 Status Byte Register Pe SYMBOL DESCRIPTION o C o K S S a _ oe o la 3 QSB Summary Bit s fe ROSIMSS Request SenicoMesier Status Summary Bt A detailed description of each bit in the Status Byte Register follows 3 22 Bits 0
112. II encoded bytes OFF Comments e This command is available only if the instrument contains the medium or high stability oscillator option otherwise error 241 is generated e The calibration values are stored in non volatile memory and are unaffected by power on save recall and RST e Use DIAG CAL STAT to check for successful calibration e After calibration is completed the state of this command s parameter is OFF Related Scale and Offset POWER Calibration menu Front Panel Keys DIAGnostic CALibration STATus Queries pass fail status of the last calibration It can be used after any calibration to determine if the calibration was successful Query Response e Numeric data transferred as ASCII bytes in lt NR1 gt format e A value of zero indicates that calibration completed without error A value of one indicates the calibration completed with error Comments Query only 43400 Programming Guide NOTE Chapter 4 Command Reference Introduction DIAGnostic CALibration TINTerval FINE 1 2 3 4 Comments Related Front Panel Keys These event commands when performed in the appropriate order and with the appropriate calibration signals supplied to both channels calibrate out the differences in electrical path length between Channel 1 and Channel 2 Before sending any of these commands the appropriate calibration signal must be supplied to both channels Please see the section titled To Initiate the C
113. L ROSC AUTO ONCE DIAG CAL TINT FINE 1121314 DIAG CAL TINT QUICk The CAL DATA command also increments the calibration count Numeric data transferred as ASCII bytes in lt NR1 gt format Query only The calibration count is stored in non volatile memory thus cycling power will not reset value The calibration count is unaffected by power on save recall and RST The calibration count increments up to a maximum of 32 767 after which it wraps around to 1 A value of 0 indicates no calibration has been performed since the last reset of the non volatile memory 4260 Programming Guide Related Front Panel Key Chapter 4 Command Reference Introduction e Your Counter was calibrated before it left the factory When you receive your Counter read the calibration count to determine its initial value e Early versions of the Counter do not support this query Scale amp Offset POWER Calibration Menu CALibration DATA lt arbitrary block gt Query Response Comments Sets or queries the calibration data input gain input offset reference oscillator and time interval Before performing calibration it is a good idea to query CAL DATA and store the current calibration values in your program or on a disk in case an error occurs during the calibration process See the sample program How to Read and Store Calibration Information in Chapter 3 Programming Your Universal Counter for Remote Operation
114. LA atkaro Programming Guide HP 53131A 132A 225 MHz Universal Counter Programming Guide This guide describes how to program the HP 53131A 132A 225 MHz Universal Counter 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 NUMBER PREFIX 3546 to 3622 HP 53131A 3546 to 3646 HP 53132A HP 53131A 132A 225 MHz Universal Counter Copyright Hewlett Packard Company 1996 All Rights Reserved Reproduction adaptation or translations without prior written permission is prohibited except as allowed under the copyright laws Printed November 1996 Printed in USA Manual part number 53131 90044 Hewlett Packard Company Santa Clara Division 5301 Stevens Creek Boulevard Santa Clara California 95052 8059 Certification and Warranty Certification Hewlett Packard Company certifies that this product met its published specification at the time of shipment from the factory Hewlett Packard further certifies 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 This Hewlett Packard instrument product is warranted again
115. M ESTOP SOUR TIM is selected STARt SLOPe POSitive NEGative Sets the slope of the external start arm signal used in external arming Tme Interval measurements including Time Interval Rise Time Fall Time Dutycycle and Pulse Width Only applies when SENS TINT ARM STAR SOUR EXT is selected SOURce IMMediate EXTernal Sets the start arm for time interval including Time Interval Rise Time Fall Time Dutycycle and Pulse Width measurements STOP Subtree SOURce IMMediate TIMer Sets the stop arm i e the delay for Time Interval measurements TIMer lt numeric_value gt Sets the time used to delay the stop arm for Time Interval measurements Only applies when SENS TINT ARM STOP SOUR TIM is selected Programming Guide 2 39 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 commands affected by the RST command are described in Table 2 3 Since the HP 53131A and HP 53132A have different arming capabilities for Time Interval measurements sub tables Table 2 3A and Table 2 3B are provided Table 2 3A describes the state of the HP 53131A s SENSe Interval commands affected by the RST command and Table 2 3B describes the HP 531312A s SENSe Interval commands affected by the RST command Table 2 4 lis
116. N before attempting to query results e Result will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used numeric data is transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range from 1 to 15 depending on the measurement resolution Only significant digits will be returned e If CALC3 AVER STATe is OFF Not a Number 9 91E37 is returned and error 221 is generated e If no valid result exists Not a Number 9 91E37 is returned and error 230 is generated 4220 Programming Guide Comments Chapter 4 Command Reference Introduction e Ifthe current measurement is Totalize or Voltage Peaks Not a Number 9 91E37 is returned and error 221 is generated e Query only e The last calculated result remains valid until a new computation is made or a relevant instrument state is modified CALCulate3 FEED CALCulate 1 Query Response Comments NOTE Sets or queries the data flow to be fed into the CALCulate3 block The string CALC is returned RST CALCulate 1 CALCulate3 LFILter Subtree This subtree collects together the commands used to specify which measurements will be used in computing statistics out of limit measurements can be filtered out of the statistics processing Not until CALCulate3 LFILter STATe is set to ON will any of the CALCulate3 LFILter settings be used CALCulate3 LFlLter LOWer DATA
117. REQ 50 MHZ 1 HZ where 50 MHz is the expected value which can of course also be sent as 50E6 HZ and 1Hz is the required resolution Also the channel numbers can be specified if you send for example MEASURE FREQ 2 MEASURE FREQ 50 MHz 1 HZ 2 Programming Guide 4 75 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ How to Use the Measurement Instruction Commands Cont 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 now it is possible to insert commands between CONFigure and READ to specify a particular setting For example use CONF FREQ 5 MHZ 1HZ to configure a default frequency measurement where 1 Hz is the required resolution and 5 MHz is the expected value Use SENS EVEN LEV OV to set the trigger level to 0 Volts 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 50 MHZ 1 HZ to configure for a default frequency measurement where 1 Hz is the required resolution and 50 MHz is the expected value 4760 Programming Gu
118. S o SENSe TINTerval ARM ESTOP LAYer 1 ECOunt lt numeric_value gt Figure 2 4 Gate amp ExtArm Key to SCPI Command Map Part 6 of 6 Programming Guide 2 15 Chapter 2 Command Summary Front Panel to SCPI Command Maps LIMITS and MATH Keys to SCPI Command Map Figure 2 5 LIMITS and MATH Keys to SCPI Command Map Part 1 of 2 2 16 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps LIMITS and MATH Keys to SCPI Command Map Cont 1 a CALCulate2 LIMit UPPer DATA lt numeric_value gt HZ S DEG b CALCulate2 LIMit LOW er DATA lt numeric_value gt HZ S DEG 2 a CALCulate2 LIMit STATe OFF ON by INITiate AUTO OFF bo INITiate AUTO ON c CALCulate2 LIMit DISPlay GRAPh NUMBer 3 a DISPlay WINDow TEXT FEED CALC CALCulate3 AVERage TYPE MAXimum MINimum SDEViation MEAN OR DISPlay W INDow TEXT FEED CALC2 b CALCulate3 AVERage COUNt lt numeric_value gt c CALCulate3 AVERage STATe OFF ON dy CALCulate3 LFiLter STATe OFF do CALCulate3 LFiLter STATe ON e1 TRIGger COUNt AUTO OFF e2 TRIGger COUNt AUTO ON a TRACe DATA SCALE lt numeric_value gt b TRACe DATA OFFSET lt numeric_value gt HZ S DEG c CALCulate MATH STATe OFF ON Use CALC3 AVER TYPE and DISP WIND TEXT FEED CALC3 to specify SHOW STD DEV MEAN MAX or MIN Use DISP WIND TEXT FEED CALC2 to specify SHOW MEAS
119. SENSe EVEN 1 2 LEVel ABSolute AUTO OFF Set gate arm to auto for appropriate measurement For Frequency Period and Ratio SENSe FREQuency ARM STARt SOURce IMMediate SENSe FREQuency ARM STOP SOURce IMMediate For Phase SENSe PHASe ARM STARt SOURce IMMediate For Time Interval HP 53131A Only SENSe TINTerval ARM STARt SOURce IMMediate SENSe TINTerval ARM STOP SOURce IMMediate For Time Interval HP 53132A Only SENSe TINTerval ARM ESTART LAYer2 SOURce IMMediate SENSe TINTerval ARM ESTART LAYer 1 SOURce IMMediate SENSe TINTerval ARM ESTOP LAYer2 SOURce IMMediate SENSe TINTerval ARM ESTOP LAYer 1 SOURce IMMediate Define device trigger to FETC When the device trigger is defined as FETC the Group Execute Trigger should be used to query for a result DDT 15FETC Programming Guide 3 35 Chapter 3 Programming Your Universal Counter for Remote Operation Command Settings for Optimizing Throughput Set reference oscillator to non auto state internal or external SENSe ROSCillator SOURce INTernal EXTernal See Note below Disable checking of external source if using external reference oscillator SENSe ROSCillator EXTernal CHECk OFF See Note below Disable automatic interpolator calibration DIAGnostic CALibration INTerpolator AUTO OFF See Note below Disable display DISPlay ENABle OFF See Note below Disable printing HCOPy CONTinuous OFF Disab
120. STARt SLOPe POSitive NEGative Query Response Comments Related Front Panel Keys Sets or queries the slope of the external start arm signal used in external arming Phase measurements A sequence of ASCII encoded bytes POS or NEG e 6 RST POSitive e Only applies when SENS PHAS ARM STAR SOUR EXT is selected Gate amp ExtArm Programming Guide 4 91 Chapter 4 Command Reference SENSe Subsystem SENSe PHASe ARM STARt SOURce IMMediate EXTernal Query Response Comments Related Front Panel Keys Sets or queries the start arm for Phase measurements A sequence of ASCII encoded bytes IMM or EXT RST IMMediate Gate amp ExtArm SENSe ROSCillator Subtree This subtree controls the Reference Oscillator SENSe ROSCillator EXTernal CHECk ON OFF ONCE Sets or queries the enable for checking the validity and presence of the external reference When CHECK is ON and external has been explicitly selected SENS ROSC SOUR is EXT and SENS ROSC SOUR AUTO is OFF the Counter checks the external reference signal to ensure that the frequency is 1 5 or 10 MHz and that the reference is present at measurement completion Note that the HP 53132A only accepts 10 MHz When CHECKk is OFF the external reference signal is not checked at all CHECk ONCE is an event which invokes the external reference check at the time the command is executed ONCE is only permitted if SENS ROSC SOUR is EXT
121. Service Request Enable register STB Status Byte Query Queries the Status Byte and Master Summary Status bit Trigger This trigger command is the device specific analog of the IEEE 488 1 defined GET It initiates measurement unless DDT was used to redefine device trigger Self Test Query Executes an internal self test and reports the results Makes Counter wait until all pending operations see Wait to Continue Note are completed before executing commands following WAI command Note Pending operations include measurements in progress Programming Guide 2 23 Chapter 2 Command Summary HP 53131A 132A Command Summary HP 53131A 132A SCPI Subsystem Commands SCPI Subsystem commands include all measurement functions and some 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 a command is specified as No Query or Query Only in the Comments column of Table 2 2 it has both a command and a query form Any command in the table that is shown with a
122. T 4 137 affected setup 2 40 unaffected setup 2 40 2 43 RST Response 2 40 RST summary list 2 40 S S 3 12 save 4 138 scale 4 7 scale offset 4 7 SCPI command format 3 7 conformance 2 20 obtaining copy of standard 1 10 query format 3 7 version 1 2 2 20 4 118 SCPI Command Summary Table 2 25 SCPI programs how to write 3 55 SDCL 4 31 security code 4 28 security state 4 28 selected device clear 4 31 self calibration 4 26 self test internal 4 142 sensitivity 4 81 separate common 4 81 Programming Guide Index separator keyword 3 9 parameter 3 12 serial control 4 114 serial port 4 43 service request enable register 3 23 4 139 short form 3 53 single quoted string sending a single quoted string 3 58 slope 4 84 standard deviation 4 19 standard event status enable register 3 26 4 127 standard event status register 3 24 4 128 statistics 4 19 enable 4 21 filter 4 23 maximum 4 22 mean 4 22 minimum 4 22 N 4 20 results 4 19 standard deviation 4 22 stats 4 19 status operation 4 107 preset 4 110 status byte register 3 21 4 140 status reporting 3 38 flowchart 3 41 summary of all registers 3 19 stop 3 10 string 3 11 3 18 HP BASIC 3 58 parameters 3 58 subsystem command syntax 3 8 Subsystem Commands 4 4 ABORt 4 4 CALCulate 4 5 CALCulate 1 4 7 CALCulate 1 DATA 4 7 CALCulate 1 FEED 4 8 CALCulate 1 IMMediate 4 8 CALCulate 1 MMediate AUTO
123. TS results actual PRINT The following macros are available PRINT macros RETURN querymacro Ask for definition of a macro CLS GOSUB displaymacro INPUT Enter the name of the macro you want to see namemacro IF namemacro THEN RETURN sendhp GMC CHRS 39 namemacroS CHRS 39 CALL IOENTERS source results maxlength actual macronamesS LEFTS results actual PRINT namemacroS is defined as PRINT macronames RETURN deletemacro Delete a macro GOSUB displaymacro INPUT Enter the name of the macro you want to delete namemacro IF namemacro THEN RETURN sendhp MEM DELETE MACRO CHRS 39 namemacro CHRS 39 RETURN Programming Guide 3 89 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Use Macros QuickBASIC Continued purgemacro Purge all macros INPUT Are you sure you want to purge all macros answer answerS UCASES answer IF answerS Y THEN sendhp PMC PRINT All macros purged END IF RETURN disablemacro Disable macros but do not purge sendhp EMC 0 PRINT Macros Disabled RETURN sendmacro CLS GOSUB displaymacro INPUT Enter the name of the macro to send namemacros IF namemacro THEN RETURN sendhp namemacro R
124. TURN Resecure Routine SECURES the device OUTPUT Count CAL SEC STAT Query the current security status ENTER Count Device_secure Check SECURED 1 UNSECURED 0 WHILE Device_secure 0 If device is UNSECURED INPUT Enter security code to secure counter Codes OUTPUT Count CAL SEC STAT ON Code SECURE the device OUTPUT Count CAL SEC STAT verify it is SECURED ENTER Count Device_secure IF Device_secure 0 THEN On operator error loop PRINT Wrong code try again GOSUB Read_errors END IF END WHILE RETURN j Store_cal Routine collects the calibration data OUTPUT Count CAL DATA Ask for calibration data ENTER Count USING 4A Head1 S Collect the data Store Headl and ENTER Count USING K Cal_data S Cal_data S on a disk as your backup RETURN 3 70 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Perform a Time Interval Calibration HP BASIC Continued 910 Cal_quick Calibrates using the QUICK TI calibration 920 PRINT Connect square wave signal to Channel 1 930 GOSUB Wait_for_input 940 PRINT Recalibrating 950 OUTPUT Count DIAG CAL TINT QUICK 960 OUTPUT Count DIAG CAL STATUS
125. To Set the HP IB Mode and Address for instructions on how to set an HP IB address from the front panel e Talk only In this mode the Counter can send data to a printer It cannot receive commands or setups from the computer To select the talk only operating mode set the Counter s HP IB mode to TALK Refer to the following section titled To Set the HP IB Mode and Address for instructions on how to set the talk only mode from the front panel When the Counter is shipped from the factory it is configured as addressed talk listen with the address set to 3 To Set the HP IB Mode and Address Press and hold Recall Utility key then cycle POWER Press Recall Utility key until HP IB is displayed To best demonstrate how to set the address let s assume that HP IB 3 is currently being displayed 3 4 Programming Guide NOTE 3a 3b Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To set the address to 15 perform the following a e Press key HP IB 03 is displayed Note that 0 digit appears and is highlighted indicating that this digit will change when the d orf arrow key is pressed Press 1 key HP IB 13 is displayed Press key HP IB 13 is displayed but now the 3 digit is highlighted indicating that this digit will change when the 1 orf arrow key is pressed Press 1 key twice or until 15 is displaye
126. Totalize on channel 1 Voltage Maximum on channel 1 or 2 Voltage Minimum on channel 1 or 2 Voltage Peak to Peak on Channel 1 or 2 Subtree Controls the phase measuring capabilities of the instrument Subtree Subtree Synchronizes Phase start arm with events Sets the slope of the external start arm signal used in external arming phase measurements Only applies when SENS PHAS ARM STAR SOUR EXT is selected Sets the start arm for phase ROSCillator measurements EXTernal Subtree Controls the Reference CHECk ON OFF ONCE OSCillator Subtree Set the enable for checking the validity and presence of the external reference Query only Returns the frequency value of the external reference oscillator FREQuency lFor HP 53131A firmware revision s below 3335 only Ratio 1 to 2 and Ratio 1 to 3 were offered 2 34 Programming Guide SENSe Cont ROSCillator Cont SOURce AUTO TINTerval ARM HP 53131A and HP 53132A with S N prefix below 3646 STARt SLOPe SOURce STOP SOURce TIMer TOTalize ARM STARt SLOPe SOURce Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2 HP 53131A 132A SCPI Command Summary Continued New INTernal EXTernal lt Boolean gt See Table 2 2A on page 2 38 for HP 53132A with S N 3646 and above TINTerval ARM commands POSitive NEGative IMMediate EXTernal IMMediate TIMer lt numeric_
127. UT LET IS NOT SUFFICIENT PROTECTION Wherever it is likely that the protection has been impaired the instrument must be made inoperative and be secured against any unintended operation If this instrument is to be energized via an autotransformer for voltage reduction make sure the common terminal is connected to the earthed pole terminal neutral of the power source Instructions for adjustments while covers are removed and for servicing are for use by service trained personnel only To avoid dangerous electric shock do not perform such adjustments or servicing unless qualified to do so For continued protection against fire replace the line fuse s only with 250V fuse s of the same current rating and type for example normal blow time delay Do not use repaired fuses or short circuited fuseholders Acoustic Noise Emissions LpA 27 dB at operator position at normal operation tested per EN 27779 All data are the results from type test Geriuschemission LpA 27 dB am Arbeits platz normaler Betrieb gepr ft nach EN 27779 Die Angagen beruhen auf Ergebnissen von Typenpr fungen Manual Part Number 53131 90044 Printed in U S A NOVEMBER 1996
128. UT Count RST Reset the counter 130 OUTPUT Count CLS Clear event registers and error queue 140 OUTPUT Count SRE 0 Clear service request enable register 150 OUTPUT Count ESE 0 Clear event status enable register 160 OUTPUT Count STAT PRES Preset enable registers and 170 transition filters for Operation and 180 Questionable status structures 190 OUTPUT Count FUNC PER 1 Measure period on channel 1 200 Note that the function selected must be a quoted string 210 The actual string sent to the counter is PER 1 220 230 OUTPUT Count FREQ ARM STAR SOUR IMM These two lines enable 240 OUTPUT Count FREQ ARM STOP SOUR IMM Automatic arming 250 l 260 OUTPUT Count CALC2 LIM STAT ON Enable limit testing 270 OUTPUT Count CALC2 LIM DISP GRAP Show the analog limit graph 280 OUTPUT Count CALC2 LIM LOWER Lower Set lower limit to 500 ns 290 OUTPUT Count CALC2 LIM UPPER Upper Set upper limit to 1 us 300 OUTPUT Count INIT AUTO ON Stop when out of limit 310 OUTPUT Count STAT QUES ENAB 1024 1024 is out of limit bit 320 OUTPUT Count SRE 8 Enable SRO on questionable 330 data register event 340 ON INTR 7 GOTO Out_of_limits If SRQ goto out_of_limits 350 ENABLE INTR 7 2 Enable the interrupt 360 OUTPUT Count INIT CONT ON Start making measurements 370 Loop_here GOTO Loop_here Loop while in limits 380 390 Out_of_limits Here because SRQ line
129. When ASCii format is used numeric data is transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range from 1 to 15 depending on the measurement resolution e If no valid results exists Not a Number 9 91E37 is returned and error 230 is generated e If FETCh is executed while an automatically armed Totalize measurement is in progress Not a Number 9 91E37 is returned and error 221 is generated ABORt should be used to terminate the measurement and avoid this error Programming Guide 4 55 Comments Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ e Refer to the sub section in this chapter titled Descriptions of the Measurement Functions for descriptions of each measurement function e Refer to Table 4 1 in this section for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions MEASure SCALar lt function gt lt parameters gt lt source_list gt Query Response Comments This query provides a complete measurement sequence configuration measurement initiation and query for result It is used when the generic measurement is acceptable and fine adjustment of Counter settings is unnecessary Parameters other than lt source_list gt may be defaulted from the right by omitting them or anywhere by substituting the keyword DEFault The lt source_list gt parameter may be
130. a negative TRUE to FALSE transition of the corresponding bit in the Questionable Data Condition Status Register generates the corresponding event in the Questionable Data Event Status Register The range of the lt non decimal numeric gt or lt NRf gt parameter is 0 to 65 535 Numeric data transferred as ASCII bytes in lt NR1 gt format e At power on and STAT PRES the negative transition filter is preset such that each bit is a 0 FALSE e This value is unaffected by RST and save recall 42 Programming Guide Chapter 4 Command Reference Introduction STATus QUEStionable PTRansition lt non decimal numeric gt lt NRf gt Sets or queries the positive transition filter for the Questionable Data status reporting structure The parameter and query response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the positive transition filter The value of unused bits is zero when queried and 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 Questionable Data Condition Status Register generates the corresponding event in the Questionable Data Event Status Register Range The range of the lt non decimal numeric gt or lt NRf gt parameter is 0 to 65 535 Query Response Numeric data transferred as ASCII bytes in lt NR1 gt format Comments e At power on and STAT PRES t
131. affected by power on save recall and RST Scale amp Offset POWER Calibration Menu CALibration SECurity STATe lt Boolean gt lt NRf gt lt NRf gt Range lt NRf gt Resolution Query Response Sets and queries the calibration security state To unsecure for calibration specify OFF with the present security code When the Counter is unsecure any calibration can be performed To secure against calibration specify ON with the present security code When the Counter is secure no calibration can or will be performed except for interpolator calibration 0 to 9999999 1 e Single ASCII encoded byte 0 or 1 e A value of 0 indicates the Counter is unsecure a value of 1 indicates the Counter is secure 4280 Programming Guide Chapter 4 Command Reference Introduction e The calibration state is stored in non volatile memory and is unaffected by power on save recall and RST Comments e The security code is set to 53131 or 53132 depending on which model you have when the Counter is shipped from the factory If you forget your security code you can reset the security code to the model number default by resetting all of the non volatile memory to a default state See the Assembly Level Service Guide for more information Related Scale amp Offset POWER Calibration Menu Front Panel Keys Programming Guide 4 29 Chapter 4 Command Reference CONFigure Subsystem CONFigure Subsystem Refer t
132. aibbiobits to FST summary bE bo the Stabs Byte ator See Note 4 Leothe faloning STATCPERPTR ISTATCPERNTR i6 This arabk tho ivo trandition of thre Thess wer te to abaa summan bit bo Ihe Stabe Byte ator Lee the roong BSE 0 The erties ory of the awida raar Be Raa T SooNcte NOTES 4 Allof theemble commands wed onthis mabe dl cf the adive bis for each event raga ber and ine Stabs ber YOu do nat here ib erabi all bita Resd tho description of oa ch negiater bo determine which Lbothe rooming tits you wart bo errabia STAT QUES EMAB 277 Z AGRiond anayasa shoud boperfarmed if mare tran orm bt is set Tris enables ary of tho svedatio bas bo bo a summary bitte the Stabs Byte Pegeter 200 Nate 1 Go w sheet 2 of2 Figure 3 10 Status Reporting Flowchart 1 of 2 Programming Guide 3 41 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter for Status Reporting From sheet i of 2 TFE 246 Tre ones ory o ite owibtic b bogemerste the FOSMES b bo St NS in Ine Stabu Bate te andsenden SAQ inba to ho Computer Soc Neto 4 Erabi OPC biter Evert Stabe Pegg ator OFC Aiat the Counter furedtion Pat YoU Went bomorsta For sx anpls Lise the tdlow ing INT The ritate the saabad Inwsuremert So i Vite 4 subroutineho detemine whch GS in the Status Bate Fegobe ore st Initiale the Courier Artia that you want to moni
133. ake sure EOI enabled CALL IOCLEAR source amp Clear the counter and interface CALL sendhp RST Reset counter CALL sendhp 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 Preset enable registers and transition filters for operation and questionable status structures CALL sendhp func CHR 34 FREQ 1 CHRS 34 Measure frequency CALL sendhp FREQ ARM STAR SOUR IMM These 3 lines enable using CALL sendhp FREQ ARM STOP SOUR TIM time arming with a 0 1 second CALL sendhp FREQ ARM STOP TIM 1 gate time CLS Clear computer screen FOR i 1 TO samples CALL sendhp READ FREQ Initiate a measurement and get the result CALL IOENTERS source amp freqs i 23 actf Read the ASCII characters PRINT Frequency i freqs i NEXT i END SUB sendhp code CALL iooutputs source code LI END SUB Gl N code S Programming Guide 3 77 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Perform Limit Testing QuickBASIC indefinitely until an out of limit is set to 1 us and the ower This program sets up the counter to make period measurements limits measurement occurs limit The upper is set to 5
134. alibration Routine in Chapter 2 of the Operating Guide for details involved in providing the calibration signals The Operating Guide also discusses the difference between this calibration and the alternate simpler choice DIAG CAL TINT QUICk The command DIAG CAL TINT FINE1 invokes the first step of the calibration DIAG CAL TINT FINE2 invokes the second and so on Each step corresponds to the calibration signals produced by each of the four numbered buttons on the HP 59992A J06 Time Interval Calibrator This is a four step calibration all four steps must be successfully completed in sequence starting with step one and ending with step four To restart the calibration from step one power cycle the Counter A good precaution is to use an HP IB program see the programming example titled To Read and Store Calibration Data in Chapter 3 of the Programming Guide to read and store the calibration factors prior to initiating any calibration s e No query e The calibration values are stored in non volatile memory and are unaffected by power on save recall and RST e Use DIAG CAL STAT to check for successful calibration after all four steps have been completed e Note early versions of the Counter do not support these commands Scale amp Offset POWER Calibration Menu Programming Guide 4 35 Chapter 4 Command Reference DIAGnostic Subsystem DIAGnostic CALibration TINTerval QUICk Comments Related F
135. all Chapter 4 Command Reference STATus Subsystem STATus QUEStionable EVENt Query Response Queries the status of the Questionable Data Event Status Register The Questionable Data Event Status Register captures changes in conditions by having each event bit correspond to a specific condition bit in the Questionable Data Condition Status Register An event becomes TRUE when the associated condition makes the transition specified by the transition filters The event 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 The Questionable Data Event Status Register is cleared by CLS by SSTAT QUES EVEN and at power on e Numeric data transferred as ASCII bytes in lt NR1 gt format e Range is 0 to 65 535 e The query response value is an integer formed by the binary weighting of bits The value of unused bits is zero STATus QUEStionable NTRansition Range Query Response Comments lt non decimal numeric gt lt NRf gt Sets or the negative transition filter for the Questionable Data status reporting structure The parameter and query response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the negative transition filter The value of unused bits is zero when queried and ignored when set A TRUE bit in the negative transition filter specifies that
136. alltime Duty Cycle and Pulse Width SENSe TINTerval ARM ESTART LAYer 1 SOURce Query Response Comments Related Front Panel Keys IMMediate TiMer INTernal 1 Sets or queries the start arm delay for Time Interval measurements A sequence of ASCII encoded bytes IMM or TIM or INT 1 e 6 RST IMMediate e The SENS TINT ARM ESTART LA Yer 1 SOUR command has no affect on the following measurements Risetime Falltime Duty Cycle and Pulse Width Gate amp ExtArm SENSe TINTerval ARM ESTART LAYer 1 TiIMer lt numeric_value gt Range lt numeric_value gt Resolution Query Response Comments Related Front Panel Keys lt numeric_value gt S Sets or queries the time used to delay the start arm for Time Interval measurements 100E 9 to 0 999 999 9 seconds 100E 9 seconds Numeric data transferred as ASCII bytes in lt NR1 gt format e RST 100E 9 seconds e Only applies when SENS TINT ARM ESTARTT LA Yer 1 SOUR TIM is selected e The SENS TINT ARM ESTARTT LA Yer 1 TIM command has no affect on the following measurements Risetime Falltime Duty Cycle and Pulse Width Gate amp ExtArm Programming Guide 4 101 Chapter 4 Command Reference SENSe Subsystem SENSe TINTerval ARM ESTOP LAYer2 SLOPe POSitive Query Response Comments Related Front Panel Keys NEGative Sets or queries the slope of the external stop arm signal used in external arming tim
137. alue has been rounded However using the front panel Enter key while this value is displayed will update the actual value to the displayed rounded value Related Scale amp Offset Front Panel Keys 41200 Programming Guide Chapter 4 Command Reference Introduction TRIGger Subsystem This subsystem enables synchronization of instrument actions with specified internal or external events TRIGger COUNt AUTO lt Boolean gt Query Response Comments Related Front Panel Keys Sets or queries the control over the number of measurements made when INITiate IMMediate is performed When TRIG COUN AUTO is OFF then INIT IMM initiates a single measurement When TRIG COUN AUTO is ON and SENS FUNC ON is not Totalize or Voltage Peak function then e when statistics are enabled CALC3 AVER STAT is ON INIT IMM will initiate a complete block of N CALC3 AVER COUN valid measurements e when statistics are enabled CALC3 AVER STAT is ON and limit filtering is enabled CALC3 LFIL STAT is ON INIT IMM will initiate a complete block of N CALC3 AVER COUN valid in limit measurements e when statistics are disabled CALC3 AVER STAT is OFF INIT IMM initiates a single measurement e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON e 6 RST OFF e The TRIG COUN AUTO setting has no affect on the operation of INIT CONT ON which always behav
138. and 3402 RST sets up 100 meaning maximum sensitivity For current firmware revision RST sets up 0 meaning minimum hysteresis Programming Guide 0 2A Chapter 2 Command Summary RST Response Table 2 3A HP 53131A and HP 53132A With S N Prefix Below 3646 Time Interval RST State Command Header SENSe TINTerval ARM STARt SLOPe SENSe TINTerval ARM STARt SOURce SENSe TINTerval ARM STOP SOURce SENSe TINTerval ARM STOP TIMer POSitive NEGative IMMediate EXTernal IMMediate TIMer lt numeric_value gt S POSitive IMMediate IMMediate 10E 3 S Table 2 3B HP 53132A S N 3646 and above Time Interval RST State Command Header SENSe TINTerval ARM ESTART LAYer2 SLOPe SENSe TINTerval ARM ESTART LAYer2 SOURce SENSe TINTerval ARM ESTART LAYer1 ECOunt SENSe TINTerval ARM ESTART LA Yer 1 SOURc e SENSe TINTerval ARM ESTART LAYer 1 TIMer SENSe TINTerval ARM ESTOP LAYer2 SLOPe SENSe TINTerval ARM ESTOP LAYer 2 SOURce SENSe TINTerval ARM ESTOP LAYer 1 ECOunt SENSe TINTerval ARM ESTOP LAYer 1 SOURce SENSe TINTerval ARM ESTOP LAYer 1 TIMer SENSe TINTerval ARM STARt SLOPe SENSe TINTerval ARM STARt SOURce SENSe TINTerval ARM STOP SOURce SENSe TINTerval ARM STOP TIMer 2 42 POSitive NEGative IMMediate EXTernal lt numeric_value gt IMMediate TIMer INTernal 1 lt numeric_value gt POSitive NEGative IMMedi
139. and READ commands The CONF and READ allow more flexibility than the MEAS query a measurement Additional commands can then be issued to fine tune the measurement setup The READ In the following example a frequency measurement is configured then as an example for changing the setup the counter is programmed for a trigger level of 50 mV The CONF command tells the counter to use the AUTO the data is read using the READ command ng CONF FREQ 1 and READ Configure for frequency measurement 05 Set trigger level to 50 mV Ask for data to read frequency and period en down into INIT and FETCH providing lity By using FETCH you can retrieve ired data For example period can be 540 7 550 4 560 570 CONF can be used to configur S60 590 command than reads the result 600 610 created by the CONF command 620 630 trigger level mode Finally 640 PRINT 650 PRINT Frequency measured usi 660 OUTPUT Count CONF FREQ 1 670 OUTPUT Count EVENT1 LEVEL 680 OUTPUT Count READ 690 ENTER Count Freqg 700 PRINT 710 PRINT Frequency Freq 720 PRINT 730 RETURN 740 750 760 Init_fetc Use INIT and FETCH 770 The READ command can be brok 780 even more
140. and Reference SENSe Subsystem e Execution of the command that is explicitly selecting internal or external timebase sets SENS ROSC SOUR AUTO to OFF e The query can be used to determine the current reference timebase when SENS ROSC SOUR AUTO is ON That is the query response will indicate which timebase internal or external has automatically been selected e This value is unaffected by save recall Utility POWER SENSe ROSCillator SOURce AUTO lt Boolean gt Query Response Comments Related Front Panel Keys Sets or queries the enable for automatically selecting a reference timebase When AUTO is ON the Counter will automatically select the external reference signal as the reference timebase when a valid signal 1 5 or 10 MHz is present at the Ref In rear panel connector Note that the HP 53132A only accepts 10 MHz The internal timebase is used when an invalid signal is present at this connector When AUTO is OFF the reference timebase is selected with SENS ROSC SOUR e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON e RST ON e Explicitly selecting a reference oscillator with SENS ROSC SOUR INTIEXT sets AUTO to OFF e This value is unaffected by save recall Utility POWER 494 Programming Guide Chapter 4 Command Reference Introduction SENSe TINTerval Subtree HP 53131A and HP 53132A With S N Prefix Below 3646 This subtree co
141. arity of the channel Sets the parity scheme Query only Queries the oldest error in the Error Queue and removes the error from the queue first in first out Simulates the pressing of a front panel key Query only Returns a comma separated list of integers representing all of the entries in the Key Queue Query only Returns the SCPI version number with which the Counter complies Subsystem Query only Returns list of intrinsic constants Sets the offset value Sets the scale value Queries the offset value Queries the scale value Subsystem Subtree Controls the number of measurements to be made when INIT IMM is performed 2 37 SENSe Cont TINTerval ARM ESTART LAYer2 SLOPe SOURce LAYer 1 ECOunt SOURce TIMer ESTOP LAYer2 SLOPe SOURce LAYer 1 ECOunt Chapter 2 Command Summary HP 53131A 132A Command Summary Table 2 2A HP 53132A S N Prefix 3646 and Above Time Interval Arming SCPI Command Summary New POSitive NEGative IMMediate EXTernal lt numeric_value gt IMMediate TIMer INTernal 1 lt numeric_value gt POSitive NEGative IMMediate EXTernal lt numeric_value gt 2 38 Subtree Controls the time interval including Time Interval Rise Time Fall Time Dutycycle and Pulse Width functions measuring capabilities of the instrument Subtree Synchronizes the time interval start and stop arm with eve
142. arks Programming Guide 4 131 Chapter 4 Command Reference OPC Operation Complete Command OPC Operation Complete Command OPC This event command enables the OPC bit bit 0 in the Standard Event Status Register to be set upon the transition of the measurement cycle from measuring to idle Note For HP 53131A 132A with serial number prefix 3646 and above If the measurement cycle is already idle this command will immediately set the OPC bit See the section titled Standard Event Status Register Group page 3 24 in Chapter 3 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 Device Clear page 4 31 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 page 3 48 in Chapter 3 for an example using this command 41320 Programming Guide Chapter 4 Command Reference Introduction OPC Operation Complete Query OPC Query Response NOTE This query produces a response upon the transition of the measurement cycle from measuring to idle This allows synchronization between a controller and the instrument using the MAV bit in the Status Byte Register or a read of the Output Queue Note that this query does not actually read a state as most queries do
143. at a syntactically legal macro label in the DMC command could not be executed because the macro label was already defined see IEEE 488 2 Indicates that a syntactically legal macro label in the GMC query could not be executed because the header was not previously defined This is the generic device dependent error Indicates that a system error occurred Indicates that the Counter has detected that insufficient memory is available For example this error will eventually occur on a DMC once the macro memory is filled with previously defined macros Indicates at least one failure occurred when TST was executed Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Power on self test detected this hardware failure Indicates that there is no room in the error queue and an error occurred but was not recorded Programming Guide 5 9 Chapter 5 Errors Error Types Table 5 2 Errors Continued Query error Query INTERRUPTED Query UNTERMINATED Query DEADLOCKED Query UNTERMINATED after indefinite response Offset
144. at that is currently defined FORMat DATA in the box To query the scale use the following command TRACE SCALE Then enter the data keeping in mind how it will be formatted ASCII or REAL Programming Guide 3 51 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter to Define Macros How to Program the Counter to Define Macros A macro is a user defined command that can be used to replace one or many Counter commands There are two good reasons to use macros in place of other commands 1 They provide a mnemonic for long or complex commands 2 They reduce the overhead associated with sending long commands For example if you often want the Counter to display the limit graph you can replace the following string of commands with a macro called limitresult you can provide any name you wish DISP MENU OFF DISP TEXT FEED CALC2 gt CALC2 LIM STATE ON CALC2 LIM DISP GRAPH Anytime you wanted to display the limit graph you would just send the command limitresult To assign the macro limitresult to the above command sequence you would send the following DMC limitresult 280 DISP MENU OFF DISP TEXT FEED CALC2 CALC2 LIM STATE ON CALC2 LIM DISP GRAPH The 2 indicates that the next two characters contain the length of the command in this example 80 characters To program a macro you need to know the length of characters in the com
145. ate TIMer lt numeric_value gt IMMediate TIMer INTernal2 lt numeric_value gt POSitive NEGative IMMediate EXTernal IMMediate TIMer lt numeric_value gt Programming Guide POSitive IMMediate 1 IMMediate 0 1us POSitive IMMediate 1 IMMediate 0 1us POSitive IMMediate IMMediate 0 1us Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 4 Unaffected by RST ESE OPC SRE WAI CALibration COUNt CALibration DATA CALibration SECurity CODE CALibration SECurity STATe DISPlay W INDow TEXT RADix STATus OPERation ENABle STATus OPERation NTRansition STATus OPERation PT Ransition STATus QUEStionable ENABle STATus QUEStionable NT Ransition STATus QUEStionable PTRansition SYSTem COMMunicate SERial CONTrol DTR SYSTem COMMunicate SERial T RANsmit BAUD SYSTem COMMunicate SERial T RANsmit PACE SYSTem COMMunicate SE Rial T RANsmit PARity T YPE SYSTem ERRor Error Queue HP IB Address Programming Guide 2 43 Chapter 2 Command Summary RST Response 2 44 Programming Guide Programming Your Universal Counter for Remote Operation Chapter 3 Programming Your Universal Counter for Remote Operation Introduction Introduction This chapter provides remote operation setup and programming information that helps you operate the Counter as a remote device Chapter Summary e Configuring the HP IB pg 3 4 e Overview of Command Types and Formats
146. ation and questionable status structures CALL sendhp FUNC CHRS 34 PER 1 CHRS 34 Measure period The function must be a quoted string The actual string sent to the counter is PER 1 CALL sendhp FREQ ARM STAR SOUR IMM These 2 lines enable using CALL sendhp FREQ ARM STOP SOUR IMM automatic arming CALL sendhp CALC2 LIM STAT ON Enable limit testing CALL sendhp CALC2 LIM DISP GRAP Show the analog limit graph CALL sendhp CALC2 LIM LOWER STRS lower Set lower limit CALL sendhp CALC2 LIM UPPER STRS upper Set upper limit CALL sendhp INIT AUTO ON Stop when out of limit CALL sendhp SRE 8 Enable SRO on questionable data register event CALL sendhp STAT QUES ENAB 1024 1024 is out of limit bit 3 78 Programming Guide the maximum number Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Perform Limit Testing QuickBASIC Continued ON PEN GOSUB limitfail When SRO happens go get out of PEN ON limit result CALL IOPEN isc amp priority CALL sendhp INIT CONT ON Set counter to run PRINT Making Period measurements Loophere Wait here until out of limit IF complete THEN GOTO endprogram If already serviced out of limit GOTO Loophere then end program limitfail complete 1 Test bit CALL IOSPOLL source amp statusbyte Check status byte Should b
147. atistics Query only Returns the current number of data values collected thus far Enables disables statistics post processing Note that this setting must be enabled for any of the other CALC3 settings to be used Selects which statistic will be in CALC3 DATA and on the front panel display Query only Returns statistic result specified by CALC3 AVER TYPE Sets the data flow to be fed into the CALCulate3 block Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2 HP 53131A 132A SCPI Command Summary Continued New CALCulate3 Cont LFILter Subtree Limit FlLter for statistics LOWer Subtree DATA lt numeric_value gt HZ S Sets the statistics filter lower limit DEG STATe lt Boolean gt Sets the statistics filter enable UPPer Subtree DATA lt numeric_value gt HZ S Sets the statistics filter upper limit DEG PATH Query only Returns LFIL AVER CALibration Subsystem ALL Query only Causes an internal interpolator self calibration COUNt Query only Returns value indicating number of times the Counter has been calibrated DATA lt arbitrary block gt Transfers the calibration data input gain input offset reference oscillator and time SECurity interval CODE lt NRf gt No query Sets the calibration security code STATe lt Boolean gt lt NRf gt Enables or prevents calibration of the Counter Query returns security status 0 unsecu
148. atistics filter enable When set to ON only measurements scaled and offset if math is enabled which are within the filter limits are combined into the statistics processing When set to OFF all measurements whether they are within or without the filter limits are combined into the statistics processing e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of indicates ON RST OFF Stats CALCulate3 LFiLter UPPer DATA lt numeric_value gt HZ S DEG Sets or queries the statistics filter upper limit If limit filtering is enabled CALC3 LFIL STAT ON any measurements above this value will not be combined into the statistics computation If math is enabled CALC MATH STATe ON the limit value specified should take into account that the filtering is on measurements that have been scaled and offset 42400 2 Programming Guide lt numeric_value gt Range lt numeric_value gt Resolution Query Response Comments Chapter 4 Command Reference Introduction 9 9999990000E 12 to 1 0000000000E 13 0 0000000000 1 0000000000E 13 to 9 9999990000E 12 11 digits Numeric data transferred as ASCII bytes in lt NR3 gt format with eleven significant digits RST 0 0000000000 This command couples CALC2 LIM UPP to the same value Updating the upper limit value causes the limit counts CALC2 LIM FCO CALC2 LIM PCO to be cleared The front panel menu item is not always able t
149. ave INIT CONT unaffected when the limit test fails The AUTO ON capability is only meaningful when the Counter is limit testing CALC2 LIM STAT is ON and INIT CONT is ON e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON RST OFF Limit Modes INITiate CONTinuous lt Boolean gt Query Response Sets or queries the enable for continuously initiated measurements With CONTinuous set to OFF no measurements are made until CONTinuous is set to ON or INITiate MMediate 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 e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON 44400 Programming Guide Comments Chapter 4 Command Reference Introduction e RST OFF e When the INIT CONT ON command is sent the Counter invalidates the statistics results clears the statistics current count to 0 reports the negative status condition NOT Computing Statistics to bit 8 of Operation Status Register e When CALC2 LIM CLE AUTO is ON the Counter performs the following whenever the INIT CONT ON command is sent invalidates the limit data clears CALC2 LIM FAIL CALC2 LIM FCOunt and CALC2 LIM PCOunt information turns off the front panel display s Limit annunciator an
150. ax 3 14 program the Counter for math limit operations 3 49 program the Counter for status reporting 3 38 program the Counter to define macros 3 52 program the Counter to display results 3 43 Program the Counter to Synchronize Measurements 3 46 programming examples 3 58 programming for display results 3 43 macros 3 52 math limit operations 3 49 status reporting 3 38 synchronizing measurements 3 46 Programming Guide Contents 1 9 programs examples 3 59 writing SCPI reference flowchart 3 55 pulse width 4 96 Q QSB 3 22 query 3 12 3 16 query error 5 6 query parameters lt numeric value gt 3 12 MAXimum 3 12 MINimum 3 12 questionable data signal status register group 3 27 3 32 4 110 queue error 5 2 key 4 117 output 4 133 QuickBASIC using 3 59 QYE 3 24 R radix 3 17 ratio 4 89 ratio frequency 4 65 reading an error 5 2 REAL 4 41 Index 4 recall 4 136 reference oscillator calibration 4 34 reference oscillator 4 92 Related Documentation 1 10 remote 3 6 reset 4 137 response message syntax 3 16 response messages 3 16 data types 3 17 results display 4 38 math 4 7 query 4 7 4 14 4 19 raw 4 38 statistics 4 19 revision current firmware 2 32 4 81 firmware 1 3 2 31 2 34 4 130 prior firmware 3317 3335 and 3402 2 32 revisions prior 3317 3335 and 3402 4 81 rise time 4 71 4 89 4 96 RQS MSS 3 22 3 23 RS 232 4 43 RS 232 connector 4 114 RS
151. calibration on channel 1 failed Offset calibration on channel 2 failed Gain calibration on channel 1 failed Gain calibration on channel 2 failed Interpolator calibration failed Oscillator calibration failed Time interval calibration failed Measurement hardware calibration failed Measurement interpolator calibration failed No valid external timebase External timebase failed during measurement Recall setup failed hardware failure Recall setup failed empty register Save setup failed EEPROM failed 5 10 This is the generic query error Indicates that a condition causing an INTERRUPTED Query error occurred For example a query followed by DAB or GET before a response was completely sent 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 Indicates that a condition causing a DEADLOCKED Query error occurred For example both input buffer and output buffer are full and the Counter cannot continue Indicates that a query was received in the same program message after a query requesting an indefinite response for example IDN or OPT was executed DIAGnostic CALibration INP OFFS AUTO ONCE failed DIAGnostic CALibration INP2 OFFS AUTO ONCE failed DIAGnostic CALibration INP GAIN AUTO ONCE failed DIAGnostic CALibration INP2 GAIN AUTO ONCE failed DIAGnostic CALibration INT erpolator AUTO ONCE CAL
152. ce _list gt VOLTage DCYCle lt reference gt 1 or VOLTage PDUTycycle VOLTage FALL TIME lt lower_reference gt upper_reference gt 1 or VOLTage FTIMe lt expected_value gt lt resolution gt 1 2 3 VOLTage F REQuency RATio lt expected_value gt lt resolution gt 1 2 3 2 3 1 EvOLTagel MAXimum TCA EVOLTagel MINimum P KAI VOLTage NWIDth VOLTapePTPoa vOLTage PWID VOLTage RISE TIME lt lower_reference gt upper_reference gt 1 or VOLTage RTIMe VOLTage TINTerval po 2 VOLTage TOTalize CONTinuous ss i s sSSsSYCiA aaa ine en 1 1 2 3 VOLTage PHASe Ooo i Oa S SE ef 2 1 The only functions which can be derived using FETC or READ from the stored data are period to from frequency maximum to from minimum maximum to from peak to peak and minimum to from peak to peak All other functions require an acquisition of a new type lt source_list gt has the same syntax as SCPI lt channel _list gt syntax For example a single channel function e g frequency period etc would use 1 to specify channel 1 where as a two channel function e g time interval phase and frequency ratio would use 1 2 to specify a measurement between channel 1 and channel 2 This lt function gt is only allowed with CONFigure Programm
153. ckard Company Test and Measurement Organization 5301 Stevens Creek Blvd Bldg 51L SC Santa Clara CA 95052 8059 1 800 452 4844 In Europe Africa and Middle East please call your local HP sales office or representative Austria East Central Europe 1 25000 0 Belgium and Luxembourg 02 778 3417 Denmark 45 99 10 00 Finland 90 88 721 France 1 69 82 65 00 Germany 0180 532 62 33 Ireland 01 284 4633 Israel 03 5380 333 Italy 02 92 122 999 Netherlands 020 547 6669 Norway 22 73 56 00 Portugal 11 301 73 30 South Africa 011 806 1000 Spain 900 123 123 Sweden 08 444 20 00 Switzerland 01 735 7111 Turkey 312 425 83 13 United Kingdom 01344 366 666 For European countries not listed contact Hewlett Packard International Sales Europe Geneva Switzerland Tel 41 22 780 4111 Fax 41 22 780 4770 Printed in U S A Data subject to change Rev 1 96 Continued from front matter Warranty contd For warranty service or repair this product must be returned to a service facility designated by HP Buyer shall prepay shipping charges to HP and HP shall pay shipping charges to return the product to Buyer However Buyer shall pay all shipping charges duties and taxes for products returned to HP from another country HP warrants that its software and firmware designed by HP for use with an instrument will execute its p
154. cond gate time CLEAR SCREEN Clear the computer display FOR I 1 TO Samples Start making measurements OUTPUT Count READ FREQ Start a measurement and fetch the data ENTER Count Freq I Enter the frequency PRINT USING 11A DD 4A 22A 3A Frequency I Freq I Hz NEXT I LOCAL 703 Return counter to local END 3 62 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Perform Limit Testing HP BASIC 10 This program sets up the counter to make period measurements 20 indefinitely until an out of limits measurement occurs 30 The upper limit is 1 usec and the lower limit is 500 nsec 40 If a measurement falls outside of these limits the counter will 50 stop measuring and report the out of limits value to the computer 60 ASCII format is used to preserve resolution 70 Lower 5 00E 7 Lower limit for period 80 Upper 1 E 6 Upper limit for period 90 DIM Result 22 Read out of limit period into Result 100 ASSIGN Count TO 703 Assign I O path for the counter 110 CLEAR 703 Clear the counter and interface 120 OUTP
155. d sets the Limit Detect output to the in limit voltage level e When SENS EVEN LEV ABS AUTO is ON the Counter performs an auto trigger on the measurement channel s whenever the INIT CONT ON command is executed and also at the beginning of each measurement cycle while INIT CONT is ON e The state of TRIG COUN AUTO has no affect on the operation of INIT CONT ON e INIT CONT ON operates as if TRIG COUN was 1 e The commencement of the first measurement due to setting INITiate CONTinuous to ON sets the Pending Operation Flag to true The Pending Operation Flag is set false by aborting of a measurement or by the completion of the last measurement after INITiate CONTinuous is set OFF e With the measurements being made continuously the ABORt command shall abort 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 Programming Guide 4 45 Chapter 4 Command Reference INITiate Subsystem e When a single measurement is in progress INIT 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 e Note that the Counter powers up with INIT CONT set to ON but RST sets INIT CONT to OFF Related Run Front Panel Keys INITiate IMMediate This
156. d HP IB 15 is displayed Go on to step 4 To set the HP IB mode to TALK perform the following a C Press key HP IB 03 is displayed Note that 0 digit appears and is highlighted indicating that this digit will change when the d orf arrow key is pressed Press key until TALK is displayed HP IB TALK is displayed Go on to step 4 Press Enter key BE SURE to press the Enter key to complete the entry The address mode is now stored in non volatile memory and does not change when power is cycled or after a remote interface reset Programming Guide 3 5 Chapter 3 Programming Your Universal Counter for Remote Operation Configuring the HP IB To Connect the Counter to a Computer Connect the Counter to a computer by simply installing an HP IB cable such as an HP 10833A cable between the two units as shown in Figure 3 1 Compute Rear Panel PPL OPEL ELL ELL LIL OL LEI LL ELLIE LOL LPL ERLE LL ED G ve R SHEP EAPEAPEAPEPPREAPERHEAPEAPHEAPEAPEAHEAPHEH Peers COPPELL LP ELE ELE ES SHEP EPAPREPPEAPEAPEAPERPEAPREAEERPFERHEAPHEPRHEP COPEL EELOELO ELE EE EEE EEE ELOEL EEE EEE EEE EEL E A SHEP EAPREPPEAPREPPREAPERPERPREAPHERPEAPERHEAPHER COPED OEP E ELE EL EEE CELE EEEEE CELE EEE EP CELE EE EA C ese CPP EPPEPPEPPEAPEAPERPEAH ES fee PPPS EEL EEL EEL LENG Aff 7 Fes ie Oe iF Edo JOCI P f OAR OEC p ass DOLLIES Fe d ieee PLEAD EPP CPD EDD ED
157. d Reference Introduction HCOPy Subsystem HCOPy CONTinuous lt Boolean gt Enables or disables printing results When HCOPy CONTinuous is enabled HCOP CONT ON the Counter prints each measurement If statistics is enabled CALC3 AVER STAT ON all statistics standard deviation mean minimum and maximum will be printed in addition to the individual measurements If limit testing is enabled CALC2 LIMit STAT ON an indication will be printed for the measurements that fail the limit test Refer to the sections titled Using the Print Menu and To Configure the RS 232 Serial Port for Printing in the Operating Guide for more details on printing Query Response e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON Comments RST OFF Related Save amp Print Front Panel Keys Programming Guide 4 43 Chapter 4 Command Reference INITiate Subsystem INITiate Subsystem This subsystem controls the initiation of a measurement INITiate AUTO lt Boolean gt Query Response Comments Related Front Panel Keys Sets or queries if the Counter should stop measurements or continue measuring go on when a measurement exceeds the user entered limits AUTO ON configures the Counter to automatically stop measuring set INIT CONT to OFF on a limit test failure that is out of limit results are detected AUTO OFF configures the Counter to continue measuring le
158. d as ASCII bytes in lt NR1 gt format e RST 4 e Only applies when SENS FREQ ARM STOP SOUR DIG is selected Gate amp ExtArm SENSe FREQuency ARM STOP SLOPe POSitive NEGative Query Response Comments Related Front Panel Keys Sets or queries the slope of the external stop arm signal used in external arming Frequency Frequency Ratio and Period measurements A sequence of ASCII encoded bytes POS or NEG e RST NEGative e Only applies when SENS FREQ ARM STOP SOUR EXT is selected Gate amp ExtArm 4 86 Programming Guide Chapter 4 Command Reference Introduction SENSe FREQuency ARM STOP SOURCce IMMediate EXTernal Query Response Comments Related Front Panel Keys TiMer DiGits Sets or queries the stop arm for Frequency Frequency Ratio and Period measurements A sequence of ASCII encoded bytes IMM EXT TIM or DIG RST TIMer Gate amp ExtArm SENSe FREQuency ARM STOP TIMer lt numeric_value gt Range lt numeric_value Resolution Query Response Comments Related Front Panel Keys lt numeric_value gt S Sets or queries the gate time used in arming Frequency Frequency Ratio and Period measurements e For short gate time 1E 3 to 99 99E 3 seconds e For long gate time 100E 3 to 1000 000 seconds e For short gate time 0 01E 3 seconds e For long gate time 1E 3 seconds Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant dig
159. d 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 ANSMIEEE Std 488 2 1987 IEEE Standard Codes Formats Protocols and Common Commands document Programming Guide 2 21 Mnemonic DDT lt arbitrary block gt DMC lt string gt lt arbitrary block gt EMC lt NRf gt EMC ESE lt NRf gt ESE ESR GMC lt string gt Chapter 2 Command Summary HP 53131A 132A Command Summary Table 2 1 IEEE 488 2 Common Commands Calibration Clear Status Define Device Trigger Command Define Macro Command Enable Macro Command Enable Macro Query Standard Event Status Enable Standard Event Status Enable Query Event Status Register Query Get Macro Contents Query Identification Query Learn Macro Query Operation Complete Operation Complete Query Causes the Counter to perform an internal interpolator self calibration and returns a response that indicates whether or not the instrument completed the self calibration without error Clears Status data structures Event Registers and Error Queue Defines either INIT FETC READ or nothing to be executed when the Counter receives a GET or TRG command Assigns a sequence of zero or more commands queries to a macro label No query form Enables and d
160. d purge macros There is little error trapping in the programs if you misspell a command the Counter will give an error message 3 54 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Writing SCPI Programs Figure 3 11 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 Programming Guide 3 55 Chapter 3 Programming Your Universal Counter for Remote Operation Writing SCPI Programs Fras ah and indiaize te Souter Sak the input condones bo match your sign Soa Figre See Tapia 4 INP UR To perform otter tunctions To sma Of raca setups Sam Figure 22 area SA V YFEL To corio apd ny ot resus soa setia tithe P ta Courter bo Depay Readienin the c See apia 4 MESIA Saa Eacieet Way to Mae a Mace uram art progaming smpe inthis chapter Tocmbra soa Fi 22 andor Chapter ALG OCkLitesio To ee ca oe 22 angor Topher 4 ded a zaa salon Pied Heavy toP ah the coria bo Defiance PTT AANE etanple To Lite Macros aod 4 DMG FEM Qi LMc IPM zd MAy Configure stabs repcrting Saa Secon lad Status Reporting in this chapter Saa 4 SNTE
161. d 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 the lt numeric value gt sent 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 INP IMP 1 MOHM OUTPUT 703 INP IMP 1E 6 Suffix Elements Suffix elements such as HZ Hertz S seconds V volts OHM Ohms PCT percent and DEG degrees are allowed within this format 3 12 Programming Guide Chapter 3 Programming Your Universal 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 permon WNEWONG nme C a The suffix units MHZ and MOHM are special cases that should not be confused with lt suffix multiplier gt HZ and lt suffix multiplier gt OHM Command Terminator A command may be terminated with a lt new line gt ASCII character decimal 10 an EOI End of Identify asserted concurrent with last byte or an EOI asserted concurrent with a lt new line gt as the last byte Programming Guide 3 13 Chapter 3 Programming Your Universal Counter for Remote Operation Using Multiple Commands Using Multi
162. data transfer on the data acquired by a SENSe function Query only Returns scaled offset measurement result Sets the data flow to be fed into the CALCulate block Event or query causes the Counter to recalculate existing data without re acquiring Enables disables automatic post processing Subtree Subtree Returns the name of the defined equation SCALE_OFFSET Returns the expression equation used for math scale offset processing Sets the name of selected math expression equation Enables disables math scale offset processing Note that this setting must be enabled for any of the other CALC 1 settings to be used Subsystem Performs post acquisition LIMit testing and data transfer Sets the data flow to be fed into the CALCulate2 block Event no query Causes the Counter to recalculate existing data without re acquiring Enables disables automatic post processing Subtree Collects together the commands associated with controlling and getting reports from a single LIMit test Subtree Enables the automatic clearing of limit test results Event no query Clears the limit test results Sets whether the measurement display is numeric or symbolic on a graph Query only Returns a 0 or 1 to indicate if the last tested measurement passed or failed the limit test 0 pass 1 fail 2 25 Chapter 2 Command Summary HP 53131A 132A Command Summary Table 2 2 HP 53131A 132A SCPI Command Summary Continu
163. defaulted by omitting it The default values are specified by the particular function description Issuing this query while a measurement is in progress will result in this query aborting the current measurement before initiating the desired measurement and then waiting for the measurement to complete Consequently this has the effect of holding off further commands from being processed until the desired measurement completes This hold off action can only be canceled by the measurement completing Device Clear or power on e Result will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used numeric data is transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range form 1 to 15 depending on the measurement resolution e Refer to the sub section in this section titled Descriptions of the Measurement Functions for descriptions of each measurement function e Refer to Table 4 1 in this section for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions e This command disables math statistics and limit testing e Ifan absolute trigger level is not specified in the lt parameters gt then when this command executes for functions other than Voltage Peaks maximum minimum peak to peak or Totalize auto trigger is enabled auto trigger level s are set auto trigger is invoked on measu
164. e trigger event for channel 3 input Subtree Query only Returns the channel 3 input trigger level Query only Returns the edge of the channel 3 input that will be considered an event Subtree Controls the frequency frequency ratio and period measuring capabilities of the instrument Subtree Synchronizes the frequency start and stop arm with events Subtree Sets the slope of the external start arm signal used in external arming frequency frequency ratio and period measurements Only applies when SENS FREQ ARM STAR SOUR EXT is selected Sets the start arm for frequency frequency ratio and period measurements Subtree Sets the resolution in terms of digits used in arming frequency frequency ratio and period measurements Only applies when SENS FREQ ARM STOP SOUR DIG is selected Sets the slope of the external stop arm signal used in external arming frequency frequency ratio and period measurements Only applies when SENS FREQ ARM STOP SOUR EXT is selected Sets the stop arm for frequency frequency ratio and period measurements Sets the gate time used in arming frequency frequency ratio and period measurements Only applies when SENS FREQ ARM STOP SOUR TIM is selected Specifies the approximate frequency of a signal you expect to measure at channel 1 2 or 3 Configures Counter to perform a pre measurement step to automatically determine the approximate frequency of the measurement signal s
165. e 72 PRINT Status byte statusbyte CALL sendhp FETCH PERIOD Fetch the out of limits period CALL IOENTERS source amp period 23 actf Read the out of limit period PRINT Out of limits period is period Print results RETURN endprogram END SUB sendhp code CALL iooutputs source code LEN codeS END SUB Programming Guide 3 79 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Measure the Statistics of 50 Measurements QuickBASIC en and return the mean minimum mE i he number of measurements is he counter is put into SINGL a E his program instructs the counter to take 50 period measurements maximum and standard deviation measurement mode programmed using CALC3 AVER COUNT 50 he counter is set up to tak 50 measurements and then stop using the TRIG COUNT AUTO ON command At the end of the 50 measurements the statistics are sent to the computer The data is sent in ASCII format to preserve resolution When the program has completed the statistics will be displayed on the computer and the standard deviation will be displayed on the counter In this example the status reporting structure is used to alert the program that the statistics are ready The OPC and ESE 1 command are used together to generate an output from the Event Status Registe
166. e Range is 0 to 255 e The query response is an integer formed by the binary weighting of the bits The value of unused bit is zero 4428 Programming Guide Chapter 4 Command Reference Introduction GMC lt string gt Get Macro Contents Query GMC lt string gt Queries the current definition of a macro The lt string gt parameter must be a currently defined macro label Query Response e Definite length block e The query response is a lt definite length block gt containing the command query sequence which is executed when the macro label is received e A zero length block response indicates that no command sequence is stored by the specified label Programming Guide 4 129 Chapter 4 Command Reference IDN Identification Query IDN Identification Query IDN Queries the Counter identification Query Response A sequence of ASCII encoded bytes HEWLETT PACKARD 53131A 0 XXXX HEWLETT PACKARD 53132A 0 XXXX terminated with a new line and EOI XXXX represents the firmware date code Comments This query should be the last query in a terminated program message otherwise error 440 is generated 4 130 Programming Guide Chapter 4 Command Reference Introduction LMC Learn Macro Query LMC Queries the currently defined macro labels Query Response e A sequence of one or more strings separated by commas e Ifno macros are defined the response is a null string two consecutive double quote m
167. e commands by the WAI command When the Counter has completed the 50 measurements and statistics it executes the gt CALC3 AVERAGE ALL command which asks for the results 3 46 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands CALC3 AVERAGE ON Enable statistics CALC3 AVERAGE COUNT 50 Base statistics on 50 measurements TRIG COUNT AUTO ON On INIT take 50 measurements INIT Start 50 measurements WAI Wait until 50 measurements are complete before Counter executes another command At this point commands could be issued to other instruments Asks for the statistics This command will gt CALC3 AVERAGE ALL not be executed until the 50th measurement is complete 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 because of the preceding W AI 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 CALC3 AVERAGE ON Enable statistics CALC3 AVERAGE COUNT 50 Base statistics on 50 measurements TRIG COUNT AUTO ON On INIT take 5
168. e controls the Frequency Frequency Ratio and Period measuring capabilities of the instrument SENSe FREQuency ARM Subtree This subtree is used to synchronize the Frequency Frequency Ratio and Period start and stop arm with events The following combination of start stop arming sources are valid STARt SOURce STOP SOURce Front Panel Gating Settings GATE STOP rivets ix owns SENSe FREQuency ARM STARt SLOPe POSitive NEGative Query Response Comments Related Front Panel Keys Sets or queries the slope of the external start arm signal used in external arming Frequency Frequency Ratio and Period measurements A sequence of ASCII encoded bytes POS or NEG e RST POSitive e Only applies when SENS FREQ ARM STAR SOUR EXT is selected Gate amp ExtArm Programming Guide 4 85 Query Response Comments Related Front Panel Keys Chapter 4 Command Reference SENSe Subsystem SENSe FREQuency ARM STARt SOURce IMMediate EXTernal Sets or queries the start arm for Frequency Frequency Ratio and Period measurements A sequence of ASCII encoded bytes IMM or EXT RST IMMediate Gate amp ExtArm SENSe FREQuency ARM STOP DIGits lt numeric_value gt lt numeric_value gt Range Query Response Comments Related Front Panel Keys Sets or queries the resolution in terms of digits used in arming Frequency Period and Ratio measurements 3 to 15 Numeric data transferre
169. e different e Ratio channel selections Ratio 2 to 1 and Ratio 3 to 1 for those counters equipped with Channel 3 are not available e Ratio AUTO armed does not automatically extends gate to capture sufficient edges If Channel 1 input frequency is less than approximately 10 Hz the Ratio gate time is not extended to capture sufficient Channel 1 edges to produce a valid measurement Default gate time is 100 msec which is not long enough to capture two edges on a low frequency signal The user is required to extend the gate by switching to TIME arming and selecting a gate time appropriately long e Sensitivity for firmware revision below does not have adjusted controls to LO and MED sensitivity In some Counters that contained firmware revision 3317 LO sensitivity fails to correctly count very high frequency signals Statistics If your Counter contains other than the current firmware revision s single shot statistics are not available using the ON SINGLE menu item found in the Statistics menu use Stats key HP IB Commands SENSe EVENt 1I2 HYSTeresis RELative If your Counter contains firmware revisions 3402 and below the input hysteresis command and query does not operate in the conventional way That is SENSe EVENt 1I2 HYSTeresis RELative sets high sensitivity when the parameter is MINimum or 0 percent and sets low sensitivity when the parameter is MAXimum or 100 percent In the prior firmware revisions 3
170. e interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measurements A sequence of ASCII encoded bytes POS or NEG e 6 RST POSitive e Only applies when SENS TINT ARM EST OP LAY2 SOUR EXT is selected Gate amp ExtArm SENSe TINTerval ARM ESTOP LAYer2 SOURce IMMediate Query Response Comments Related Front Panel Keys EXTernal Sets or queries the stop arm for time interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measurements A sequence of ASCII encoded bytes IMM or EXT RST IMMediate Gate amp ExtArm SENSe TINTerval ARM ESTOP LAYer 1 ECOunt lt numeric_value gt Range lt numeric_value gt Resolution Query Response Comments lt numeric_value gt Sets or queries the number of events used to delay the st op arm for Time Interval measurements 1 to 99 999 999 Numeric data transferred as ASCII bytes in lt NR1 gt format e RST 1 e Only applies when SENS TINT ARM ESTOP LA Yer 1 SOUR INTernal2 is selected 4 102 Programming Guide Chapter 4 Command Reference Introduction SENSe TINTerval ARM ESTOP LAYer 1 SOURce IMMediate Query Response Comments Related Front Panel Keys TiMer INTernal2 Sets or queries the stop arm for Time Interval measurements A sequence of ASCI encoded bytes IMM or TIM or INT2 e RST IMMediate e The SENS TINT ARM ESTOP LA Yer 1 SOUR c
171. e limits upper limit LE GI Count CALC2 LIM STATE ON Count CALC2 LIM LOWER Lower Count CALC2 LIM UPPER Upper D WEO OD OS here WAITING FOR STATISTICS TO COMPLETE Loop_here la A C w c rat W c K aS uvUutruUvUUuUVUmAHOnROnOHOO Ht Count CALC2 LIM DISP GRAPH Display the limit graph TR 7 GOTO Stats_ready Where to go when statistics ready E INTR 7 2 Enable interrupt on SRQ Waiting for measurement to complete Count INIT CONT ON Set counter to RUN Stats_ready Statistics are ready POLL 703 Serial poll to see if correct bit is set Count INIT CONT OFF Stop making new measurements Count CALC3 AVERAGE TYPE MAX CALC3 DATA Count Maximums Count CALC3 AVERAGE TYPE MIN CALC3 DATA Count Minimums Count CALC3 AVERAGE TYPE MEAN CALC3 DATA Count Mean Count CALC3 AVERAGE TYPE SDEV CALC3 DATA Count Sdevs Serial Poll Result S Should be 192 USING 21A 22A X 8A Minimum Period Minimum seconds USING 21A 22A X 8A Maximum Period Maximum seconds USING 21A 22A X 8A Mean Period Mean seconds USING 21A 22A X 8A Standard Deviati
172. e present to distinguish another root level command For example INP COUP AC INIT CONT OFF is equivalent to sending INP COUP AC 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 INP INIT CONT OFF and generates a syntax error Programming Guide 3 15 Chapter 3 Programming Your Universal 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 HP IB output queue The output message remains in the qu eue until it is read or another command is issued When read the message is transmitted across the HP IB to the computer You read 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 INP COUP 20 ENTER 703 A 30 PRINT A 40 END Response Message Syntax Figure 3 5 shows the simpl
173. easur ement is complete Event Status Register when l l l l l l l l l the program that the sta l l l l l l l l l used as an input to the Service Request Register In order for the Service Request Register to be able to use that input the SRE 32 command must be used This enables the Service Request Register to assert the SRQ line when the measurement is complete Note that the OPC command must be sent prior to every measurement in order to enable the OPC bit See Line 520 INTEGER I Num_meas DIM Sdev 22 Mean 22 Minimum 22 Maximum 22 Num_meas 50 Statistics based on Num_meas measurements ASSIGN Count TO 703 CLEAR 703 Clear the counter and interface OUTPUT Count RST Reset the counter OUTPUT Count CLS Clear event registers and error queue OUTPUT Count SRE 0 Clear service request enable register OUTPUT Count ESE 0 Clear event status enable register OUTPUT Count STAT PRES Preset enable registers and transition filters for operation and questionable status structures OUTPUT Count FUNC PER 1 Measure Period on channel 1 Note that the functions must be a quoted string The actual string
174. ed New CALCulate2 Cont LIMit Cont FCOunt LOW er UPPer TOTal LOW er DATA lt numeric_value gt HZ S DEG STATe lt Boolean gt UPPer DATA lt numeric_value gt HZ S DEG PCOunt TOTal CALCulate3 AVERage ALL CLEar COUNt lt numeric_value gt CURRent ESTATe lt Boolean gt TYPE MAXimum MINimum SDEViation SCALar or MEAN DATA FEED E JCALCulate 1 2 26 Subtree An abbreviation for Fail COunt Query only Returns the number of limit test failures at the lower limit Query only Returns the number of limit test failures at the upper limit Query only Returns the total number of measurements that failed the limit test Subtree Sets lower limit used in limit testing Sets the limit test enable Note that this setting must be enabled for any of the other CALC2 settings can be used Subtree Sets upper limit used in limit testing Subtree An abbreviation for Pass COunt Query only Returns the total number of measurements that passed the limit test Subsystem Performs post acquisition statistics computation and data transfer Subtree Collects together the commands associated with the Statistics capabilities Returns all four Statistics results i e mean standard deviation maximum and minimum Event no query Clears the statistics results and statistics count Selects number of measurements to combine for st
175. ed so that both channels 1 and 2 have auto trigger enabled at 50 with a positive slope The measurement arming is coupled to auto with no delay The input routing is coupled to separate inputs lt source_list gt range 1 2 default 1 2 CONFigure SCALar VOLTage TOTalize CONTinuous 1 Configures the Counter for Totalize with auto arming The trigger settings are coupled so that the measurement channel has auto trigger disabled with a positive slope Use ABORt to terminate the measurement before querying for the totalize result This function continuous totalize also known as automatically armed totalize cannot be used with the MEASure or READ queries The FETCh query without an explicit function specifier will retrieve the result if the measurement has been properly terminated with ABORT lt source_list gt range 1 default 1 Programming Guide 4 73 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage TOTalize TIMed lt gate_time gt 1 Measures Totalize during the specified lt gate time gt The totalize gate mode is set to time and the totalize gate time is defaulted or set to the specified value The trigger settings are coupled so that the measurement channel has auto trigger disabled with a positive slope lt ga
176. ee graph Set lower limit Set upper limit Display limit graph When SRO happens statistics Watch for interrupts go get Set counter to run Wait here until complete If stats received then end Test bit Check status byte Should be 192 Put counter in single 3 83 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Use Limits to Filter Data Before Measuring Stats QuickB ASIC Continued PRINT Status byte statusbyte CALL sendhp CALC3 AVERAGE TYPE MIN CALC3 DATA Ask for all the stats CALL IOENTERS source amp minimum maxelem actual CALL sendhp CALC3 AVERAGE TYPE MAX CALC3 DATA CALL IOENTERS source amp maximum maxelem actual CALL sendhp CALC3 AVERAGE TYPE MEAN CALC3 DATA CALL IOENTERS source amp mean maxelem actual CALL sendhp CALC3 AVERAGE TYPE SDEV CALC3 DATA CALL IOENTERS source amp sdev maxelem actual PRINT PRINT Minimum Period minimum PRINT Maximum Period maximum PRINT Mean Period mean PRINT Standard Deviation sdev RETURN endprogram END SUB sendhp code CALL iooutputs source code LEN codeS END SUB 3 84 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of
177. el 2 50Q 1MQ Channel 2 DC AC Channel 2 X10 Attenuate Channel 2 100kHz Filter Peet il Save amp Print 6 Channel 2 Trigger Sensitivity a 1 to 30 except 18 and 24 e Numeric data transferred as ASCII bytes in lt NR1 gt format e The query returns the key code for the last key pressed A value of 1 indicates the queue last in first out is empty Programming Guide 4 117 Comments Chapter 4 Command Reference SYSTem Subsystem At RST and power on the Key Queue is cleared emptied The Key Queue is unaffected by save recall 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 SYSTem KEY LOG This query returns a comma separated list of integers representing all of the entries in the Key Queue Query Response Numeric data transferred as ASCII bytes in lt NR1 gt format A value of 1 indicates the queue is empty Numbers representing key codes are separated by commas The key codes appear in a last in first out sequence The maximum number of key codes is 500 Each key code has a range of 1 to 30 Comments At RST and power on the Key Queue is cleared emptied e The Key Queue is unaffected by save recall SYSTem VERSion Query Response
178. els are set to the specified or defaulted reference value When the lt reference gt is specified in volts auto trigger is disabled and the absolute trigger levels are set to the specified reference value 4700 Programming Guide Chapter 4 Command Reference Introduction Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage PWIDth lt reference gt 1 Cont lt reference gt percent range 0 to 100 PCT percent resolution 10 voltage range For volts if X1 Attenuation 5 125V to 5 125V For volts if X10 Attenuation 51 25V to 51 25V voltage resolution For volts if X1 Attenuation 005V For volts if X10 Attenuation 05V default 50 PCT lt source_list gt range 1 default 1 MEASure SCALar VOLTage RISE TIME lt lower_reference gt upper_reference gt 1 Measures Rise Time The measurement arming is coupled to auto The Counter uses the lt lower_reference gt and lt upper_reference gt to select the lower and upper points on the rising edge of an input signal applied to channel 1 These reference points can be specified as either a percentage or an absolute voltage The default units are percent The lt lower_reference gt and lt upper_reference gt parameters are used to configure the Channel 1 and Channel 2 trigger settings respectively When a reference is specified as a percentage or defaulted auto trigger is enabled and auto tr
179. ents Sets or queries the data format type Valid types are ASCii and REAL When ASCii type is selected numeric response data is transferred as ASCII bytes in lt NR3 gt format The numbers are separated by commas as specified in IEEE 488 2 To indicate that no response data exists Not a Number 9 91E37 is returned When REAL type is selected response data is transferred in a lt definite length block gt as a 64 bit IEEE 754 floating point number To indicate that no response data exists Not a Number 9 91E37 is returned in the lt definite length block gt A sequence of ASCII encoded bytes ASC or REAL e RST ASCii e This command affects the response format of the following commands CALCulate DATA CALCulate3 DATA FETCh MEASure query READ SENSe DATA TRACe DATA query Programming Guide 0 A Chapter 4 Command Reference Group Execute Trigger GET Group Execute Trigger 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 The device dependent result of this triggering is described in the following paragraph 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 124 4420 0 Programming Guide Chapter 4 Comman
180. er_reference gt and lt upper_reference gt to select the lower and upper points on the falling edge of an input signal applied to channel 1 These reference points can be specified as either a percentage or an absolute voltage The default units are percent The lt lower_reference gt and lt upper_reference gt parameters are used to configure the Channel 1 and Channel 2 trigger settings respectively When a reference is specified as a percentage or defaulted auto trigger is enabled and auto trigger level is set to the specified or defaulted value When a reference is specified in volts auto trigger is disabled and the absolute trigger level is set to the specified value lt lower_reference gt percent range 0 to 100 PCT percent resolution 10 voltage range For volts if X1 Attenuation 5 125V to 5 125V For volts if X10 Attenuation 51 25V to 51 25V voltage resolution For volts if X1 Attenuation 005V For volts if X10 Attenuation 05V default 10 PCT lt upper_reference gt percent range 0 to 100 PCT percent resolution 10 voltage range For volts if X1 Attenuation 5 125V to 5 125V For volts if X10 Attenuation 51 25V to 51 25V voltage resolution For volts if X1 Attenuation 005V For volts if X10 Attenuation 05V default 90 PCT 462 Programming Guide Chapter 4 Command Reference Introduction Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage
181. error 221 is generated Programming Guide 4 15 Comments Chapter 4 Command Reference CALCulate2 Subsystem Query only CALCulate2 LIMit LOWer DATA lt numeric_value gt lt numeric_value gt Range lt numeric_value gt Resolution Query Response Comments Related Front Panel Keys HZ S DEG Sets or queries the lower limit used for limit testing When the result is less than the lower limit a fail is reported when the result is equal to the lower limit a fail is not reported If math is enabled CALC MATH STATe ON the limit value specified should take into account that the limit testing is on measurements that have been scaled and offset 9 9999990000E 12 to 1 0000000000E 13 0 0000000000 1 0000000000E 13 to 9 9999990000E 12 11 digits Numeric data transferred as ASCII bytes in lt NR3 gt format with eleven significant digits e RST 0 0000000000 e This command couples CALC3 LFIL LOW to the same value e Updating the lower limit value causes the limit counts CALC2 LIM FCO CALC2 LIM PCO to be cleared e The front panel menu item is not always able to display all of the significant digits of this value When this is the case the displayed value is different from the actual value in that the displayed value has been rounded However using the front panel Enter key while this value is in the 11 digit display will update the actual value to the displayed rounded value Uppr
182. es as if TRIG COUN is set to 1 Stats Programming Guide 4 121 Chapter 4 Command Reference CAL Calibration Query CAL Calibration Query CAL This query causes an internal interpolator self calibration Query Response e Numeric data transferred as ASCII bytes in lt NR1 gt format e A value of zero indicates the calibration completed without error A value of one indicates the calibration completed with error 41220 Programming Guide Chapter 4 Command Reference Introduction 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 will not clear data memories or any other settings It also 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 are cleared because any new program message after a program message terminator clears the output queue This command will clear any displayed error message from the front panel Programming Guide 4 123 Chapter 4 Command Reference DDT lt arbitrary block gt Define Device Trigger Command DDT lt arbitrary block gt Define Device Trigger Command DDT
183. es the self test was not completed or was completed with errors detected The following are tested CPU ROM RAM EEPROM QSPI FPGA Front End Measurement hardware and Interpolator hardware 444200 Programming Guide Chapter 4 Command Reference Introduction WAI Wait to Continue Command WAI This command prevents the instrument from executing any further commands or queries until the measurement cycle transitions from measuring to idle The only way to cancel this holdoff is by device clear or power on RST and CLS have no affect on WAI operation See the section titled Using the WAI Command page 3 4 6 in Chapter 3 for an example using this command Programming Guide 4 143 Chapter 4 Command Reference WAI Wait to Continue Command 414400 Programming Guide Errors Chapter 5 Errors Introduction Introduction This chapter explains how to read any errors from the Counter discusses the types of errors and provides a table of all of the Counter s errors and their probable causes Displaying Errors When an HP IB error is detected the HP IB XXX message will appear on the front panel display where XXX indicates the error number found in Table 5 2 The front panel error messages are most easily seen if the Counter is in Single INIT CONT OFF or in the menu display mode When the Counter is configured to display measurement results the measurements will ove
184. esting When the result is greater than the upper limit a fail is reported when the result is equal to the upper limit a fail is not reported If math is enabled CALC MATH STATe ON the limit value specified should take into account that the limit testing is on measurements that have been scaled and offset 9 9999990000E 12 to 1 0000000000E 13 0 0000000000 1 0000000000E 13 to 9 9999990000E 12 11 digits Numeric data transferred as ASCII bytes in lt NR3 gt format with eleven significant digits e RST 0 0000000000 e This command couples CALC3 LFIL UPP to the same value e Updating the upper limit value causes the limits counts CALC2 LIM FCO CALC2 LIM PCO to be cleared e The front panel menu item is not always able to display all of the significant digits of this value When this is the case the displayed value is different from the actual value in that the displayed value has been rounded However using the front panel Enter key while this value is in the 11 digit display will update the actual value to the displayed rounded value Uppr amp Lower 4 18 Programming Guide NOTE Chapter 4 Command Reference Introduction CALCulate3 Subsystem This subsystem performs post acquisition statistics computation and data transfer Not until CALCulate3 LFILter STATe is set to ON will any of the CALCulate3 LFILter settings be used Not until CALCulate3 A VERage STATe is set to ON will any of the C
185. eys 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 300 1200 2400 9600 19200 Numeric data transferred as ASCII bytes in lt NR1 gt format This value is stored in non volatile memory It is unaffected by power on save recall and RST Utility POWER SYSTem COMMunicate SERial TRANsmit PACE XON NONE Query Response Comments Related Front Panel Keys Sets or queries the software pacing scheme A sequence of ASCII encoded bytes XON or NONE This value is stored in non volatile memory It is unaffected by power on save recall and RST Utility POWER Programming Guide 4 115 Chapter 4 Command Reference SYSTem Subsystem SYSTem COMMunicate SERial TRANsmit PARity TY PE EVEN ODD NONE Sets or queries the parity scheme Query Response A sequence of ASCII encoded bytes EVEN ODD or NONE Comments e This value is stored in non volatile memory It is unaffected by power on save recall and RST e If parity is enabled the Counter sends receives 7 data bits plus 1 parity bit If parity is disabled the Counter sends receives 8 data bits Related Utility POWER Front Panel Keys SYSTem ERRor Query Response Comments Queries the oldest error in the Error Queue and removes that error from the queue first in first out See page 5 2 in Chapter 5 Errors for detailed error information
186. fault 4 64 value which indicates 4 digits of resolution for the specified lt expected_value gt 100 MHz to 3 00 GHz lt expected_value gt should be within 10 of input frequency for optimum arming configuration 500 MHz value indicates decade corresponding to least significant digit of the result 1E 7 tolE7 Hz value which indicates 3 to 15 digits of resolution for the specified lt expected value gt lt resolution gt should use a mantissa of 1 0 and be an even power of 10 value which indicates 4 digits of resolution for the specified lt expected_value gt 1 1 2 1 3 1 Programming Guide Chapter 4 Command Reference Introduction Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage FREQuency RATio lt expected_value gt lt resolution gt 1 2 1 3 2 1 3 1 Measures Frequency Ratio between two inputs The measurement arming mode is set to digits The Counter uses the lt expected_value gt and lt resolution gt parameters to configure the number of digits of resolution arming setting The Channel 1 and possibly Channel 2 trigger settings are coupled so that the measurement channels have auto trigger enabled at 50 with a positive slope lt expected_value gt Chi Ch range for Ch2 Ch3 Ch2 Ch3 range for Chi Chi resolution default lt resolution gt
187. for the display of textual information FEED CALCulate2 Sets which data flow is fed into the display CALC2 CALCulates specifies the raw measurement scaled offset measurement or Limit Graph display CALC3 specifies the statistics result display COMMa DPOint Sets the character used to separate integral and fractional portions of a number USA numerical convention is Decimal POint FETCh ee See Measurement Instructions in this table FORMat Subsystem Sets a data format for transferring numeric information DATA ASGii REAL Sets the data format HCOPy New CONTinuous lt Boolean gt New Enables or disables printing results 2 28 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2 HP 53131A 132A SCPI Command Summary Continued New INITiate Subsystem Controls the initiation of measurements AUTO lt Boolean gt AUTO ON enables the Counter to automatically stop measuring on a limit test failure AUTO OFF disables the automatic stop CONTinuous lt Boolean gt Sets the enable for continuously initiated measurements IMMediate Event no query Causes the instrument to initiate the number of measurements specified by TRIGger COUNt AUTO INPut 1 2 Subsystem Controls the characteristics of the instrument s input ports INPut1 channel 1 and INPut2 channel 2 ATTenuation 1 10 Sets input attenuation COUPling AC DC Sets in
188. form a calibration with the exception of the interpolator calibration will generate error 221 if the user tries to execute a calibration while the Counter is secured Note this will not occur in early revisions of the Counter because calibration security does not exist Please refer to the CALibration SECurity subtree for command specifics regarding calibration security DIAGnostic CALibration INPut 1 2 GAIN Query Response Comments Related Front Panel Keys AUTO ONCE OFF Calibrates the channel 1 or 2 input trigger GAIN when the ONCE parameter is used Before sending this command connect a 5V source to the appropriate input A sequence of ASCII encoded bytes OFF e The calibration values are stored in non volatile memory and are unaffected by power on save recall and RST e Use DIAG CAL STAT to check for successful calibration e After calibration is completed the state of this command s parameter is OFF Scale and Offset POWER Calibration menu 4320 Programming Guide Query Response Comments Related Front Panel Keys Chapter 4 Command Reference Introduction DIAGnostic CALibration INPut 1 2 OFFSet AUTO ONCE OFF Calibrates the channel 1 or 2 input trigger OFFSet when the ONCE parameter is used Before sending this command BE SURE to disconnect any input signal from the appropriate input A sequence of ASCII encoded bytes OFF e The calibration values are stored in non volat
189. g Examples To Optimize Throughput HP BASIC Continued Count INIT CONT ON 500 OUTPU 510 OUTPU 520 ENTER Count USING K 530 OUTPUT Count FRE 540 550 560 570 580 590 600 610 FOR I 1 TO 200 620 TRIGGER Count 630 ENTER Count A I 640 NEXT I 650 FOR I 1 TO 10 660 PRINT AS I 670 NEXT I 680 END 3 74 Count FETCH FREQ Dummy Put counter in Run mode Fetch the frequency to be used for th must be within 1 frequency Using increases throug xpected frequency P1 VAL Dummy Tell the counter what frequency to expect on Ch 1 This number of the input this greatly hput When high throughput is not needed the expected val required Trigger the coun ue is not ter and read Print first 10 measurements Programming Guide 10 20 30 40 50 60 70 80 90 100 Lo 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 10 20 30 40 50 60 70 80 490 500 510 Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Macro_free Macro_enable Display_macros Macro_query Define_macro Delete_macro To Use Macros HP BASIC USER 1 KEYS ON
190. ge Peaks 0 is returned and error 221 is generated Query only No statistics results exist until the CALC3 AVER COUN CURR is equal to the specified CALC3 AVER COUN Stats CALCulate3 AVERage ST ATe lt Boolean gt Sets or queries the statistics post processing enable Query Response Comments Single ASCII encoded byte 0 or 1 A value of 0 indicates OFF a value of 1 indicates ON RST OFF When this enable is ON and TRIG COUN AUTO is ON and SENS FUNC ON is not Totalize or Voltage Peak function then INIT IMM initiates a complete block of measurements See TRIG COUN AUTO in this chapter for specifics When this enable is OFF INIT IMM always initiates a single measurement Programming Guide 4 21 Related Front Panel keys Chapter 4 Command Reference CALCulate3 Subsystem Stats CALCulate3 AVERage T YPE MAXimum MINimum SDEViation Query Response SCALar or MEAN Selects which statistical result will appear e in the CALC3 DATA response and e on the front panel display when DISP WIND TEXT FEED is set to CALC3 A sequence of ASCII encoded bytes MAX MIN SDEV or MEAN Comments e RST MEAN e If DISP WIND TEXT FEED is CALC3 then this command updates the display immediately Related Stats Front Panel keys CALCulate3 DATA Query Response Queries the statistical result specified by CALC3 AVER TYPE Enable statistics CALC3 AVER STATe O
191. get an overview of the differences between the earlier firmware revisions and current firmware revision If you have an HP 53132A with a serial number prefix below 3646 read the subsection titled HP 53132A Time Interval Delay Arming on page 1 5 Note that throughout the guide differences between the earlier and current firmware revisions are noted where applicable HP 53131A Containing Firmware Revisions 3317 3335 or 3402 There are four main areas that differ e Calibrations e Measurements e Statistics e HP IB Commands Calibrations If your Counter contains other than the current firmware revision the following calibration features are different e The calibration functions are in the Utility menu instead of the Calibration menu which is accessed by pressing and holding the front panel Utility key and then cycling POWER key e Calibrations are not protected by a security code e Accalibration count does not exist to aid in monitoring the number of calibrations performed e Amore accurate Time Interval calibration FINE TI is not available See the section titled Using the Calibration Menu in Chapter 2 of the HP 53131A 132A Operating Guide for details Programming Guide 1 3 Chapter 1 Before You Start Differences Between Prior and Current Revisions of the HP 53131A 132A Measurements If your Counter contains other than the current firmware revision the following measurement capabilities ar
192. gress 4 RCL lt Nrf gt 5 HCOPy CONTinuous ON OFF 6 INITiate CONTinuous ON if in single OR ABORT if running 7 INITiate IMMediate Figure 2 2 Instrument Control Utility Recall and Save amp Print Keys to SCPI Command Map Part 2 of 2 Programming Guide 2 7 Chapter 2 Command Summary Front Panel to SCPI Command Maps MEASURE Keys to SCPI Command Map Figure 2 3 MEASURE Keys to SCPI Command Map Part 1 of 2 2 8 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps MEASURE Keys to SCPI Command Map Cont 1 a b SENSe FUNCtion ON SENSe FUNCtion ON M2324 Sal SENSe FUNCtion ON SENSe FUNCtion ON SENSe FUNCtion ON SENSe FUNCtion ON OR SENSe FUNCtion ON SENSe FUNCtion ON OR SENSe FUNCtion ON SENSe FUNCtion ON SENSe FUNCtion ON SENSe FUNCtion ON SENSe FUNCtion ON SENSe FUNCtion ON SENSe FUNCtion ON IXNONe FREQuency 1 2 3 IXNONe FREQuency RATio J XNONe TOTalize 1 J XNONe PHASe 1 2 J XNONe DCYCle 1 J XNONe VOLTage MINimum 1 J XNONe VOLTage MAXimum 1 J XNONe VOLTage MINimum 2 J XNONe VOLTage MAXimum 2 J XNONe TINTerval 1 2 J XNONe PERiod 1 JIXNONeJRISE TIME 1 J XNONe FALL TIME 1 J XNONe PWIDth 1 J IXNONe NWIDth
193. 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 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 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 32767 indicates that the Counter has detected an error that is not a command error a query error or 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 Programming Guide 5 5 Chapter 5 Errors Error Types 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 should cause the query error bit bit 2 in the Event Status Regi
194. he positive transition filter is preset such that each bit is a 1 TRUE e This value is unaffected by RST and save recall Programming Guide 4 113 Chapter 4 Command Reference SYSTem Subsystem SYSTem Subsystem This subsystem collects together the capabilities that are not related to instrument performance SYSTem COMMunicate Subtree The SYSTem COMMiunicate 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 save recall and RST The SYSTem COMMunicate SERial TRANsmit subtree controls parameters associated with transmission The Counter will always use one start bit and one stop bit lt SYSTem COMMunicate SERial CONTrol DTR IBFull ON LIMit Sets or queries the hardware pacing scheme The ON parameter which is equivalent to DTR HIGH in the front panel Utility menu indicates that the DTR Data Terminal Ready line which is pin 4 of the RS 232 connector is always asserted HIGH to always be ready to allow data to be sent to the printer Choose the ON parameter when the printer or cable you are using does not support handshaking The IBFull parameter which is equivalent to DTR HW PAC
195. he range for the lt non decimal numeric gt or lt NRf gt parameter is 0 to 65 535 Numeric data transferred as ASCII bytes in lt NR1 gt format e At power on and STAT PRES the Operation Event Status Enable Register is cleared value is 0 e This value is unaffected by RST and save recall STATus OPERation EVENt Query Response Comment Queries the status of the Operation Event Status Register The Operation Event Status Register captures changes in conditions by having each event bit correspond to a specific condition bit in the Operation Condition Status Register An event becomes TRUE when the associated condition makes the transition specified by the transition filters The event 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 e Numeric data transferred as ASCII bytes in lt NR1 gt format e Range is 0 to 65 535 e The query response value is an integer formed by the binary weighting of bits The value of unused bits is zero The Operation Event Status Register is cleared by CLS by STAT OPER EVEN and at power on 4 108 Programming Guide Chapter 4 Command Reference Introduction STATus OPERation NT Ransition Range Query Response Comments lt non decimal numeric gt lt NRf gt Sets or queries the negative transition filter for the Operation status reporting structure The
196. ide Chapter 4 Command Reference Introduction How to Use the Measurement Instruction Commands Cont Use SENS EVEN LEV OV to set the trigger level to 0 Volts Use INITIATE to start the measurement Use FETCH to query for result Firmware Revision Work Around Commands The following applies to HP 53131A instruments with Firmware Revision 3413 The three commands listed below should NOT be used MEASure SCALar VOLTage MAXimum lt parameters gt lt source_list gt MEASure SCALar VOLTage MINimum lt parameters gt lt source_list gt MEASure SCALar VOLTage PTPeak lt parameters gt lt source_list gt The work around commands which should be substituted are listed below CONFigure SCALar VOLTage MAXimum lt parameters gt lt source_list gt INIT WAI FETCh CONFigure SCALar VOLTage MINimum lt parameters gt lt source_list gt INIT WAI FETCh CONFigure SCALar VOLTage PTPeak lt parameters gt lt source_list gt INIT WAI FETCh The three commands listed below should NOT be used READ SCALar VOLTage MAXimum READ SCALar VOLTage MINimum READ SCALar VOLTage PTPeak Programming Guide 4 77 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ The work around commands which should be substituted are listed below INIT WAI FETCh MA Ximum INIT WAI FETCh MINimum INIT WAI
197. ier Programming Guide 1 9 Chapter 1 Before You Start Related Documentation Related Documentation This section contains a list of documentation related to the use of the Counter Additional information that you may find useful can be found in the following publications 1 HP 53131A 132A Operating Guide HP Part Number 53131 90043 2 Beginner s Guide to SCPI HP Part Number H2325 9000 2 July 1990 Edition Beginner s Guide to SCPI Barry Eppler Hewlett Packard Press Addison Wesley Publishing Co 1991 Standard Commands for Programmable Instruments SCPI Version 1992 0 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 The International Institute of Electrical Engineers and Electronic Engineers IEEE Standard 488 1 1987 IEEE Standard Digital Interface for Programmable Instrumentation This standard defines the technical details required to design and build an HP IB IEEE 488 1 interface This standard contains electrical specification and info
198. ified 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 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 AEND is always sent as a response message terminator NOTE lt new line gt ASCII character decimal 10 SEND EOI asserted concurrent with last byte multiple response separator ASCII character decimal 59 data separator within a response ASCII character decimal 44 Figure 3 5 Simplified Response Message Syntax Diagram 3 16 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Response Message Data Types Table 3 3 contains explanations of response data types Table 3 3 Response Message Data Types lt NR1 gt This numeric representation has an implicit radix point Co iS 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 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 The maximum number of characters in lt NR3 gt response data is 22 maximum 15 mantissa digits 2 signs 1 decimal point 1 E
199. igger in response to the user initiating a measurement e Bits 5 7 are not used e Bit 8 Computing Statistics is a condition bit which indicates the Counter has begun collecting measurements for the next statistical computation The condition bit is TRUE one once the first of N measurements has begun and remains TRUE until the last of N measurements has completed e Bit 9 Using Internal Reference is a condition bit which indicates the Counter is using the internal reference The condition bit is TRUE one while the Counter is using the internal reference The condition bit is FALSE zero while the Counter is using the external reference This bit monitors both explicit and automatic reference changes Explicit reference changes occur when you select internal or external using the front panel Utility menu or the HP IB command SENS ROSC SOUR Automatic reference changes occur when the Counter is configured to select the reference automatically by detecting whether or not an external reference is being supplied e Bit 10 In Limit Event is an event bit indicating the last measurement limit tested was in limit Each and every time a measurement is limit tested and found to be in limit this event will be reported Programming Guide 3 31 Chapter 3 Programming Your Universal Counter for Remote Operation Status Reporting Note that this is the only bit in the Operation Status Register which is not representing
200. igger level is set to the specified or defaulted value When a reference is specified in volts auto trigger is disabled and the absolute trigger level is set to the specified value Programming Guide 4 71 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage RISE TIME Cont lt lower_reference gt percent range percent resolution voltage range voltage resolution default lt upper_reference gt percent range percent resolution voltage range voltage resolution default lt source_list gt range default 4 72 0 to 100 PCT 10 For volts if X1 Attenuation 5 125V to 5 125V For volts if X10 Attenuation 51 25V to 51 25V For volts if X1 Attenuation 005V For volts if X10 Attenuation 05V 10 PCT 0 to 100 PCT 10 For volts if X1 Attenuation 5 125V to 5 125V For volts if X10 Attenuation 51 25V to 51 25V For volts if X1 Attenuation 005V For volts if X10 Attenuation 05V 90 PCT 1 1 Programming Guide Chapter 4 Command Reference Introduction Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage TINTerval 1 2 Measures Time Interval The first channel in the channel list is the start channel and the second is the stop channel The trigger settings are coupl
201. ignal Status Register Group 4 110 Programming Guide Chapter 4 Command Reference Introduction STATus QUEStionable CONDition Query Response Comments Queries the status of the Questionable Data Condition Status Register Bits are not cleared when read Numeric data transferred as ASCII bytes in lt NR1 gt format e Range is 0 to 65 535 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 STATus QUEStionable ENABle lt non decimal numeric gt lt NRf gt Range Query Response Comments Sets or queries the Questionable Data Event Status Enable Register The parameter and query response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the Questionable Data 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 Questionable Data Event Status Register events to be summarized in the Status Byte Register bit 3 The range of the lt non decimal numeric gt or lt NRf gt parameter is 0 to 65 535 Numeric data transferred as ASCII bytes in lt NR1 gt format e At power on and STAT PRES the Questionable Data Event Status Enable Register is cleared value is 0 e This value is unaffected by RST and save rec
202. ile memory and are unaffected by power on save recall and RST e Use DIAG CAL STAT to check for successful calibration e After calibration is completed the state of this command s parameter is OFF Scale and Offset POWER Calibration menu DIAGnostic CALibration INTerpolator AUTO ONCE OFF ON Query Response Comments Calibrates the interpolator circuit in the Counter when the ONCE parameter is used AUTO ON enables automatic interpolator calibration on every measurement AUTO OFF disables automatic interpolator calibration A sequence of ASCII encoded bytes OFF or ON e RST ON e Use DIAG CAL STAT to check for successful calibration e After ONCE calibration is completed the state of this command s parameter is OFF e When DIAG CAL INT is set to OFF the Counter reports the positive status condition questionable Time Frequency and Phase to bits 2 5 and 6 of the Questionable Status Register When DIAG CAL INT is set to ON the Counter reports the negative status condition NOT questionable Time Frequency and Phase to bits 2 5 and 6 of the Questionable Status Register e This enable is unaffected by save recall Programming Guide 4 33 Chapter 4 Command Reference DIAGnostic Subsystem DIAGnostic CALibration ROSCillator AUTO ONCE OFF Calibrates the reference oscillator when ONCE parameter is used Before sending this command connect 10 MHz to channel 1 Query Response A sequence of ASC
203. ilter Data Before Measuring Statistics To Read and Store Calibration Data this program is useful if you plan to calibrate your HP 53131A 132A and want to be able to return to the original calibration at a later date HP BASIC and QuickBASIC only 7 To Perform a Time Interval Calibration this program shows how to perform both types of time interval calibrations The fine time interval calibration uses the HP 59992A J06 Time Interval Calibrator This program also shows how to use the basic calibration security capabilities Note early versions of the Counter cannot execute this program since they do not support calibration security or fine time interval calibration HP BASIC only 8 To Optimize Throughput that is to set up the Counter to transfer data at the fastest possible rate 9 To Use Macros 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 59 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 4 4 4 4 50 60 70 80 490 500 510 520 530 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples Easiest Way to Make a Measurement HP BASIC This program shows how to use the ME
204. imum 112 EXNONe VOLTage MINimum 112 XNONe VOLTage PTPeak 112 Programming Guide 4 89 Query Response Comments Chapter 4 Command Reference SENSe Subsystem The string lt function gt lt channel gt lt channel gt is returned 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 will be returned in the response with a single space separating the first channel specifier from the function name For example FREQ would be returned for frequency on Channel 1 FREQ 2 would be returned for frequency on Channel 2 FREQ RAT would be returned for frequency ratio of Channel 1 to Channel 2 FREQ RAT 1 3 would be returned for frequency ratio of Channel 1 to Channel 3 RST FREQuency 1 If the optional channel specification is omitted from the lt sensor_function gt a default channel selection is made For Frequency Period Rise Time Fall Time Pulse Width Duty Cycle Totalize and Voltage Peaks the default is Channel 1 For Time Interval Frequency Ratio and Phase the default is Channel 1 to Channel 2 When the sensor function is changed to XNONe TINTerval 1 2 the input routing is set to separate SENS EVEN2 FEED INP2 Use SENS
205. imum to from peak to peak and minimum to from peak to peak All other functions require an acquisition of a new type xK lt source _list gt has the same syntax as SCPI lt channel _list gt syntax For example a single channel function e g frequency period etc would use 1 to specify channel 1 whereas a two channel function e g time interval phase and frequency ratio would use 1 2 to specify a measurement between channel 1 and channel 2 k Eor HP 53131A firmware revision s below 3335 only Ratio 1 to 2 and Ratio 1 to3 were offered This lt function gt is only allowed with CONFigure Programming Guide 2 31 Chapter 2 Command Summary HP 53131A 132A Command Summary Table 2 2 HP 53131A 132A SCPI Command Summary Continued New MEMory Subsystem Manages instrument memory DELete Subtree MACRo lt string gt Event no query Deletes the macro with the name specified by the string parameter FREE Subtree MACRO Query only Returns memory usage and availability corresponding to macro data NSTates Query only Returns the number of available SAV RCL states in the instrument See Measurement Instructions in this table SENSe Subsystem setup commands DATA JSENSe 1 Query only Returns the current measurement result data of the SENSe subsystem no scale or offset applied EVENt 1 2 Subtree Defines the trigger event HYSTeresis Subtree RELati
206. ing Guide 4 59 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt This sub section provides a description of each measurement function that is VOLTage FREQuency WOLTage FREQuency RATio VOLTage PERiod etc that can be used with either the MEASure query or CONFigure command CAUTION If your HP 53131A contians Firmware Revision 3413 refer to the subsection titled Firmware Revision Work Around Commands on page 4 77 It is important to refer to this subsection if your counter conta ins Firmware Revision 3413 because several measurement functions commands will not work with this firmware revision thus work around commands must be used The commands that required work around commands are MEASure SCALar VOLTage MAXimum lt parameters gt lt source_list gt MEASure SCALar VOLTage MINimum lt parameters gt lt source_list gt MEASure SCALar VOLTage PTPeak lt Parameters gt lt source_list gt READ SCALar WOLTage MAXimum READ SCALar VOLTage MINimum READ SCALar VOLTage PTPeak READ In each of the following command lines the MEASure command is used with the measurement function commands 4 60 Programming Guide Chapter 4 Command Reference Introduction Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage D
207. ionable status structures The following lines will provide the highest throughput regardless of the state of the counter before these lines ar xecuted OUTPUT Count FORMAT ASCII ASCII format for fastest throughput OUTPUT Count FUNC FREQ 1 Select frequency OUTPUT Count EVENT1 LEVEL 0 Set Ch 1 trigger level to 0 volts OUTPUT Count FREQ ARM STAR SOUR IMM These two lines nable th OUTPUT Count FREQ ARM STOP SOUR IMM AUTO arming mode OUTPUT Count ROSC SOUR INT Use internal oscillator If you want to use an external timebase you must select it and turn off the automatic detection using ROSC EXT CHECK OFF 1 OUTPUT Count DIAG CAL INT AUTO OFF Disable automatic interpolater calibration The most recent calibration values are used in the calculation of frequency OUTPUT Count DISP ENAB OFF Turn off the counter display This greatly increases measurement throughput OUTPUT Count CALC MATH STATE OFF Disable any post processing OUTPUT Count CALC2 LIM STATE OFF OUTPUT Count CALC3 AVER STATE OFF OUTPUT Count HCOPY CONT OFF Disable any printing operation OUTPUT Count DDT 15FETC Define the Trigger command This means the command FETC does not need to be sent for Programming Guide very measurement the number of bytes transferred over the bus decreasing 3 73 Chapter 3 Programming Your Universal Counter for Remote Operation Programmin
208. is ON Trigger Sensitivity SENSe EVENt 1 2 SLOPe POSitive NEGative Query Response Comments Related Front Panel Keys Sets or queries which edge of the input signal will be considered an event for Frequency Period Frequency Ratio Time Interval Totalize and Phase measurements With the POSitive slope selected a signal going from one voltage level to a more positive level regardless of polarity will define the event at the upper hysteresis limit With the NEGative slope selected the negative going edge of the signal will define an event at the lower hysteresis limit A sequence of ASCII encoded bytes POS or NEG e 6 RST POSitive e The slopes used for Rise Fall Time Pulse Width and Duty Cycle measurements are independent of this setting Trigger Sensitivity SENSe EVENt3 Subtree This subtree queries the characteristics of the trigger event for channel 3 input port SENSe EVENt3 LEVel ABSolute Query Response Comments Queries the trigger level of channel 3 input port e Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits e The value returned is 0 Units are Volts 48400 Programming Guide Chapter 4 Command Reference Introduction SENSe EVENt3 SLOPe Query Response Queries which edge of channel 3 input port will be considered an event A sequence of ASCII encoded bytes POS SENSe FREQuency Subtree This subtre
209. is applies to the following measurement functions Frequency Period Ratio Phase and Duty Cycle The query indicates whether or not the above described pre measurement step is enabled e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON 4 88 Programming Guide Comments Chapter 4 Command Reference Introduction RST ON This value is unaffected by save recall While the Counter is configured to ON representative CW signal s must be present at the measurements input s The ON setting causes the Counter to disregard any previously set expected frequency SENS FREQ EXP 11213 The only mechanism for disabling the above described pre measurement step is to specify an expected frequency with SENS FREQ EXP 11213 SENSe FUNCtion ON lt sensor_function gt Sets or queries the lt sensor_function gt to be sensed by the Counter The lt sensor_function gt strings are XNONe DCYCle 1 or _XNONe PDUTycycle 1 _XNONe FALL TIME 1 or XNONe FTIMe 1 _XNONe FREQuency 11213 XNONe FREQuency RATio 1 2 11 3 12 1 13 1 _EXNONe NWIDth 1 EXNONe PERiod 11213 T EXNONe PHASe 1 2 EXNONe PWIDth 1 _EXNONe TINTerval 1 2 XNONe TOTalize 1 EXNONe RISE TIME 1 or EXNONe RTIMe 1 EXNONe VOLTage MAX
210. isables expansion of macros Non zero value enables zero value disables Queries whether macros are enabled Sets the Standard Event Status Enable Register Queries the Standard Event Status Enable Register Queries the Standard Event Status Register Queries the current definition of a currently defined macro label Queries the Counter identification Queries the currently defined macro labels Causes Counter to set the operation complete bit in the Standard Event Status Register when all pending operations see Note are finished Places an ASCII 1 in the Output Queue when all pending operations see Note are completed Note Pending operations include measurements in progress 2 22 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 1 IEEE 488 2 Common Commands Continued Option Identification Query Identifies the options installed in the Counter Purge Macro Command Deletes all macros previously defined using the DMC command RCL lt NRf gt Restores the state of the Counter from a copy stored in local non volatile memory 0 through 20 are valid memory registers RST Resets the Counter to a known state SAV lt NRf gt Stores the current state of the Counter in local non volatile memory 1 through 20 are valid memory registers SRE lt NRf gt Service Request Enable Set the Service Request Enable register SRE Service Request Enable Query Queries the
211. its e RST 100E 3 S e Only applies when SENS FREQ ARM STOP SOUR TIM is selected Gate amp ExtArm Programming Guide 4 87 Chapter 4 Command Reference SENSe Subsystem SENSe FREQuency EXPected 1 2 3 lt numeric_value gt Range Query Response Comments lt numeric_value gt HZ Sets or queries the approximate frequency of a signal you expect to measure Providing this value enables the Counter to eliminate a pre measurement step saving measurement time and enabling more accurate arming This applies to the following measurement functions Frequency Period Ratio Phase and Duty Cycle Note that the actual frequency of the input signal must be within 10 of the expected frequency value you entered e For channels 1 and 2 the frequency range is 0 1 to 225E6 HZ e For channel 3 Option 030 the frequency range is 100E6 to 3E9 HZ e For channel 3 Option 050 the frequency range is 200E6 to 5E9 HZ Numeric data transferred as ASCII bytes in lt NR3 gt format with fifteen significant digits e If SENS FREQ EXP 112I3 AUTO is ON Not a Number 9 91E37 is returned and error 221 is generated This value is unaffected by save recall SENSe FREQuency EXPected 1 2 3 AUTO ON Query Response The command which only allows the ON parameter configures the Counter to perform as necessary a pre measurement step to automatically determine the approximate frequency of the measurement signal s Th
212. ke 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 INPut COUPling AC INPut COUPling INPut is root level keyword with COUPIling the second level keyword and AC is the command parameter Programming Guide 3 7 Chapter 3 Programming Your Universal 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 the Counter over the HP IB as a sequence of ASCII data messages Examples of a typical Common Command and Subsystem Command are OUTPUT 712 CLS OUTPUT 712 INP1 COUP AC IMP 1 0 MOHM Subsystem Command Syntax Figure 3 2 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 2 Simplified Program Command Syntax Diagram Common Command Syntax Figure 3 3 shows the simplified syntax of a Common Command You must use a space SP between the command mnemonic
213. le 2 2 HP 53131A 132A SCPI Command Summary Continued New SENSe Cont TOTalize Cont ARM Cont STOP Subtree SLOPe POSitive NEGative Sets the slope of the external stop arm signal used in external arming totalize measurements Only applies when SENS TOT ARM STOP SOUR EXT is selected EXTernal TIMer IMMediate Sets the stop arm for totalize measurements lt numeric_value gt S Sets the gate time used in totalize measurements Only applies when SENS TOT ARM STOP SOUR TIM is selected STATus Subsystem Controls the SCPI defined Operation and Questionable status reporting structures OPERation Subtree CONDition Query only Queries the Operation Condition Status Register ENABle lt non decimal numeric gt Sets the Operation Event Status Enable Register EVENt lt NRf gt Query only Queries the Operation Event Status Register NTRansition lt non decimal numeric gt Sets the negative transition filter for the Operation lt Nrf gt status reporting structure PTRansition lt non decimal numeric gt Sets the positive transition filter for the Operation lt NRf gt status reporting structure PRESet Event No query Presets the enable registers and transition filters associated with the Operation and Questionable status reporting structures QUEStionable Subtree CONDition Query only Queries the Questionable Data Condition Status Register ENABle lt non decimal numeric gt Sets
214. le ENABle The event enable registers are cleared by STATus PRESet and power on Programming Guide 3 29 Chapter 3 Programming Your Universal 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 Table 3 7 lists the Operation Status Register bits and briefly describes each bit Table 3 7 Operation Status Register WEIGHT 1 Calibrating 6 Not used since some controllers may have difficulty reading a 16 bit unsigned integer The value of this bit shall always be 0 A detailed description of each bit in the Operation Status Register follows e Bit 0 Calibrating is a condition bit which indicates the Counter is currently performing a front panel invoked or HP IB invoked calibration The condition bit is TRUE one during a calibration and FALSE zero otherwise 3 30 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands e Bits 1 3 are not used e Bit 4 Measuring is a condition bit which indicates the Counter is actively measuring The condition bit is TRUE one during a measurement and FALSE zero otherwise If the external reference has been explicitly selected and an absent or invalid signal at the external reference input is detected then the Counter will not report Measuring even though it may perform an auto tr
215. le post processing math limit testing statistics CALCulate MATH STATe OFF CALCulate2 LIMit STATe OFF CALCulate3 AVERage STATe OFF Specify expected frequency for Frequency Period Ratio Phase and Duty Cycle measurements SENSe FREQuency EXPected 1 2 3 lt numeric_value gt HZ See Note below Specify ASCII format for result query responses FORMat DATA ASCii Specify continuous measurements INITiate CONTinuous ON Configure the read fetch function memory Issue the following query and read the response FETCh SCALar lt function gt Note This value is not stored on Save and is not part of the non volatile state Typical Optimizing Throughput Results for Different Computers 3 36 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Table 3 9 lists the typical performance for three different computers The To Optimize Throughput sample programs on pages 3 73 3 86 and 3 96 were used to generate the numbers in the table The actual examples listed in this guide show the Frequency Auto Arming function but the technique is the same for the other two functions Frequency Time Arming 001 and Time Interval 1 to 2 You only have to change the function in the program to generate the numbers in the table Table 3 9 Typical Optimizing Throughput Results in Measurements per Second IBM PC Compatible HP 82324A HP 9000 Series 300 486 25
216. lock 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 e Foran automatically armed Totalize measurement use ABORt to terminate the measurement initiated with INIT IMM e When SENS EVEN LEV ABS AUTO is ON the Counter performs an auto trigger on the measurement channel s whenever the INIT IMM command is executed Stop Single Programming Guide 4 47 Chapter 4 Command Reference INPut 1 2 Subsystem INPut 112 Subsystem This subsystem controls the characteristics of the Counter s input ports INPut1 corresponds to channel 1 input port and NPut2 corresponds to channel 2 input port INPut 1 2 ATTenuation 1 10 Query Response Comments Related Front Panel Keys Sets or queries the input attenuation Numeric data transferred as ASCII bytes in lt NR1 gt format RST 1 X10 Attenuate INPut 1 2 COUPling AC DC Query Response Comments Related Front Panel Keys Sets or queries the input coupling A sequence of ASCII encoded bytes AC or DC RST AC DC AC INPut 1 2 FILTer LPASs STATe lt Boolean gt Query Response Comments Related Front Panel Keys Sets or queries the state of the low pass filter e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON RST OFF 100kHz Fi
217. lter 4 48 Programming Guide Chapter 4 Command Reference Introduction INPut 1 2 FILTer LPASs FREQuency Queries the cutoff frequency of the low pass filter Query Response e Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits e A value of 100E 3 is returned Comments Units are Hertz INPut 1 2 IMPedance lt numeric_value gt OHM Sets or queries the input impedance SOQ or 1MQ lt numeric_value gt 50 or 1E6 Range Query Response Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits Comments e RST 1E6 OHM e Units are Ohms Related 50Q 1MQ Front Panel Keys Programming Guide 4 49 Chapter 4 Command Reference INPut3 Subsystem INPut3 Subsystem This subsystem queries the characteristics of the Counter s channel 3 input port These commands are only available if Option 030 050 is installed INPut3 COUPling Query Response Comments Queries the channel 3 input coupling A sequence of ASCII encoded bytes AC This command is only available if Option 030 050 is installed INPut3 IMPedance Query Response Comments Queries the channel 3 input impedance Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits The value returned is 50 or Not a Number 9 91E37 if Option 030 050 Channel 3 is not installed e Units are Ohms e This command is only available if Option 03
218. mand This can be tedious and is prone to users counting incorrectly The To Use Macros sample programs on pages 3 75 and 3 88 can be used to help set up macros and perform the counting for you 3 52 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands A macro also lets you send variable parameters along with the name For example you could have a macro that sets up a measurement channel One of the variables may be the input impedance either 50 Ohms or 1 Megaohm To program this you would send the macro name along with the impedance value To assign a variable inside the macro definition you would replace the normal parameter with a followed by a number from 1 to 9 Up to 9 variables can be assigned When sending the macro the first parameter would be assigned to the 1 and all occurrences of 1 in the macro The second parameter would be assigned to 2 and so on Here is what the macro called setimp would look like It changes the impedance on channel to the value assigned to 1 in the macro command DMC setimp 212 INP1 IMP 1 To change the impedance to 50 ohms send setimp 50 The above is a very simple example Macros are best used for a long sequence of commands A good use for macros is changing the display from one format to another To change to the limit graph the following commands must be sent DISP MENU OFF DISP TEXT FEED CALC2 gt C
219. measurement flexibi 790 results based on already acqu 800 derived from a frequency meas 810 820 The trigger level is then cha 830 performed starting the measu 840 the FETCH FREQUENCY command 850 FETCH PERIOD this time aski 860 PRINT 870 P 880 OUTPUT Count CONF FREQ 1 890 OUTPUT Count EVENT1 LEVEL 900 OUTPUT Count INIT 910 OUTPUT Count FETCH FREQUENC 920 ENTER 703 Freq 930 PRINT 940 PRINT Frequency Freq 950 OUTPUT Count FETCH PERIOD 960 970 980 ENTER Count Periods 990 PRINT 1000 PRINT Period Periods 1010 PRINT 1020 RETURN 1030 END urement without a new acquisition The following example uses CONF to set up a frequency measurement nged to 50 millivolts and an INIT is rement process The data is read using The period can then be read by sending ng for the period RINT Frequency and Period measured using CONF FREQ 1 INIT FETCH i Configure for frequency measurement 05 Change trigger level Start a measurement Y Ask for frequency result Ask for period result derived from frequency measurement Note that another measurement was not made 3 61 Programming Guide 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 Chapter 3 Programming Yo
220. ments SCPI commands all of the Counter s front panel functions can be remotely operated via the Hewlett Packard Interface Bus HP IB as well as the additional throughput optimizing function not available from the front panel This Counter 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 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 you will have 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 Programming Guide Contents Differences Between Prior and Current Revisions of the HP 53131A 132A If you have an HP 53131A containing one of the prior firmware revisions 3317 3335 or 3402 read the subsection below titled HP 53131A Containing Firmware Revisions 3317 3335 or 3402 to
221. meric data transferred as ASCII bytes in lt NR1 gt format Current firmware revision RST 0 PCT least noise immunity Prior firmware revisions RST 100 PCT maximum sensitivity 3317 3335 and 3402 Trigger Sensitivity SENSe EVENt 1 2 LEVel ABSolute lt numeric_value gt Range Resolution Query Response Comments Related Front Panel Keys lt numeric_value gt V Sets or queries the level at the center of the hysteresis window The actual trigger event is at the top of the hysteresis window for POSitive slope or at the bottom of the hysteresis window for NEGative slope e X1 Attenuation 5 125 to 5 125V e X10 Attenuation 51 25 to 51 25V e X1 Attenuation 005V e X10 Attenuation 05V Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits e Execution of this command turns SENS EVEN 1I2 LEV AUTO to OFF e The query can be used to determine the current trigger level when auto trigger is enabled SENS EVEN 1I2 LEV ABS AUTO ON That is the query response will indicate what level has automatically been selected Trigger Sensitivity 4820 Programming Guide Chapter 4 Command Reference Introduction SENSe EVENt 1 2 LEVel ABSolute AUTO lt Boolean gt Query Response Comments Related Front Panel Keys Sets or queries the auto trigger enable When AUTO is set to ON the Counter automatically measures and compu
222. mmand is received Once CALC2 IMM AUTO is set to ON the CALCulate 1I2 subsystems produce new results when any CALCulate 1I2 command is processed even when new SENSe data is not being acquired This allows the user to make configuration changes in the CALCulate 11I2 subsystems and immediately have new CALCulate 1I2 results on the same SENSe data e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON e 6 RST OFF e This command affects all of the post processing subsystems settings CALC 1 IMM AUTO e Note that the Counter powers up with CALC2 IMM AUTO set to ON but RST sets it to OFF e The only limit result that can be truly post processed is CALC2 LIM FAIL The limit counts CALC2 LIM FCO and CALC2 LIM PCO reflect measurements that were limit tested at time of data acquisition CALCulate2 LIMit Subtree This subtree collects together the commands associated with controlling and getting reports from a single LIMit test The limit test is defined as both an upper and lower limit test If the measurement cycle is aborted or terminates abnormally the limit test status will be unaffected That is an aborted or abnormally terminated measurement does not get limit tested and has no effect on the limit test results 4420 Programming Guide Chapter 4 Command Reference Introduction CALCulate2 LIMit CLEar AUTO lt Boolean gt Sets or queries if the limit test result
223. mments Related Front Panel Keys Sets or queries the slope of the external start arm signal used in external arming Totalize measurements A sequence of ASCII encoded bytes POS or NEG e RST POSitive e Only applies when SENS TOT ARM STAR SOUR EXT is selected Gate amp ExtArm 4404 Programming Guide Chapter 4 Command Reference Introduction SENSe TOTalize ARM STARt SOURce IMMediate EXTernal Query Response Comments Related Front Panel Keys Sets or queries the start arm for Totalize measurements A sequence of ASCII encoded bytes IMM or EXT e RST IMMediate e When both start and stop arm are set to IMMediate use INIT IMM to begin totalizing and ABORt to terminate No valid totalize result will exist until the auto totalize measurement is terminated Gate amp ExtArm SENSe TOTalize ARM STOP SLOPe POSitive NEGative Query Response Comments Related Front Panel Keys Sets or queries the slope of the external stop arm signal used in external arming Totalize measurements A sequence of ASCII encoded bytes POS or NEG e RST NEGative e Only applies when SENS TOT ARM STOP SOUR EXT is selected Gate amp ExtArm Programming Guide 4 105 Query Response Comments Related Front Panel Keys Chapter 4 Command Reference SENSe Subsystem SENSe TOTalize ARM STOP SOURCce IMMediate EXTernal TiMer Sets or queries the stop arm for Totalize measurements
224. n channel 1 and channel 2 If the instrument receives a parameter which is unexpected it shall process the command ignoring the unexpected parameter and set the Command Warning bit of the Data Questionable status reporting structure The response format for MEASure query READ and FETCh is determined by the FORMat subsystem If no valid data is available error 230 Data corrupt or stale is generated See the programming example Easiest Way to Make a Measurement in Chapter 3 of this guide CONFigure SCALar lt function gt lt parameters gt Comments lt source_list gt Configures the instrument to perform the specified function but does not initiate the measurement Use INITiate FETCh or READ to make and query a measurement Parameters other than lt source_list gt may be defaulted from the right by omitting them or anywhere by substituting the keyword DEFault The lt source_list gt parameter may be defaulted by omitting it The default values are specified by the particular function description Note this command defaults several Counter settings To simply change the function while leaving all other Counter settings as they are use SENS FUNC ON instead e Refer to the sub section in this section titled Descriptions of the Measurement Functions for descriptions of each measurement function e Refer to Table 4 1 in this sub section for a summary of the lt function gt lt
225. n separate 4 81 computing statistics status bit 3 30 3 31 condition register 3 27 3 28 CONFigure with INITiate and FETCh using 4 76 CONFigure with READ using 4 76 configuring the HP IB 3 4 Index 1 Index conformance TEEE488 1 3 7 TEEEF488 2 2 20 2 21 3 7 SCPI 2 20 3 7 connecting the Counter to a computer 3 6 connector RS 232 4 114 D data measurement 4 80 date code firmware 4 130 DCL 4 31 DDE 3 24 DDT 4 124 decimal point 3 11 3 17 DEG 3 12 Device Clear 4 31 device trigger 4 124 device dependent error definition 5 5 device specific error status bit 3 26 differences between firmware revisions 1 3 display 4 38 enable 4 37 display results 3 43 displaying errors 5 2 double quoted string sending a double quoted string 3 58 duty cycle 4 61 4 89 4 96 E EOI 3 13 error command 5 4 displaying 5 2 execution 5 5 how to query 5 2 list 5 7 messages 5 7 query 3 25 4 116 5 6 queue 5 3 type 5 4 errors list 5 7 ESB 3 22 3 23 event enable register 3 27 3 29 event register 3 27 3 29 EXE 3 24 execution error definition 5 5 status bit 3 26 F fail limit test 4 14 Index 2 fall time 4 62 4 89 4 96 firmware date code 4 130 revision 4 130 firmware revision 2 32 4 81 firmware revisions 1 3 2 31 2 34 format ASCII 4 41 REAL 4 41 frequency 4 63 4 85 4 89 frequency ratio 4 65 4 89 front panel to SCPI command maps 2 3 function 4 60
226. nds INITiate MMediate performs the data acquisition FETCh performs the post processing function if any and places the result in the Output Queue This allows more than one FETCh on a single set of acquired data Summary of the Measurement Instruction Commands This command is the simplest to use but allows few additional possibilities This command lets the Counter configure itself for an optimal measurement initiate measurement and return the result that is it provides complete measurement sequence MEAS query is equivalent to the CONF INIT FETC command sequence but with no flexibility The combined use of these two commands allows for more control when the Counter performs measurement initiates measurement and returns the result Use this command sequence if you are planning for the Counter to perform something in between the measurement setup and acquisition This combination of commands allows for the most flexibility This command sequence configures the Counter initiates the measurement as specified and returns the result 4520 Programming Guide Chapter 4 Command Reference Introduction The lt source_list gt parameter has the same syntax as SCPI lt channel_list gt syntax For example a one channel function such as Frequency Period etc would use 1 to specify channel 1 whereas a two channel function such as Time Interval Phase and Ratio would use 1 2 to specify a measurement betwee
227. nformation in this chapter will help you program the Counter over the HP IB The commands are presented in alphabetical order SCPI Subsystem commands are described on pages 4 4 thru 4 121 IEEE 488 2 Common command descriptions start on page 4 122 Device Clear and Group Execute Trigger descriptions are also included on pages 4 31 and 4 42 respectively For each command description 4 2 where the phrase Sets or queries is used the command setting can be queried by omitting the parameter and appending a to the last command keyword For example INPut COUPIling AC DC can be queried with INPut COUPling unless otherwise noted a command described as an event cannot be queried unless otherwise noted the command setting is affected by save recall 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 Programming Guide Chapter 4 Command Reference Introduction e 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 e unless otherwise noted the command is sequential not overlapped See Chapter 3 in this guide for details regarding command syntax parameter t
228. nse 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 Figure 4 6 The Service Request Enable Register See the section titled Status Byte Register and Service Request Enable Register page 3 21 in Chapter 3 of this guide for a detailed description of the Service Request Enable Register e to 255 e The value of bit 6 and unused bits is ignored when set 1 e Numeric data transferred as ACSII bytes in lt NR1 gt format e The value of bit 6 and unused bits is zero when queried e At power on this value is cleared set to 0 e This value is unaffected by RST and save recall Programming Guide 4 139 Chapter 4 Command Reference STB Status Byte Query STB Status Byte Query STB Query Response Queries the Status Byte Register shown in Figure 4 7 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 Figure 4 7 The Status Byte Register See the section titled Status Byte Register and Service Request Enable Register page 3 21 in Chapter 3 of this guide for a detailed description of the Status Byte Register e Numeric data transferred as ASCII bytes in lt NR1 gt format
229. ntil relevant instrument state is changed The CALCulate3 subsystem consists of two sub blocks as shown in Figure 4 1 The data flows through the sub blocks in a serial fashion The manner in which these sub blocks are arranged is specified in the CALC3 PATH query The CALCulate 1I2I3 settings are not used when measuring Totalize or Voltage Peaks voltage minimum maximum or peak to peak Not until CALCulate 1 MATH STATe is set to ON will any of the CALCulate 1 settings or TRACe DATA settings be used Not until CALCulate2 LIMit STATe is set to ON will any of the CALCulate2 settings be used Not until CALCulate3 LFILter STATe is set to ON will any of the CALCulate3 LFILter settings be used Not until CALCulate3 A VERage STATe is set to ON will any of the CALCulate3 A VERage settings be used Programming Guide 4 5 Chapter 4 Command Reference CALCulate Subsystems CPltub ef 142 CAL Custe2 L Mit CAL C L Mit AODuntU PPer CAaLCeL Mit AoOuntLOWer SOS CALCUee1 MATH CAaLC2L Mit PE Oure CALCAL Mit FAL LAET TESTHG 3 ENSe DATA 3 BYSe DATA gi Sea 1 0ATA FETCH FETCH SCALEDOFFS Totdize or Frequency Period Rato Voltage Peaks Time Interval Dutyoyde CoOL Custe 2 LEL ee Tin 4 of Phas MEASUREMENT CALCUse 3 AVE Rage CALC AVE Rage ALL CALES D4 TA SATETICS Figure 4 1 The CALCulate Subsystems 4 6 Programming Guide NOTE Chapter 4 Command
230. ntrols the time interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measuring capabilities of the instrument Refer to page 4 98 for Time Interval arming capabilities of the HP 53132A with a serial number prefix 3646 and above SENSe TINTerval ARM Subtree HP 53131A and HP 53132A With S N Prefix Below 3646 This subtree is use to synchronize the time interval start and stop arm with events The following combination of start stop arming sources are valid STARt SOURce STOP SOURce Front Panel Arming Settings ARM DELAY EXTernal EXTERNAL NONE EXTernal EXTERNAL TIME SENSe TINTerval ARM STARt SLOPe POSitive NEGative Query Response Comments Related Front Panel Keys Sets or queries the slope of the external start arm signal used in external arming time interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measurements A sequence of ASCII encoded bytes POS or NEG e RST POSitive e Only applies when SENS TINT ARM STAR SOUR EXT is selected Gate amp ExtArm Programming Guide 4 95 Chapter 4 Command Reference SENSe Subsystem SENSe TINTerval ARM STARt SOURce IMMediate EXTernal Sets or queries the start arm for time interval including Time Interval Risetime Falltime Duty Cycle and Pulse Width functions measurements Query Response A sequence of ASCII encoded bytes IMM or EXT Comments RST IMMediate
231. nts RST CALCulate2 e Refer to the section titled How to Program the Counter to Display Results in Chapter 3 of this guide Related Stats Front Panel Keys 4 38 Programming Guide Chapter 4 Command Reference Introduction DISPlay WINDow TEXT RADix COMMa DPOint Sets or queries the character used to separate integral and fractional portions of a displayed number To conform to the numerical convention used in the USA specify decimal point with DPOint To conform to the numerical convention used in many other countries specify COMMa For example With DPOint one thousand is displayed as 1 000 0 With COMMa one thousand is displayed as 1 000 0 Query Response A sequence of ASCII encoded bytes DPO or COMM Comments This value is stored in non volatile memory It is unaffected by power on save recall and RST Related Utility POWER Front Panel Keys Programming Guide 4 39 Chapter 4 Command Reference FETCh Subsystem FETCh Subsystem Refer to the Measurement Instructions section on page 4 52 in this chapter for a description of FETCh 440 Programming Guide Chapter 4 Command Reference Introduction FOR Mat Subsystem This subsystem sets the data format for transferring numeric information This data format is used for response data by those commands that are specifically designated to be affected by the FORMat subsystem FORMat DATA ASCii REAL Query Response Comm
232. nts Sets the slope of the external start arm signal used in external arming Time Interval measurements including Time Interval Rise Time Fall Time Dutycycle and Pulse Width Sets the start arm for time interval including Time Interval Rise Time Fall Time Dutycycle and Pulse Width measurements Sets the event count used to delay the start arm for Time Interval measurements Only applies when SENS TINT ARM ESTART SOUR INT1 is selected Sets the start arm delay for Time Interval measurements Sets the time used to delay the start arm for Time Interval measurements Only applies when SENS TINT ARM ESTART SOUR TIM is selected Sets the slope of the external stop arm signal used in external arming Time Interval measurements Sets the stop arm for Time Interval measurements Sets the event count used to delay the stop arm for Time Interval measurements Only applies when SENS TINT ARM ESTOP SOUR INT2 is selected Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2A HP 53132A S N Prefix 3646 and Above Time Interval Arming SCPI Command Summary Continued New SENSe Cont TINTerval Cont ARM Cont ESTOP Cont LAYer 1 SOURce IMMediate TIMer Sets the stop arm delay for Time Interval INTernal2 measurements TIMer lt numeric_value gt Sets the time used to delay the stop arm for Time Interval measurements Only applies when SENS TINT AR
233. o display all of the significant digits of this value When this is the case the displayed value is different from the actual value in that the displayed value has been rounded However using the front panel Enter key while this value is in the 11 digit display will update the actual value to the displayed rounded value CALCulate3 PATH Queries the order in which CALCulate3 sub blocks are to be processed Query Response Comments For the Counter this sequence is fixed to be LFILter followed by AVERage A sequence of ASCII encoded bytes LFIL AVER Query only Programming Guide 4 25 Chapter 4 Command Reference CALibration Subsystem CALibration Subsystem CALibration ALL This query causes an internal interpolator self calibration Query Response Comments Numeric data transferred as ASCII bytes in lt NR1 gt format A value of zero indicates the calibration completed without error A value of one indicates the calibration completed with error Query only CALibration COUNt Queries the number of times the Counter has been calibrated Query Response Comments By monitoring the calibration count you can determine whether an unauthorized calibration has been performed The following commands as well as the front panel invoked calibrations increment the count upon the completion of a successful calibration DIAG CAL INP 1I2 GAIN AUTO ONCE DIAG CAL INP 1I2 OFFS AUTO ONCE DIAG CA
234. o recursion error Macro redefinition not allowed Macro header not found Device specific error System error Out of memory Self test failed Self test failed CPU failure Self test failed ROM failure Self test failed RAM failure Self test failed EEPROM failure Self test failed HP IB failure Self test failed QSPI failure Self test failed FPGA failure Self test failed front end failure Self test failed measurement failure Self test failed interpolator failure Queue overflow Used where exact value from a list of possible values was expected No valid data available New measurement started but not completed Indicates that a legal program command or query could not be executed because of a hardware problem in the Counter Indicates that a legal program command or query could not be executed because of missing Counter hardware For example the Channel 3 option was not installed Indicates that a syntactically legal macro program data sequence could not be executed due to some error in the macro definition Indicates that the macro label defined in the DMC command was a legal string syntax but it could not be accepted by the Counter For example the label was too long the same as a common command header or contained invalid header syntax Indicates that a syntactically legal macro program data sequence could not be executed because the Counter found the maximum recursion level of four was exceeded Indicates th
235. o the Measurement Instructions section on page 4 52 in this chapter for a description of CONFigure 4 30 Programming Guide Chapter 4 Command Reference Introduction Device Clear Device Clear The full capability of the Device Clear IEEE 488 1 interface function is implemented in the Counter This function allows a device to be initialized to a cleared state The device dependent effect is described below In response to either the Device Clear message or the Selected Device Clear message the Counter e clears the input buffer and Output Queue e resets the parser execution control and response formatter e clears any command that would prevent processing a RST or other commands e disables the effect of a prior OPC command and e terminates the holdoff action of a WAI OPC or data query MEASure query READ query FETCh query CALC DATA CALC2 LIM FAIL waiting for pending operation to complete Also a front panel initiated diagnostic or calibration may be aborted for example if the front panel diagnostic or calibration is waiting for user input Programming Guide 4 31 Chapter 4 Command Reference DIAGnostic Subsystem DIAGnostic Subsystem This subsystem controls the remote calibration of the Counter All of the calibration values with the exception of the interpolator values are stored in non volatile memory and are unaffected by power on save recall and RST Any of the commands which per
236. of the result 1E 24 to 1E 11 sec value which indicates 3 to 15 digits of resolution for the specified lt expected value gt lt resolution gt should use a mantissa of 1 0 and be an even power of 10 value which indicates 4 digits of resolution for the specified lt expected_value gt 1 1 2 1 3 1 4 69 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage PHASe 1 2 Measures Phase The measurement arming is coupled to auto The trigger settings are coupled so that both channels 1 and 2 have auto trigger enabled at 50 with a positive slope lt source_list gt range 1 2 default 1 2 MEASure SCALar VOLTage PTPeak 1 2 Measures Peak to Peak Voltage lt source_list gt range 1 1 2 default 1 MEASure SCALar VOLTage PWIDth lt reference gt 1 Measures Positive Pulse Width The measurement arming is coupled to auto The lt reference gt specifies the point on the pulse where the positive pulse width is determined This point can be specified as either a percentage or an absolute voltage The default units are percent The lt reference gt parameter is used to configure the trigger settings When the lt reference gt is specified as a percentage or defaulted auto trigger is enabled and auto trigger lev
237. ommand with the same name as a macro The value of the numeric parameter determines whether the defined macros are enabled or disabled A value that rounds to an integer value of zero disables any defined macros A value that rounds to an integer value not equal to zero enables any defined macros 32767 to 32767 1 e Single ASCII encoded byte 0 or 1 e A value of zero indicates that macros are disabled and a value of one indicates that macros are enabled e RST 0 disabled e This value is unaffected by save recall e Macros are disabled at power on 41260 Programming Guide Chapter 4 Command Reference Introduction ESE lt NRf gt Standard Event Status Enable Command ESE Standard Event Status Enable Query ESE lt NRf gt ESE lt NRf gt Range lt NRf gt Resolution Query Response Comments Sets or queries the Standard Event Status Enable Register shown in Figure 4 4 The parameter and query response value when rounded 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 Figure 4 4 The Standard Event Status Enable Register See the section titled Standard Event Status Register Group
238. ommand has no affect on the following measurements Risetime Falltime Duty Cycle and Pulse Width Gate amp ExtArm SENSe TINTerval ARM ESTOP LAYer 1 TIMer lt numeric_value gt Range lt numeric_value gt Resolution Query Response Comments Related Front Panel Keys lt numeric_value gt S Sets or queries the time used to delay the stop arm for Time Interval measurements For short delay 100E 9 to 0 999 999 9 seconds For long delay 1 000 to 10 000 seconds For short delay 100E 9 seconds For long delay 1E 3 seconds Numeric data transferred as ASCII bytes in lt NR1 gt format e RST 100E 9 S e Only applies when SENS TINT ARM ESTOP LAYer 1 SOUR TIM is selected e The SENS TINT ARM ESTOP LA Yer 1 TIM command has no affect on the following measurements Risetime Falltime Duty Cycle and Pulse Width Gate amp ExtArm Programming Guide 4 103 Chapter 4 Command Reference SENSe Subsystem SENSe TOTalize Subtree This subtree controls the Totalize measuring capabilities of the instrument SENSe TOTalize ARM Subtree This subtree is used to synchronize the Totalize start and stop arm with events The following combination of start stop arming sources are valid STARt SOURce STOP SOURce Front Panel Gating Settings GATE a EXTernal EXTernal EXTERNAL POS NEG EXTernal EXTERNAL TIME SENSe TOTalize ARM STARt SLOPe POSitive NEGative Query Response Co
239. on SdevS seconds 703 Put counter is local Programming Guide 3 67 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Read and Store Calibration Information HP BASIC 10 This program reads the calibration data for the counter into an array 20 Before calibrating the counter it is a good idea to read 30 and store the current values in case something goes wrong with the 40 calibration 50 In this program the calibration values are stored in the array cal_data 60 Normally you would store the calibration data on a disk for safe 70 keeping The calibration values should only be changed by running the 80 calibration diagnostics 90 1 100 DIM Cal_data 57 Array to hold calibration data 110 DIM Err_string 255 Array to hold error message T20 CLEAR SCREEN 130 ASSIGN Count TO 703 Assign I O path for HP 53131A 140 CLEAR Count 150 OUTPUT Count RST Reset the HP 53131A 160 OUTPUT Count CLS Clear event registers and error queue 170 OUTPUT Count SRE 0 Clear service request enable register 180 OUTPUT Count ESE 0 Clear event status enable register 190 OUTPUT Count STAT PRES Preset enable registers and 200 transition filters for operation and 210 questionable status structures
240. ontinued commana noaa Parameter Sm INITiate AUTO lt Boolean gt OFF INITiate CONTinuous lt Boolean gt OFF 1 INPut 1 2 ATTenuation 1 10 INPut 1 2 COUPling AC DC AC INPut 1 2 FILTer LPASs STATe lt Boolean gt OFF INPut 1 2 IMPedance lt numeric_value gt OHM 1E6 OHM SENSe EVENt 1 2 HYSTeresis RELative lt numeric_value gt PCT 100 PCT SENSe EVENt 1 2 LEVel ABSolute AUT lt Boolean gt ON O lt numeric_value gt PCT 50 PCT SENSe EVENt 1 2 LEVel RELative POSitive NEGative POSitive SENSe EVENt 1 2 LEVel SLOPe INPut1 INPut2 INPut2 SENSe EVENt2 FEED i e Separate mode POSitive NEGative POSitive SENSe FREQuency ARM STARt SLOPe IMMediate EXTernal IMMediate SENSe FREQuency ARM STARt SOURce lt numeric_value gt 4 SENSe FREQuency ARM STOP DIGits POSitive NEGative NEGative SENSe FREQuency ARM STOP SLOPe IMMediate EXTernal TIMer DIGits TIMer SENSe FREQuency ARM STOP SOURce lt numeric _value gt S 100E 3 S SENSe FREQuency ARM STOP TIMer ON ON SENSe FREQuency EXPected 1 2 3 AUTO lt sensor_function gt FREQuency 1 SENSe FUNCtion ON POSitive NEGative POSitive SENSe PHASe ARM STARt SLOPe IMMediate EXTernal IMMediate SENSe PHASe ARM STARt SOURce ON OFF ONCE ON SENSe ROSCillator EXT ernal CHECk lt Boolean gt ON SENSe ROSCillator SOURce AUTO For prior firmware revisions 3317 3335
241. or CALibration ALL failed DIAGnostic CALibration ROSCillator AUTO ONCE failed DIAGnostic CALibration TINTerval QUICk failed A measurement calibration failed on the last measurement Interpolator calibration failed on the last measurement therefore no valid measurement was taken You have selected external reference and there is no external reference applied to the rear panel Ref In connector or the external signal is not an allowed frequency You have selected the auto reference mode and the Counter detected that the external reference became invalid during the measurement Therefore the current result is not valid and the Counter switches to using the internal reference RCL failed RCL failed because the register specified for recall is empty SAV failed or RCL couldn t save to register 0 A request to update a setting which is stored in the EEPROM SYST COMM SER TRAN BAUD SYST COMM SER TRAN PAR SYST COMM SER TRAN PACE SYST COMM SER CONT DTR DISP WIND TEXT RAD CAL DATA or DIAG CAL resulted in a hardware failure Programming Guide Index 9 91E37 3 17 A abort 4 4 abbreviated commands 3 9 address HP IB 3 4 Applications 1 8 arbitrary block 3 11 ASCII 4 41 ASCII format 3 59 Assumptions 1 9 auto trigger 4 44 4 45 4 83 B Boolean 3 11 C calibrating status bit 3 30 calibration 4 26 reference oscillator 4 34 remote 4 32 security code 4 28 securit
242. or Math will not result in an automatic re calculation There are two things you can do to make sure the results are updated One is to send the command CALC IMM AUTO ON after the RST command This will cause the results to be updated whenever a limit scale or offset value is changed The benefit with this command is that you only have to send this command once and the Counter will always return data that reflects the current limit or scale offset settings One potential drawback is that results you may not care about can occur possibly causing an unexpected event like an SRQ or out of limit condition For example if you wanted to change the scale and offset you might first send the scale value With CALC IMM AUTO ON the scale value will be immediately applied before the offset value is received You may not care what this scaled only value is but it may cause an out of limit condition which may in turn cause an SRQ neither of which you might have expected The other option is to program the Counter to update post processed results only when you tell it to This is accomplished by sending the command CALC IMM after you send all of the limits or scale offset values This way no intermediate Programming Guide 3 49 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter for Math Limit Operations results are calculated The only drawback with this command is that you must always send it when
243. or Types Table 5 2 Errors Continued Invalid string data String data not allowed Block data error Invalid block data Block data not allowed Expression error Invalid expression Expression data not allowed Invalid outside macro definition Invalid inside macro definition Execution error Trigger error Trigger ignored Init ignored Parameter error Settings conflict Data out of range Too much data 5 8 A string data element was expected but was invalid for some reason For example an END message was received before the terminal quote character A string data element was encountered but was not allowed by the Counter at this point in parsing This error can be generated when parsing a block data element This particular error message is used if the Counter cannot detect a more specific error A block data element was expected but it was not allowed by the Counter at this point in parsing A legal block data element was encountered but was not allowed by the Counter at this point in parsing This error can be generated when parsing an expression data element It is used if the Counter cannot detect a more specific error The expression data element was invalid see IEEE 488 2 For example unmatched parentheses or an illegal character Expression data was encountered but was not allowed by the Counter at this point in parsing Indicates that a macro parameter placeholder lt number gt was encountered o
244. ot been invalidated e Result will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used numeric data is transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range from 1 to 15 depending on the measurement resolution e If no valid result exists Not a Number 9 91E37 is returned and error 230 is generated e If this query is executed while an automatically armed Totalize measurement is in progress Not a Number 9 91E37 is returned and error 221 is generated ABORt should be used to terminate the measurement and avoid this error Query only SENSe EVENt 112 Subtree This subtree defines the trigger event For Frequency this is the event which is counted for Time Interval this is the start stop edge These trigger events are fed to the sensor function In separate the EVENt1 subtree is fed the INPut1 signal and the EVENt2 subtree is fed the INPut2 signal in common the INPut1 signal is fed to both the EVENt1 and EVENt2 subtrees When you are measuring Voltage Peaks none of the SENSe EVENt settings are used 4 80 Programming Guide Chapter 4 Command Reference Introduction SENSe EVENt2 FEED JINPut 1 INPut2 Query Response Comments Related Front Panel Keys Sets or queries the common separate enable Feeding the INPut2 subsystem to the SENSe EVENt2 subsystem corresponds to separate feeding the INPut1
245. otherwise error 221 is generated If the CHECk ONCE does not detect a valid timebase error 2009 is generated After the check is completed this command s parameter is set to OFF 492 Programming Guide Query Response Comments Chapter 4 Command Reference Introduction A sequence of ASCII encoded bytes ON or OFF e RST ON e Use this command when SENS ROSC SOUR EXT has been sent e This value is unaffected by save recall SENSe ROSCillator EXTernal FREQuency Query Response Comments Queries the frequency value of the external reference oscillator e Numeric data transferred as ASCII bytes in lt NR3 gt format with six significant digits e Range is 1E6 to 10E6 e Units are Hertz e If the current reference timebase is external but the frequency is not known because it is not 1 5 or 10 MHz and SENS ROSC SOUR AUTO is OFF Not a Number 9 91E37 is returned e If the current reference timebase is internal Not a Number 9 91E37 is returned Query only SENSe ROSCillator SOURce INTernal EXTernal Query Response Sets or queries current reference timebase 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 Ref In connector is the reference timebase A sequence of ASCII encoded bytes INT or EXT Programming Guide 4 93 Comments Related Front Panel Keys Chapter 4 Comm
246. page 3 24 in Chapter 3 of this guide for a detailed description of the Standard Event Status Register 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 save recall Programming Guide 4 127 Chapter 4 Command Reference ESR Event Status Register Query ESR Event Status Register Query ESR Query Response Queries the Standard Event Status Register shown in Figure 4 5 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 That is they cannot be cleared even if they do not reflect the current status of a related condition until they are read 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 Figure 4 5 Standard Event Status Register See the section titled Standard Event Status Register Group page 3 24 in Chapter 3 of this guide for a detailed description of the Standard Event Status Register e Numeric data transferred as ASCII bytes in lt NR1 gt format
247. pg 3 7 e Elements of SCPI Commands pg 3 8 e Using Multiple Commands pg 3 13 e Overview of Response Message Formats pg 3 15 e Status Reporting pg 3 18 e Command Settings for Optimizing Throughput pg 3 20 e How to Program the Counter for Status Reporting pg 3 38 e How to Program the Counter to Display Results pg 3 43 e How to Program the Counter to Synchronize Measurements pg 3 46 e How to Program the Counter for Math Limit Operation pg 3 49 e How to Program the Counter to Define Macros pg 3 52 e Writing SCPI Programs pg 3 55 e Programming Examples pg 3 58 Where to Find Some Specific Information e To Set the HP IB Mode and Address pg 3 4 e To Connect the Counter to a Computer pg 3 6 e Remote Local Operation pg 3 6 e Common Command Format pg 3 7 e SCPI Command and Query Format pg 3 7 e Abbreviated Commands Keyword Separator pg 3 9 e Optional Keyword pg 3 9 e Implied Channel Optional Numeric Keyword Suffix pg 3 10 e Parameter Types pg 3 10 3 2 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands e Parameter Separator Query Parameters Suffixes e Command Terminator e Program Messages e Response Messages Response Message Syntax Where to Find HP BASIC Programming Examples e Easiest Way to Make a Measurement e To Make a Frequency Measurement e To Perform Limit Testing e To Measure the Statistics of 50 Measurements e To Use Limits to Filter Data Before
248. ple Commands 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 as a sequence of ASCII data messages Program Message Syntax Figure 3 4 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 separate adjacent commands with a semicolon Subspstem Command NOTE lt new line gt ASCII character decimal 10 SEND EOI asserted concurrent with last byte Figure 3 4 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 INP COUP AC When multiple subsystem commands are sent in one program message the first command is always referenced to the root node Subsequent commands separated by are referenced to the same level as the preceding command if no is present immediately after the command separator the semicolon 3 14 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands For example sending INP COUP AC IMP 50 is equivalent to sending INP COUP AC INP IMP 50 or INP COUP AC INP IMP 50 The must b
249. put coupling FILTer Subtree Allows a low pass filter to be inserted in the path of the measurement signal LPASs Subtree Controls the Low PASs filter STATe lt Boolean gt Sets the Low PASs filter enable FREQuency Query only Returns the cutoff frequency of the low pass filter Units are Hertz IMPedance lt numeric_value gt Sets input impedance 50 Q or 1 MQ OHM INPut3 Subsystem Queries the characteristics of the Counter s input channel 3 COUPling Query only Returns channel 3 input coupling IMPedance Query only Returns channel 3 input impedance MEASure sid St See Measurement Instructions in this table Programming Guide 2 29 Chapter 2 Command Summary HP 53131A 132A Command Summary Table 2 2 HP 53131A 132A SCPI Command Summary Continued New Measurement Instructions CONFigure SCALar lt function gt See lt parameters gt and Configures instrument to perform lt source _list gt in table specified measurement on the next page CONFigure Returns function configured by the last CONF or MEAS command MEASure SCALar lt function gt See lt parameters gt and Configures instrument initiates lt source _list gt in table measurement and queries for the result on the next page i e provides complete measurement sequence READ SCALar lt function gt of Initiates measurement and queries for the result Performs a FETCh on fresh FETCh SCALar
250. r Voltage Peaks 0 is returned and error 221 is generated CALCulate2 LIMit FCOunt LOWer Queries the number of limit test failures that is the Fail COunt at the lower limit e Numeric data transferred as ASCII bytes in lt NR1 gt format e If CALC2 LIM STATe is OFF 0 is returned and error 221 is generated e Tfno valid result exists 0 is returned and error 230 is generated e If the current measurement is Totalize or Voltage Peaks 0 is returned and error 221 is generated Query only CALCulate2 LIMit FCOunt TOTal Query Response Comments Queries the total Fail COunt that is the number of measurements that have failed the limit test No failures is indicated by 0 e Numeric data transferred as ASCII bytes in lt NR1 gt format e If CALC2 LIM STATe is OFF 0 is returned and error 221 is generated e Tfno valid result exists O is returned and error 230 is generated e Ifthe current measurement is Totalize or Voltage Peaks 0 is returned and error 221 is generated Query only CALCulate2 LIMit FCOunt UPPer Query Response Queries the number of limit test failures that is the Fail COunt at the upper limit e Numeric data transferred as ASCII bytes in lt NR1 gt format e If CALC2 LIM STATe is OFF 0 is returned and error 221 is generated e Tfno valid result exists 0 is returned and error 230 is generated e If the current measurement is Totalize or Voltage Peaks 0 is returned and
251. r when the measurement is complete The output of this register is summarized in the Status Byte Register In order for the Service Request Register to summarize that input the SRE 128 command must be used This enables the Servic Request Register to assert the SRO line when the measurement is complete Note that the OPC command must be sent at the start of every measurement The SUB sendhp sends commands to the counter ECLARE SUB sendhp code REM SINCLUDE QBSETUP BAS DIM SHARED source AS LONG DIM samples AS INTEGER DIM maximum AS STRING 23 DIM minimum AS STRING 23 DIM mean AS STRING 23 DIM sdev AS STRING 23 maxelemS 23 actual 0 samples 50 source 703 isc amp state 1 priority 1 I N Il CLS CALL IOEOI isc amp state CALL IOCLEAR source amp CALL sendhp RST CALL sendhp CLS CALL sendhp SRE 0 CALL sendhp ESE 0 CALL sendhp STAT PRES 3 80 Required by HP 82335A Address and select code Number of measurements Strings for statistics The maximum number of characters that can ever be sent is 23 Maximum number of characters expected Returns actual characters received Number of statistics measurements Counter at address 3 Select code 7 Used in IOEOI Used in IOPEN Make sure EOI enabled Reset
252. ram shows you how to perform a TIME 20 using HP IB There are two types of Time Interval calibration 30 a quick calibration 40 a FINE calibration requiring a more complex signal but producing 50 a better result Both calibrations are coded below 60 When you perform a 70 include storing a backup copy of old calibration data using 80 the security system to UNS 90 using the security system to SECURE the counter after calibration 100 These tasks are coded below 110 120 PROGRAM SHOWS 130 FINE Time Interval Calibration 140 QUICK Time Interval Calibration 150 160 Storing current cal L70 Restoring the backup calibration values 180 190 SECURING and UNSECURING the counter 200 210 220 DIM Cal_data 57 Array to hol 230 DIM Err_string 255 Array to hol 240 CLEAR SCREEN 250 ASSIGN Count TO 703 260 ASSIGN Cal TO 708 270 280 l 290 GOSUB Init 300 GOSUB Store_cal 310 GOSUB Unsecure 320 330 INPUT Which calibration QUICK or FINE Answer 340 IF AnswerS 1 1 f OR AnswerS 1 1 F THEN 350 GOSUB Cal_fine 360 ELSE 370 GOSUB Cal_quick 380 END IF 390 400 GOSUB Restore_cal 410 GOSUB Resecure 420 GOTO End 430 Init Programming Guide 3 69 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 900
253. ramming Guide 3 27 Chapter 3 Programming Your Universal 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 contents To read the condition registers use STATus OPERation CONDition STATus QUEStionable C ONDition 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 transition filter specifies a negative transition the event becomes TRUE when its associated condition makes a TRUE to FALSE transition only When the transition filter specifies either a positive or 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 a positive and negative transition filter register Table 3 6 describes how the transition filter registers define the transition criteria for setting an event bit TRUE Table 3 6 Transition Filter Definition Positive Negative Transition Transition Transition Which Causes the Filter Bit Filter Bit Event Bit to be set TRUE FALSE FALSE neither transition e
254. rcpy destination FREQ EXP1 Copy string sprintf amp destination strlen destination e exp_freq Append xpected frequency value sendhp destination Send th xpected frequency This number must be within 10 of the Ch 1 input frequency Using this greatly increases throughput but is not recommended for signals that change by more than 10 puts Transferring and processing data n for i l i lt readings i IOTRIGGER ctr IOENTERS ctr fregq i amp length printf Measurement complete getch Programming Guide Trigger the counter and read the data Press a key to continue n 3 97 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Optimize Throughput Turbo C Continued Function to send command to HP 53131A void sendhp hpib_cmd char hpib_cmd char hpcmd 80 Variables used by function int length strcpy hpcmd hpib_cmd length strlen hpcmd error IOOUTPUTS ctr hpemd length Send command to HP 53131A if error 0 printf Error during HP IB d Command s n error hpcmd 3 98 Programming Guide Command Reference A Dictionary Chapter 4 Command Reference Introduction Introduction This chapter describes the SCPI Subsystem commands and the IEEE 488 2 Common commands for the HP 53131A 132A 225 MHz Universal Counter The i
255. re SCALar VOLTage NWIDth lt reference gt 1 Measures Negative Pulse Width The measurement arming is coupled to auto The lt reference gt specifies the point on the pulse where the negative pulse width is determined This point can be specified as either a percentage or an absolute voltage The default units are percent The lt reference gt parameter is used to configure the trigger settings When the lt reference gt is specified as a percentage or defaulted auto trigger is enabled and auto trigger levels are set to the specified or defaulted reference value When the lt reference gt is specified in volts auto trigger is disabled and the absolute trigger levels are set to the specified reference value lt reference gt percent range 0 to 100 PCT percent resolution 10 voltage range For volts if X1 Attenuation 5 125V to 5 125V For volts if X10 Attenuation 51 25V to 51 25V voltage resolution For volts if X1 Attenuation 005V For volts if X10 Attenuation 05V default 50 PCT lt source_list gt range 1 default 1 Programming Guide 4 67 Chapter 4 Command Reference Measurement Instructions CONFigure FETCh MEASure READ Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage PERiod lt expected_value gt lt resolution gt 1 2 3 Measures Period The measurement arming mode is set to digits The Counter u
256. re calibration allowed 1 secure calibration disallowed CONFigure Po Std See Measurement Instructions in this table DIAGnostic Subsystem CALibration Subtree INPut 1 2 Subtree 1 2 specifies channel GAIN Subtree AUTO ONCE OFF ONCE calibrates input gain OFFSet Subtree AUTO ONCE OFF ONCE calibrates input offset INTerpolator Subtree AUTO ONCE OFF ON ONCE calibrates the interpolators Programming Guide 2 27 Chapter 2 Command Summary HP 53131A 132A Command Summary Table 2 2 HP 53131A 132A SCPI Command Summary Continued New DIAGnostic Cont CALibration Cont ROSCillator Subtree ROSCillator is an abbreviation for Reference OSCillator AUTO ONCE OFF ONCE calibrates the timebase This command is usable only if the instrument contains the medium or high stability oscillator option STATus Query only Returns status of last calibration 0 pass 1 fail TINTerval Subtree FINE 1 2 3 4 Event no query Four steps which calibrate out Ch1 2 electrical path length differences QUICk Event no query Calibrates out Ch1 2 electrical path length differences DISPlay Subsystem Controls the selection and presentation of textual information on the display ENABle lt Boolean gt Controls whether the whole display is visible MENU Subtree STATe OFF Sets the Counter to switch from the menu display to the result display WINDow Subtree TEXT Subtree Allows
257. rement channel s 4 56 Programming Guide Chapter 4 Command Reference Introduction READ SCALar lt function gt This query provides a method of performing a FETCh on fresh data A common application is to use this command in conjunction with a CONFigure to provide a capability like MEASure in which the application programmer is allowed to provide fine adjustments to the instrument state by issuing the corresponding commands between the CONFigure and READ When SCALar lt function gt is specified the instrument will retrieve the specified result if it matches the current measurement type or can be derived from the current measurement type The only functions which can be derived from a different measurement type are e frequency to from period e voltage minimum to from voltage maximum e voltage minimum to from voltage peak to peak and e voltage maximum to from voltage peak to peak When SCALar lt function gt is omitted the function specified used by the last CONFigure MEASure READ or FETCh will be used if possible This behavior is apparent when switching between frequency and period or when switching among the voltage peaks functions Issuing this query while a measurement is in progress will result in this query aborting the current measurement and idling the measurement cycle before initiating the desired measurement and then waiting for the measurement to complete Consequently this has the
258. rizes the Counter s programming commands It provides you with front panel to SCPI command maps SCPI conformance information and command summary tables e Chapter 3 Programming Your Universal Counter for Remote Operation describes how to 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 will want your Counter to perform e Chapter 4 Command Reference is a dictionary that describes the SCPI subsystems and IEEE 488 2 Common commands e Chapter 5 Errors lists all the error messages the Counter can generate and what caused the error e 6Index Assumptions This guide assumes the Counter is correctly installed and interfaced to an external computer If it is not see IEEE HP IB Interconnection information in Hewlett Packard Company Tutorial Description of the Hewlett Packard Interface Bus 1987 See the following section in this chapter titled Related Documentation for ordering information As previously mentioned this guide also assumes you are familiar with the front panel operation of the Counter See the HP 53131A 132A Operating Guide for detailed information about front panel operation Knowing how to control the Counter from the front panel and understanding the measurements you wish to perform makes the programming task much eas
259. rmation on protocol that is beyond the need of most programmers However it can be useful to clarify formal definitions of certain terms used in related documents Programming Guide Chapter 1 Before You Start Programming Guide Contents 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 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 type 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 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
260. rogramming instructions when properly installed on that instrument HP does not warrant that the operation of the instrument or software or firmware will be uninterrupted or error free Limitation of Warranty The foregoing warranty shall not apply to defects resulting from improper or inadequate maintenance by Buyer Buyer supplied software or interfacing unauthorized modification or misuse operation outside the environmental specifications for the product or improper site preparation or maintenance NO OTHER WARRANTY IS EXPRESSED OR IMPLIED HP SPECIFICALLY DISCLAIMS THAT IMPLIED WARRANTIES OR MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Exclusive Remedies THE REMEDIES PROVIDED HEREIN ARE BUYER S SOLE AND EXCLUSIVE REMEDIES HP SHALL NOT BE LIABLE FOR ANY DIRECT INDIRECT SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES WHETHER BASED ON CONTRACT TORT OR ANY OTHER LEGAL THEORY Assistance Product maintenance agreements and other customer assistance agreements are available for Hewlett Packard products For any assistance contact your nearest Hewlett Packard Sales and Service Office Safety Considerations contd WARNING ANY INTERRUPTION OF THE PROTECTIVE GROUNDING CONDUCTOR INSIDE OR OUTSIDE THE INSTRUMENT OR DISCONNECTING THE PROTECTIVE EARTH TERMINAL WILL CAUSE A POTENTIAL SHOCK HAZARD THAT COULD RESULT IN PERSONAL INJURY GROUNDING ONE CONDUCTOR OF A TWO CONDUCTOR O
261. ront Panel Keys This event command calibrates out the differences in electrical path length between channels 1 and 2 Before sending this command connect to channel 1 a square wave of approximate frequency 10 MHz but more importantly with a rapid rise time e No query e The calibration values are stored in non volatile memory and are unaffected by power on save recall and RST e Use DIAG CAL STAT to check for successful calibration Scale and Offset POWER Calibration menu 4 36 Programming Guide Chapter 4 Command Reference Introduction DISPlay Subsystem This subsystem controls the selection and presentation of textual information on the Counter s display This information includes measurement results DISPlay is independent of and does not modify how data is returned to the controller See the section titled How to Program the Counter to Display Results in Chapter 3 of this guide DISPlay ENABle lt Boolean gt Query Response Comments Sets or queries whether the whole display text area annunciators and indicators with the exception of Remote and SRQ is visible e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON e RST ON e This value is unaffected by save recall DISPlay MENU STATe OFF Query Response Comments This command which only allows the OFF parameter disables the menu display When the menu display is disabled the res
262. ror in the queue has been read SYST ERR query or the queue was cleared by power on or CLS Command Error An lt error number gt in the range 100 to 199 indicates that an IEEE 488 2 syntax error has been 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 One of the following events has occurred e An IEEE 488 2 syntax error has been detected by the 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 e An unrecognized header was received Unrecognized headers include incorrect Counter specific headers and incorrect or unimplemented IEEE 488 2 Common Commands e A Group Execute Trigger GET was entered into the input buffer inside of an IEEE 488 2 program message 5 4 Programming Guide Chapter 5 Errors Error Queue 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
263. rwrite the HP IB error messages 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 Positive error numbers are specific to the Counter Negative error numbers are command language related and are discussed later in this chapter All errors set a corresponding bit in the Standard Event Status Register see the section titled Standard Event Status Register Group on page 3 2 4 of Chapter 3 The following short program reads all errors one at a time oldest to newest from the error queue After each error is read it is automatically erased from the error queue When the error queue is empty that is all errors have been read from the queue further queries return the 0 No error response 5 2 Programming Guide Chapter 5 Errors Error Queue 10 ASSIGN Cnitr TO 703 20 Assign path name 30 DIM Err_string 255 40 Creates array for error string 50 REPEAT 60 Repeats until error queue is empty 70 OUTPUT Cnitr SYST ERR 80 Read error number and string 90 ENTER Cntr Err_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 Error Queue As errors are detected they are placed in an error q
264. s disabled The condition bit is FALSE when automatic interpolator calibration is enabled Bits 3 4 are not used Bit 5 Frequency is a condition bit which indicates that Frequency measurements this does not include the Frequency Ratio measurements may be affected by the disabling of automatic interpolator calibration The condition bit is TRUE when automatic interpolator calibration is disabled The condition bit is FALSE when automatic interpolator calibration is enabled Bit 6 Phase is a condition bit which indicates that Phase measurements may be affected by the disabling of automatic interpolator calibration The condition bit is TRUE when automatic interpolator calibration is disabled The condition bit is FALSE when automatic interpolator calibration is enabled Bit 7 is not used Bit 8 Calibration Error is an event bit which indicates that one of the following has occurred 1 an HP IB invoked calibration failed 2 a front panel invoked calibration failed 3 an automatic interpolator calibration failed during the measurement cycle or 4 an automatic measurement calibration failed during the measurement cycle Since this is an event bit the transition filters have no effect on this bit Bit 9 is not used Programming Guide 3 33 Chapter 3 Programming Your Universal Counter for Remote Operation Status Reporting 3 34 Bit 10 Out of Limit Event is an event bit indicating the last measurement limit tested
265. s 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 e 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 enabled 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 23 Chapter 3 Programming Your Universal Counter for Remote Operation Status Reporting Standard Event Status Register Group StarcardEvet Stunde d Evert Erbe Fogat Stabs Feegster Figure 3 8 Standard Event Status Reporting Standard Event Status Register The Standard Event Status Register contain
266. s are to be cleared with each INITiate IMMediate and INITiate CONTinuous ON operation Query Response e Comments e Single ASCII encoded byte 0 or 1 A value of 0 indicates OFF a value of 1 indicates ON RST ON When AUTO is ON the Counter will perform the following whenever INIT IMM or INIT CONT ON is executed Invalidate the limit data Clear CALC2 LIM FAIL CALC2 LIM FCOunt and CALC2 LIM PCOunt information Turn off the front panel display s Limit annunciator Set the Limit Detect output of the RS 232 connector to the in limit voltage level When AUTO is OFF the only way to clear the limit test results is to send CALC2 LIM CLE IMM CALCulate2 LIMit CLEar IMMediate This command is an event that causes the Counter to immediately invalidate the limit data clear the information in CALC2 LIM FAIL CALC2 LIM FCOunt and gt CALC2 LIM PCOunt turn off the front panel display s Limit annunciator and set the Limit Detect output to its in limit voltage level Comments If CALC2 LIM STAT is OFF error 221 is generated Programming Guide 4 13 Chapter 4 Command Reference CALCulate2 Subsystem CALCulate2 LIMit DISPlay GRAPh NUMBer Query Response Comments Related Front Panel Keys Sets or queries whether the measurement display is numeric or symbolic on a graph When CALC2 LIM DISP is NUMBer the measurement results are displayed numerically When CAL
267. s bits that monitor specific IEEE 488 2 defined events as shown in Figure 3 8 Use ESR to read this register Use ESR or CLS to clear this register Table 3 5 lists the Standard Event Status Register bits and briefly describes each bit Table 3 5 Standard Event Status Register m SYMBOL DESCRIPTION ee e Operation Complete RQC Not used because this instrument cannot request permission to become active IEEE 488 1 controller in charge e e ooe ewespecicEre URQ Not used because this instrument does not define any local controls as User Request controls 3 24 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands 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 If there are no pending operations at the time OPC executes this bit sets immediately If there is a pending operation at the time OPC executes this event bit sets when the pending operation condition transistions from TRUE to FALSE If the TRIGger COUNt AUTO is OFF or statistics are disabled or the function is set to Totalize or Voltage Peaks then the pending operation condition is set TRUE when either 1 a single measurement is initiated or 2 a continuous measurement
268. sed in the following sub sections To Send a Double Quoted String For the HP BASIC OUTPUT statements remember that strings enclosed in double quotes need special consideration For example send the FUNC FREQ 1 command with the following OUTPUT 703 FUNC FREO TWN Note that a pair of double quotes as shown in bold is required by HP BASIC to embed a double quote within an HP BASIC string To Send a Single Quoted String For more readable HP BASIC OUTPUT statements you may send for example the following OUTPUT O03 FUNG FREQ 1 Note the pair of single quotes as 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 58 Programming Guide NOTE Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Using QuickBASIC The QuickBASIC examples assume you have an HP 82335A HP IB Interface card inside your IBM PC or compatible Using Turbo C The Turbo 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 Easiest Way to Make a Measurement HP BASIC only 2 To Make a Frequency Measurement 3 To Perform Limit Testing HP BASIC and QuickBASIC only 4 To Measure the Statistics of 50 Measurements HP BASIC and QuickBASIC only pr To Use Limits to F
269. ses the lt expected_value gt and lt resolution gt parameters to configure the number of digits of resolution arming setting The Channel 1 or Channel 2 trigger settings are coupled so that the measurement channel has auto trigger enabled at 50 with a positive slope Ch1 Ch2 lt expected_value gt range 4 4 ns to 10 0 sec resolution lt expected value gt should be within 10 of input period for optimum arming configuration default 100 ns Ch1 Ch2 lt resolution gt description value indicates decade corresponding to least significant digit of the result range 1E 23 to 1E 2 sec value which indicates 3 to 15 digits of resolution for the specified lt expected value gt resolution lt resolution gt should use a mantissa of 1 0 and be an even power of 10 default value which indicates 4 digits of resolution for the specified lt expected_value gt 4 68 Programming Guide Chapter 4 Command Reference Introduction Descriptions of the Measurement Functions lt function gt Cont MEASure SCALar VOLTage PERiod Cont Ch3 lt expected_value gt range resolution default Ch3 lt resolution gt description range resolution default lt source_list gt range default Programming Guide 0 33 ns to 10 0 ns lt expected_value gt should be within 10 of input period for optimum arming configuration 2 ns value indicates decade corresponding to least significant digit
270. sing time arming with a 0 01 second gate time CALC3 CHRS 34 Display stats Display the standard deviation e statistics Do stats on samples ke samples measurements ESE 1 is used so the correct bit is summarized in the Status Byte Register when the measurement is complete Enabl Ta Ws Wait for interrupt Enable OPC bit and start meas Wait here if already made GOTO loophere stats measurements then goto endprogram statsready Ready to read statistics CALL sendhp CALC3 AVERAGE TYPE MIN CALC3 DATA Read them individually CALL IOENTERS source amp minimum maxelem actual CALL sendhp CALC3 AVERAGE TYPE MAX CALC3 DATA CALL IOENTERS source amp maximum maxelem actual CALL sendhp CALC3 AVERAGE TYPE MEAN CALC3 DATA CALL IOENTERS source amp mean maxelem actual CALL sendhp CALC3 AVERAGE TYPE SDEV CALC3 DATA CALL IOENTERS source amp sdev maxelem actual PRINT PRINT Minimum Period minimum PRINT Maximum Period maximum PRINT Mean Period mean PRINT Standard Deviation sdev complete 1 RETURN endprogram All done SUB sendhp code CALL iooutputs source code LEN codeS END SUB Programming Guide 3 81 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Use Limits to Filter Data Before Measuring Stats QuickB
271. st defects in material and workmanship for a period of three years from date of shipment During the warranty period Hewlett Packard Company will at its option either repair or replace products which prove to be defective 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 This product is a safety Class I instrument provided with a protective earth terminal Before Applying Power Verify that the product is set to match the available line voltage and the correct fuse is installed Refer to instructions in Chapter 1 of the Manual Safety Earth Ground An uninterruptible safety earth ground must be provided from the mains power source to the product input wiring terminals or supplied power cable Warning Symbols That May Be Used In This Book Instruction manual symbol the product will be marked with this symbol when it is necessary for the user to refer to the instruction manual Indicates hazardous voltages Safety Considerations contd Indicates earth ground terminal or Indicated terminal is connected to chassis when such connection is not apparent Indicates Alternating current Indicates Direct current WARNING BODILY INJURY OR DEATH MAY RESULT FROM FAILURE TO HEED A WARNING DO NOT PROCEED BEYOND A WARNIN
272. ster to be set One of the following is true e 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 has been lost 5 6 Programming Guide Chapter 5 Errors Error Queue Table 5 2 Errors No error Command error Invalid character Syntax error Invalid separator Data type error GET not allowed Parameter not allowed Missing parameter Program mnemonic too long Undefined header Numeric data error Invalid character in number Exponent too large Too many digits Numeric data not allowed Invalid suffix Suffix too long Suffix not allowed Invalid character data Character data not allowed String data error The 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 e
273. t i int samples 10 EX int length 23 hae char freq 23 IORESET isc sendhp RST sendhp CLS sendhp SRE 0 sendhp ESE 0 sendhp STAT PRES T IOEOI isc state ME sendhp FUNC FREQ 1 sendhp FREQ ARM STAR SOUR sendhp FREQ ARM STOP SOUR sendhp FREQ ARM STOP TIM Select code 7 Used in IOEOI Used for loop counter Number of measurements to take Max number of bytes per measurements to hold frequency string the HP IB interface the counter vent registers and error queue Clear service request enable register event status enable register IMM TIM 1 Programming Guide Preset filters for operation and questionable status structures Enable use of EOI nable registers and transition Measure frequency on channel 1 Note that the function must be a quoted string The actual string sent to the counter is FREQ 1 These 3 lines enable the time arming mode with a 0 1 second gate time 3 91 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Make a Frequency Measurement Turbo C Continued for i l i lt samples i sendhp INIT Start a measurement sendhp FETCH FREQUENCY IOENTERS ctr freq amp
274. t or block of measurements is aborted the Measuring bit in the Operation Status Register will be set false Aborting a measurement in progress invalidates the result with one exception ABORt is the appropriate way to terminate an automatically armed Totalize measurement Stop Single 4 4 Programming Guide NOTE Chapter 4 Command Reference Introduction CALCulate Subsystems Three CALCulate subsystems CALCulate 1 CALCulate2 and CALCulate3 perform post acquisition data processing and data transfer of the corresponding results Functions in the SENSe subsystem are related to data acquisition while the CALCulate systems operate on the data acquired by a SENSe function as shown in Figure 4 1 The CALCulate subsystems are logically between the SENSe subsystem and the data output to either the bus or display When a measurement is initiated by a MEASure READ or an INITiate command the SENSe subsystem collects data This data is transformed by CALCulate 1I2I3 as specified and then passed on to the selected output In effect the collection of new data initiates the CALCulate subsystems The CALCulate subsystems may also be directed by command to transform making it possible to change the configuration of CALCulate and consequently derive a different set of results from the same SENSe data set without re acquiring SENSe data Calculated results are available valid until new results are computed or u
275. t register and an enable register The commands in this subtree allow you to control and monitor these registers See the section titled Operation Status Register Group and Questionable Data Signal Status Register Group on page 3 32 in Chapter 3 for a detailed description of the Operation Status Register Group Bi Figure 4 2 The Operation Status Register Group STATus OPERation CONDition Query Response Comments Queries the status of the Operation Condition Status Register Bits are not cleared when read e Numeric data transferred as ASCII bytes in lt NR1 gt format e Range is 0 to 65 535 e The query response value is an integer formed by the binary weighting of the bits The value of unused bits is zero The Operation Condition Status Register is cleared at power on Programming Guide 4 107 Chapter 4 Command Reference STATus Subsystem STATus OPERation ENABle lt non decimal numeric gt lt NRf gt Range Query Response Comments Sets or queries the Operation Event Status Enable Register The parameter and query response value when rounded to an integer value and expressed in base 2 binary represents the bit values of the Operation 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 Operation Event Status Register events to be summarized in the Status Byte Register bit 7 T
276. ta CALC3 AVERAGE ALL Ask for statistics 3 48 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands How to Program the Counter for Math Limit Operations Updating Math and Limit Results Over HP IB When using the Limits or Math capabilities from the front panel the default power up operation is for results to be automatically updated whenever a value is updated in either the Limit or Scale amp Offset menu For example entering a scale value automatically enables Math and updates the result in the display to reflect the changes Similarly entering either an upper or lower limit automatically enables Limit Testing If after entering a value in either of these menus you do not want limits or math you must go to the appropriate menu item and turn off limits or math When the Counter is programmed there are additional issues that must be addressed The first thing done in most programs is to put the Counter in a known state using RST The RST command resets the Counter One of the things this command does is disable the automatic post processing of Limit and Math operations What this means is that if you set a limit scale or offset value and enable Limits or Math the answer will not be automatically updated to reflect the Limit or Math values Whenever a new measurement is made the result will be updated but if the Counter is in Single mode changing the Limits
277. te_time gt range For short gate time 100E 5 to 999E 5 seconds For long gate time 10E 3 to 1000 000 seconds resolution For short gate time 1E 5 seconds For long gate time 1E 3 seconds default 100 second lt source_list gt range 1 default 1 474000 lt C CO C Programming Guide Chapter 4 Command Reference Introduction 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 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 query to measure frequency Use MEASURE FREQ to execute a default frequency measurement and have the result sent to the controller The Counter will select settings and carry out the required measurement moreover it will automatically start the measurement and send the result to the controller You may add parameters to give more details about the signal you are going to measure Use MEASURE F
278. ter For exemple Une therotiowing INT The ritades the saato measur anart Toresd ihe Statue Byte Peete uwe he fodkewesinng j Ths reac the dezimal value of the Sabu Bute Regate You can alao Use ihe seria Poll command fo readihis vere MISSE perde onwrat data eipected Ee STATUES EVEN This raturre the damal wluo of the oort atar It also daars thee rag ater oc that Hioegent sab con be rcestored bit S BSB is od ue Ine following ESR Ti raure the dedmal value of Iho gr ort tor It as ockoars the rage bar 40 thet Werk canbe mortored K bE T OSE amp set une the oing STATOFEREVEN Ti reture the Gecimel vak of tho erort bet It do OC rs ee rece ber a gt treet werk canbe mortorecdt Piribe thenecessay sub outings bo detemine which events haro occured and what atoro are rogirod Figure 3 10 Status Reporting Flowchart 2 of 2 3 42 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands How to Program the Counter to Display Results Configuring the Counter s Display The Counter has five different display modes 1 Non scaled offset results frequency period time interval etc This display mode is used on power up 2 Scaled offset results results modified by scale and offset values Limit graph a graphical look that shows if a measurement is within limits 4 Statistics mean min max or standard deviation 5 Displa
279. tes a trigger level which corresponds to the auto trigger percentage specified with SENS EVEN 1I2 LEV REL of the specified channel While the enable is set to ON the Counter will measure and compute the measurement channel s trigger level s each time INIT or INIT CONT ON is executed Also for each measurement while the enable is set to ON the Counter will check that the measurement signal s are triggering if no triggering is found the Counter will measure and compute new trigger level s e Single ASCII encoded byte 0 or 1 e A value of 0 indicates OFF a value of 1 indicates ON e RST ON e Explicitly selecting a trigger level with SENS EVEN 1I2 LEV ABS turns AUTO OFF Trigger Sensitivity SENSe EVENt 1 2 LEVel RELative lt numeric_value gt Range Resolution Query Response lt numeric_value gt PCT Sets or queries the percentage of the peak to peak range of the signal at which the instrument auto triggers If SENS EVEN 112 LEV ABS AUTO is ON then when this command executes the Counter automatically measures and computes a trigger level corresponding to the specified percentage of the specified channel 0 to 100 PCT 10 PCT e Numeric data transferred as ASCII bytes in lt NR1 gt format Programming Guide 4 83 Comments Related Front Panel Keys Chapter 4 Command Reference SENSe Subsystem e RST 50 PCT e Only applies when SENS EVEN 1I2 LEV ABS AUTO
280. the counter and interface Reset the counter Clear event registers and error queue Clear service request enable register Clear event status enable register Preset enable registers and transition filters for operation and questionable status structures Programming Guide Continued CALL sendhp FUNC CHRS 34 PER 1 The function must be a quoted string counter is PER 1 CALL sendhp FREQ ARM STAR SOUR IMM CALL sendhp FREQ ARM STOP SOUR TIM CALL sendhp FREQ ARM STOP TIM 01 CALL sendhp DISP TEXT FEED CHRS 34 CALL sendhp CALC3 AVER TYPE SDEV CALL sendhp CALC3 AVER ON CALL sendhp CALC3 AVER COUNT STRS samples CALL sendhp TRIG COUNT AUTO ON CALL sendhp ESE 1 CALL sendhp SRE 32 PRINT Waiting for measurement to complete ON PEN GOSUB statsready PEN ON CALL IOPEN isc amp priortyS CALL sendhp INIT OPC loophere IF complete THI Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Measure the Statistics of 50 Measurements QuickBASIC EN GOTO endprogram CHRS 34 Measure Period The actual string sent to the These 3 lines enable u
281. the data from the counter C3 AVERAGE TYPE S r sdev amp length IOSPOLL ctr amp status puts Trans sendhp IN sendhp CA IOENTERS ct sendhp CA IOENTERS ct sendhp CA IOENTERS c sendhp CA IOENTERS ct printf Mea printf Mini printf Maxi printf Sta pranee getch Sa oS n frequency s imum frequency imum frequency oe ndard deviation s Get the data from the counter mean minimum maximum sdev Press a key to Eee Function to send command to HP 53131A void sendhp hpib_cmd char hpib_cmd char hpcmd 80 int length strcpy hecmd hpib_cmd length eLeor IOOUTPUTS if error 0 printf Error during HP IB strlen hpcmd ctr hpcmd length Programming Guide Variables used by function Send command to HP 53131A d Command s n error hpemd 3 95 Chapter 3 Programming Your Universal Counter for Remote Operation Programming Examples To Optimize Throughput Turbo C This program sets up the counter to transfer data at the fastest possible rate the least Note that the arming mode is AUTO resolution of all the arming modes The program comments discuss the meaning of each command ASCII result format is used to preserve resolution For optimal performance compile for best speed 7 This mode provides
282. ties If you need additional information on any command refer to the applicable command description in Chapter 4 Command Reference Programming Guide 1 7 Chapter 1 Before You Start How to Use This Guide e 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 e If you 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 e If you are going to write programs to transfer data between the Counter and an external computer read the sections titled Overview of Response Message Formats and Command Settings for Optimizing Throughput in Chapter 3 1 8 Programming Guide Chapter 1 Before You Start Programming Guide Contents Programming Guide Contents The following information is contained in this guide e Table of Contents e Chapter 1 this chapter Before You Start is a preface that introduces you to the programming guide e Chapter 2 Command Summary is a quick reference that summa
283. tion of the Counter is for automatic interpolator calibration to occur before every measurement To optimize throughput over the HP IB the automatic calibration can be disabled When it is disabled the most recent calibration values are used These values may not be the optimal values for a particular temperature or other environmental condition For this reason the Time Frequency and Phase bits in the Questionable Data register are set whenever the automatic calibration is disabled In the following Questionable Data Status Register example the first line tells the Counter to detect a transition from negative non questionable data to positive questionable data of bits 2 5 and 6 in the Questionable Data Register The next line tells the Counter to summarize the detected events in the Status Byte Register The command SRE 8 tells the Counter to assert the SRQ line when the summary bit for the Questionable Data register is set to 1 A serial poll will return the value 72 when the automatic calibration transitions from on to off Programming Guide 3 39 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter for Status Reporting Questionable Data Status Register STAT QUES PTR 100 NTRO Detect transition from non questionable to questionable data STAT QUES ENABLE 100 Enable to detect for auto cal off SRE 8 Assert SRQ on Questionable Summary bit Using the Operation Status Register to
284. tive 4 113 trigger 4 84 device 4 124 levels 2 5 2 6 4 82 4 83 sensitivity 2 5 2 6 4 81 slope 2 5 2 6 4 84 trigger command 4 141 trigger events 4 80 Turbo C using 3 59 U Unaffected by RST 2 43 units 3 12 unsecure 4 28 using internal reference status bit 3 30 3 31 using the scale and offset over HP IB 3 50 V V 3 12 version SCPI 4 118 voltage maximum 4 89 minimum 4 89 voltage maximum 4 66 voltage minimum 4 66 W writing programs general 3 55 X x1 4 48 x10 4 48 Programming Guide Technical Support H 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 Hewlett Packard Asia Pacific Ltd 17 21 F Shell Tower Times Square 1 Matheson Street Causeway Bay Hong Kong 852 2599 7070 Australia New Zealand Hewlett Packard Australia Ltd 31 41 Joseph Street Blackburn Victoria 3130 Australia 131 347 ext 2902 Canada Hewlett Packard Canada Ltd 5150 Spectrum Way Mississauga Ontario L4W 5G1 905 206 4725 Japan Hewlett Packard Japan Ltd Measurement Assistance Center 9 1 Takakura cho Hachioji shi Tokyo 192 Japan 81 426 48 3860 Latin America Hewlett Packard Latin American Region Headquarters 5200 Blue Lagoon Drive 9th Floor Miami Florida 33126 U S A 305 267 4245 4220 United States Hewlett Pa
285. ts commands that are unaffected by RST Table 2 3 HP 53131A 132A RST State CALCulate 1 FEED UJSENSe 1 SENSef 1 CALCulate 1 IMMediate AUTO lt Boolean gt OFF CALCulate 1 MATH EXPRession NAME SCALE_OFFSET SCALE_OFFSET CALCulate 1 MATH STATe lt Boolean gt CALCulate2 FEED CALCulate 1 CALCulate2 IMMediate AUT O lt Boolean gt CALCulate2 LIMit CLEar AUTO lt Boolean gt CALCulate 1 CALCulate2 LIMit DISPlay GRAPh NUMBer CALCulate2 LIMit _LOW er DATA lt numeric_value gt CALCulate2 LIMit STATe lt Boolean gt CALCulate2 LIMit UPPer DATA lt numeric_value gt CALCulate3 AVERage COUNt CALCulate3 AVERage STATe CALCulate3 AVERage T YPE lt numeric_value gt lt Boolean gt MAXimum MINimum SDEViation MEAN CALCulate 1 lt numeric_value gt lt Boolean gt lt numeric_value gt CALCulate3 FEED CALCulate3 LFlLter LOW er DATA CALCulate3 LFlLter STATe CALCulate3 LFlLter UPPer DATA 0 0000000000 OFF 0 0000000000 OFF MEAN CALCulate 1 0 0000000000 OFF 0 0000000000 DIAGnostic CALibration INTerpolator AUTO ON OFF ONCE DISPlay ENABle DISPlay MENU STATe OFF lt Boolean gt DISPlay WINDow TEXT FEED CALCulate2 l CALCulate3 2 40 ON OFF CALCulate2 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 3 HP 53131A 132A RST State C
286. ttom of the computer screen to help determin Required by HP 82335A Address and select code HP 53131A at address 3 Select code 7 Make sure EOI Reset the cou Clear event r nabled nter Clear servic gisters and error queue request enable register Clear event s Preset enabl tatus enable register registers and transition filters for operation and questionable status structures Put counter i n Single Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands To Use Macros QuickBASIC Continued ON KEY 1 GOSUB availablememory ON KEY 2 GOSUB enablemacro ON KEY 3 GOSUB displaymacro ON KEY 4 GOSUB querymacro ON KEY 5 GOSUB definemacro ON KEY 6 GOSUB deletemacro ON KEY 7 GOSUB purgemacro ON KEY 8 GOSUB disablemacro ON KEY 9 GOSUB sendmacro ON KEY 10 GOSUB quit loophere GOTO loophere Wait for function key to be pressed availablememory Display available macro memory CALL sendhp MEM FREE MACRO CALL IOENTER source amp freemacro PRINT Available macro memory freemacro RETURN enablemacro Enable all macros sendhp EMC 1 PRINT Macros Enabled RETURN displaymacro Display macros available in counter CLS sendhp LMC CALL IOENTERS source results maxlength actual macros LEF
287. uery 4 133 OPT Option Identification Query 4 134 PMC Purge Macro Command 4 135 RCL lt NRf gt Recall Command 4 136 RST Reset Command 4 137 SAV lt NRf gt Save Command 4 138 SRE lt NRf gt Service Request Enable Command 4 139 SRE Service Request Enable Query 4 139 STB Status Byte Query 4 140 TRG Trigger Command 4 141 TST Self Test Query 4 142 WAT Wait to Continue Command 4 143 5 Errors Introduction 5 2 Displaying Errors 5 2 Reading an Error 5 2 Error Queue 5 3 Error Types 5 4 No Error 5 4 Command Error 5 4 Execution Error 5 5 Device or Counter Specific Error 5 5 Query Error 5 6 x Programming Guide Before You Start Chapter 1 Before You Start Introduction Introduction This programming guide contains programming information for the HP 53131A 132A Universal Counter This guide assumes you are familiar with the front panel operation of the Counter See the HP 53131A 132A 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 wish to perform makes the programming task much easier The operating guide provides explanations and task procedures for all of the Counter s measurement functions and contains the specifications for the Counter By sending Standard Commands for Programmable Instru
288. ueue This queue is first in first out That is if there has been more than one error the first one in the queue is read out with SYST ERR Subsequent responses 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 30 29 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 occur e Upon power on e Upon receipt of a CLS command e Upon reading the last item from the queue Programming Guide 5 3 Chapter 5 Errors Error Types Error Types Error numbers are categorized by type as shown in Table 5 1 Each and every error is listed in Table 5 2 Table 5 1 Error Types ooo oooi ee oO SO 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 the Counter has no errors The error queue is empty when every er
289. uisition limit testing and data transfer Not until CALCulate2 LIMit STATe is set to ON will any of the CALCulate2 settings be used CALCulate2 FEED CALCulate 1 Query Response Comments Sets or queries the data flow to be fed into the CALCulate2 block The string CALC is returned RST CALCulate 1 CALCulate2 IMMediate Comments This command is an event that causes the Counter to recalculate existing data without re acquiring data This recalculation also happens automatically when any change is made to the CALCulate 1I2 subsystems while gt CALC2 IMM AUTO is ON The only limit result that can be truly post processed is CALC2 LIM FAIL The limit counts CALC2 LIM FCO and CALC2 LIM PCO reflect measurements that were limit tested at time of data acquisition This command will not affect gt CALC2 LIM FCO gt CALC2 LIM PCO CALC3 This command causes post processing to occur in the CALCulate 1 subsystem as well as the CALCulate2 subsystem Programming Guide 4 11 Chapter 4 Command Reference CALCulate2 Subsystem CALCulate2 IMMediate AUTO lt Boolean gt Query Response Comments Sets or queries whether post processing recalculation will automatically occur whenever any changes are made to the CALCulate 1I2 subsystems With CALC2 IMM AUTO set to OFF CALCulate 1I2 only produces new results when new SENSe data is acquired or when the CALCulate2 IMMediate co
290. ulated result remains valid until a new computation is made or a relevant instrument state is modified Related Stats Front Panel keys CALCulate3 AVERage CLEar This command is an event that causes the Counter to e invalidate the statistics results e clear the statistics current count to 0 and e report the negative status condition NOT Computing Statistics to bit 8 of the Operation Status Register Comments If CALC3 AVER STATe is OFF error 221 is generated CALCulate3 AVERage COUNt lt numeric_value gt Sets or queries the number of measurements to combine for statistics processing After CALC3 AVER COUNt measurements is reached a new set of CALC3 AVER COUNt measurements must be acquired before another statistics computation will occur lt numeric_value gt 2 to 1 000 000 Range lt numeric_value gt 1 Resolution Query Response Numeric data transferred as ASCII bytes in lt NR1 gt format Comments RST 100 4200 Programming Guide Related Front Panel keys Chapter 4 Command Reference Introduction Stats CALCulate3 AVERage COUNt CURRent Queries the current count that is the number of data values collected for statistical computation Query Response Comments Related Front Panel keys Numeric data transferred as ASCII bytes in lt NR1 gt format Range is 0 to 1 000 000 If CALC3 AVER STATe is OFF error 221 is generated If the current measurement is Totalize or Volta
291. ult 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 a Device Clear See your computer or interface card documentation for how to issue this command 2 Issue the following commands RST CLS SRE 0 ESE 0 STAT PRES 3 38 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Using the Standard Event Status Register to Trap an Incorrect HP IB 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 Register 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 will be 96 Event Status Register ESE 32 Enable for bad command SRE 32 Assert SRQ from Standard Event Status Register summary Using the Questionable Data Signal Status Register to Alert the Computer When Automatic Interpolator Calibration is Disabled Example 3 The default opera
292. ults 3 44 Commands for Displaying the Limit Graph 3 44 Commands for Displaying Statistics Results 3 44 Commands for Enabling and Disabling the Display 3 45 How to Program the Counter to Synchronize Measurements 3 46 Synchronizing Measurement Completion 3 46 Resetting the Counter and Clearing the HP IB Interface 3 46 Using the WAI Command 3 46 Using the OPC Command 3 47 Using the OPC Command to Assert SRQ 3 48 How to Program the Counter for Math Limit Operations 3 49 Updating Math and Limit Results Over HP IB 3 49 Using the Scale and Offset Over HP IB 3 50 How to Program the Counter to Define Macros 3 52 Writing SCPI Programs 3 55 Programming Examples 3 58 Using HP BASIC 3 58 To Send a Double Quoted String 3 58 To Send a Single Quoted String 3 58 Using QuickBASIC 3 59 Using Turbo C 3 59 List of the Programming Examples 3 59 Easiest Way to Make a Measurement HP BASIC 3 60 To Make a Frequency Measurement HP BASIC 3 62 Programming Guide Contents To Perform Limit Testing HP BASIC 3 63 To Measure the Statistics of 50 Measurements HP BASIC 3 64 To Use Limits to Filter Data Before Measuring Stats HP BASIC 3 66 To Read and Store Calibration Information HP BASIC 3 68 To Perform a Time Interval Calibration HP BASIC 3 69 To Optimize Throughput HP BASIC 3 73 To Use Macros HP BASIC 3 75 To Make a Frequency Measurement QuickBASIC 3 77 To Perform Limit Testing QuickBASIC 3 78 To Measure the Statistics of 5
293. ults display appears The query indicates whether the menu display or result display is enabled e Single ASCII encoded byte 0 or 1 e A value of 0 indicates the menu display is disabled the result display is enabled A value of 1 indicates the menu display is enabled the result display is disabled e RST OFF e To enable the menu display use either the front panel keys or the SYST KEY command e This value is unaffected by save recall Programming Guide 4 37 Chapter 4 Command Reference DISPlay Subsystem DISPlay WINDow TEXT FEED CALCulate2 CALCulate3 Sets or queries what data flow is fed into the display Choose from the following lt data_handle gt strings e CALCulate2 should be used to direct any result other than the statistics to the result display Specifically this would select one of the following results for the result display raw measurement if math is disabled CALC MATH STAT OFF the scaled offset measurement if math is enabled CALC MATH STAT ON the limit graph if limit testing is enabled with the graphic display CALC2 LIM STAT ON CALC2 LIM DISP GRAPh e CALCulate3 should be used to direct the statistical result if statistics are enabled CALC3 AVER STAT ON to the result display the particular statistic displayed is determined by CALC3 AVER TYPE Query Response A string is returned CALC2 or CALC3 Comme
294. ur Universal Counter for Remote Operation Programming Examples To Make a Frequency Measurement HP BASIC This program sets up the counter measurements on channel 1 using The results are displayed on the ASCII format is used to preserve Cc 1 INTEGER I DIM Freq 10 22 omputer CRT esolution Declare varia Declare strin Using strings data yields r to make 10 frequency a 0 1 second gate time bles g to enter data to enter ASCII format esults formatted to the correct resolution ASCII is the default format for the counter Samples 10 Take 10 measurements ASSIGN Count TO 703 Assign I O path for counter CLEAR 703 Clear the counter and interface OUTPUT Count RST Reset the counter OUTPUT Count CLS Clear event registers and error queue OUTPUT Count SRE 0 Clear service request enable register OUTPUT Count ESE 0 Clear event status enable register OUTPUT Count STAT PRES Preset enable registers and transition filters for operation and questionable status structures OUTPUT Count FUNC FREQ 1 Measure frequency on channel 1 OUTPUT Count FREQ ARM STAR SOUR IMM These thr lines enabl OUTPUT Count FREQ ARM STOP SOUR TIM Using time arming with a OUTPUT Count FREQ ARM STOP TIM 100 0 1 se
295. urement function e Refer to Table 4 1 in this section for a summary of the lt function gt lt parameters gt and lt source_list gt for each of the measurement functions 45400 Programming Guide Chapter 4 Command Reference Introduction FETCh SCALar lt function gt Query Response This query returns the measurement taken by the INITiate or MEASure query or READ commands When SCALar lt function gt is specified the instrument will retrieve the specified result if it matches the current measurement type or can be derived from the current measurement type The only functions which can be derived from a different measurement type are e frequency to from period e voltage minimum to from voltage maximum e voltage minimum to from voltage peak to peak and e voltage maximum to from voltage peak to peak When SCALar lt function gt is omitted the function specified used by the last CONFigure MEASure READ or FETCh will be used if possible This behavior is apparent when switching between frequency and period or when switching among the voltage peaks functions Issuing this query while a measurement is in progress has the effect of holding off further commands from being processed until the measurement completes This hold off action can only be canceled by the measurement completing Device Clear or power on e Result will be formatted according to FORMat DATA ASCii REAL setting e
296. us QUEStionable NTRansition STATus QUEStionable PTRansition SYSTem COMMunicate SERial CONTrol DTR SYSTem COMMunicate SERial TRANsmit BAUD SYSTem COMMunicate SERial TRANsmit PACE SYSTem COMMunicate SERial TRANsmit PARity TY PE SYSTem ERRor error queue SSYSTem KEY key queue SSYSTem KEY LOG key queue HP IB Address 4 136 Programming Guide Chapter 4 Command Reference Introduction RST Reset Command RST This event command performs an instrument reset The reset performs the following e sets instrument settings to their RST states e disables macros e places instrument in Operation Complete Idle State and Operation Complete Query Idle State and e clears empties the Key Queue The reset does not affect e the macros defined with DMC e the calibration data e the Service Register Enable or the Standard Event Status Enable e the Output Queue and e the IEEE 488 1 address or the state of the IEEE 488 1 interface See the section titled RST Response page 2 36 in Chapter 2 of this guide for a complete listing of the RST state Each command description in this chapter Chapter 4 includes the RST state in the Comment portion of the definition Programming Guide 4 137 Chapter 4 Command Reference SAV lt NRf gt Save Command SAV lt NRf gt Save Command SAV lt NRf gt This command stores the current state of the instrument in local non volatile memory
297. utation is made or a relevant instrument state is modified Programming Guide 4 7 Chapter 4 Command Reference CALCulate 1 Subsystem CALCulate 1 FEED SENSe 1 Query Response Comments Sets or queries the data flow to be fed into the CALCulate 1 block Since the Counter can only sense one function at a time there is only one valid parameter The string SENS is returned RST SENSe 1 CALCulate 1 IMMediate Query Response Comments This command is an event that causes the Counter to recalculate existing data without re acquiring data This recalculation also happens automatically when any change is made to the CALCulate 1I2 subsystems while CALC IMM AUTO is ON CALC IMM is semantically equivalent to CALC IMM DATA The query form outputs the results of the new calculation This command will not affect gt CALC2 LIM FCO gt CALC2 LIM PCO CALC3 e Result will be formatted according to FORMat DATA ASCii REAL setting e When ASCii format is used numeric data is transferred as ASCII bytes in lt NR3 gt format The number of significant digits will range from 1 to 15 depending on the measurement resolution Only significant digits will be returned e Tfno valid result exists Not a Number 9 91E37 is returned and error 230 is generated e Ifthe current measurement is Totalize or Voltage Peaks Not a Number 9 91E37 is returned and error 221 is generated
298. utside of a macro definition Indicates that the program message unit sequence sent with a DMC command is syntactically invalid This is the generic syntax error if the Counter cannot detect more specific errors This code indicates only that an Execution Error has occurred Used if the Counter cannot detect a more specific error from the INIT TRIG or ABOR subsystems Indicates that a GET or TRG was received and recognized by the Counter but was ignored Indicates that a request for a measurement initiation was ignored as another measurement was in progress Indicates that a program data element related error occurred This error is used when the Counter cannot detect more specific errors Indicates that a legal program data element was parsed but could not be executed due to the current Counter state Indicates 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 Indicates that a legal program data element 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 Programming Guide Chapter 5 Errors Error Queue Table 5 2 Errors Continued Illegal parameter value Data corrupt or stale Hardware error Hardware missing Macro execution error Illegal macro label Macr
299. value gt S POSitive NEGative EXTernal MMediate Programming Guide Sets the selection of a reference timebase Sets the enable for automatically selecting a reference timebase Subtree Controls the time interval including Time Interval Rise Time Fall Time Dutycycle and Pulse Width functions measuring capabilities of the instrument Subtree Synchronizes the time interval start and stop arm with events Subtree Sets the slope of the external start arm signal used in external arming time interval measurements including Time Interval Rise Time Fall Time Dutycycle and Pulse Width functions Only applies when SENS TINT ARM STAR SOUR EXT is selected Sets the start arm for time interval including Time Interval Rise Time Fall Time Dutycycle and Pulse Width measurements Subtree Sets the stop arm i e the delay for Time Interval measurements Sets the time used to delay the stop arm for Time Interval measurements Only applies when SENS TINT ARM STOP SOUR TIM is selected Subtree Controls the totalize measuring capabilities of the instrument Subtree Synchronizes totalize start and stop arm with events Subtree Sets the slope of the external start arm signal used in external arming totalize measurements Only applies when SENS TOT ARM STAR SOUR EXT is selected Sets the start arm for totalize measurements 2 35 Chapter 2 Command Summary HP 53131A 132A Command Summary Tab
300. ve lt numeric_value gt PCT 1Sets the size of the hysteresis window as a percentage of allowable hysteresis 2Sets the sensitivity of the input channel as a percentage of allowable sensitivity LEVel Subtree ABSolute lt numeric_value gt V Sets the level at the center of the hysteresis window AUTO lt Boolean gt Sets the auto trigger enable RELative lt numeric_value gt PCT Sets the percentage of the peak to peak range of the signal at which the instrument will auto trigger 0 100 SLOPe POSitive NEGative Sets which edge of the input signal will be considered an event EVENt2 Subtree FEED JINPut 1 JINPut2 Sets the common separate enable INPut2 is separate INPut1 is common Only applies for Time Interval function I current firmware revision 2 Prior firmware revisions 3317 3335 and 3402 2 32 Programming Guide SENSe Cont EVENt3 LEVel ABSolute SLOPe FREQuency ARM STARt SLOPe SOURce STOP DIGits SOURce TIMer ExPected 1 2 3 AUTO Chapter 2 Command Summary Front Panel to SCPI Command Maps Table 2 2 HP 53131A 132A SCPI Command Summary Continued New POSitive NEGative IMMediate EXTernal lt numeric_value gt POSitive NEGative IMMediate EXTernal TIMer DIGits lt numeric_value gt S lt numeric_value gt HZ ON Programming Guide Subtree Queries the characteristics of th
301. vent reporting is disabled 3 28 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands 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 transitions filter registers use lt STATus OPERation PTRansition STATus OPERation NTRansition STATus QUEStionable PT Ransition STATus QUEStionable NTRansition To read the transition filter registers use STATus OPERation PT Ransition STATus OPERation NTRansition lt STATus QUEStionable PT Ransition STATus QUEStionable NT Ransition Event Register An event register captures changes in conditions An event register bit event bit shall be set TRUE when an associated event occurs 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 To read the event registers use STATus OPERation EVENt STATus QUEStionable 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 QUEStionab
302. was out of limit Each and every time a measurement is limit tested and found to be out of limit this event will be reported Note that this bit is not representing a condition Therefore the transition filters have no effect on this bit The Counter does not monitor the condition indicating whether the last measurement was in or out of limit Hence the Out of Limit Event bit does NOT represent the transition from an in limit measurement to out of limit measurement Bits 11 13 are 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 this bit Bit 15 is not used Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands Command Settings for Optimizing Throughput This section lists the commands which enable the Counter to transfer data at the fastest possible rate See the To Optimize Throughput sample programs on pages 3 73 3 86 and 3 96 Commands to Set Counter for Optimal Throughput Unless otherwise noted these settings are stored on Save SAV All of these settings are reset by RST or a power cycle Disable auto trigger on measurement channel s Specify absolute trigger levels SENSe EVEN 1 2 LEVel ABSolute lt numeric_value gt V or simply disable auto trigger
303. xpected for the header Fewer parameters were received than required for 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 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 Counter 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 The suffix does not follow the syntax described in IEEE 488 2 or the suffix is inappropriate for the Counter The suffix contained more than 12 characters A suffix was encountered after a numeric element that does not allow suffixes The character data element contains an invalid character A legal character data element was encountered where prohibited by the Counter This 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 Programming Guide 5 7 Chapter 5 Errors Err
304. y DELete MACRo Note however that the Counter complies with IEEE 488 2 1987 e Event no query e See PMC page 4 135 if you want to delete all macros MEMory FREE MACRo Query Response Queries the memory usage and availability corresponding to macro data A total of 6500 bytes is dedicated to macro memory e Numeric data transferred as ASCII bytes in lt NR1 gt format e Two numbers transferred as ASCII bytes in lt NR1 gt format and comma separated lt bytes available gt lt bytes in use gt MEMory NSTates Query Response Queries the Number of available SAV RCL STates in the instrument e Numeric data transferred as ASCII bytes in lt NR1 gt format e The value returned is 21 e The response value is one greater than the maximum which can be sent as a parameter to the SAV and RCL commands Programming Guide 4 79 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 DATA SENSe 1 Query Response Comments Queries the current measurement result data of the SENSe subsystem no scale or offset applied If this query executes while a measurement is in progress then the prior measurement result will be returned if the prior result has n
305. y Enable All segments and LEDs except Remote and SRQ off or on The following command groupings show how to program the Counter to any of the above display modes Commands for Displaying Non Scaled Offset Results The following lines will always show the raw non scaled offset measurement result DISP MENU OFF Clear any menu items that may be on display DISP TEXT FEED CALC2 Show the non statistical result CALC2 LIM DISP NUMBER Use the numeric display mode gt CALC MATH STATE OFF Disable math so scale and offset not used CALC IMM Cause a calculation to be made to update display Note that CALC2 LIM DISP NUMBER will only show the raw result if the command DISP TEXT FEED CALC is also issued These commands must be issued in pairs Programming Guide 3 43 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the Counter to Display Results Commands for Displaying Scaled Offset Results The following lines will enable Math scale offset It is assumed that the values for scale and offset are already set If not the default value for scale is 1 and for offset is 0 DISP MENU OFF Clear any menu items that may be on display DISP TEXT FEED CALC Show the non statistical result CALC2 LIM DISP NUMBER Use the numeric display mode CALC MATH STATE ON Enable math CALC IMM Cause a calculation to be made to update display Note that CALC2 LIM DISP NUMBER will onl
306. y show the raw result if the command DISP TEXT FEED CALC is also issued These commands must be issued in pairs Commands for Displaying the Limit Graph The following lines enable limit testing and show the limit graph If the Math is enabled the scale and offset will be applied to the measurement result before being tested for the limit graph DISP MENU OFF Clear any menu items that may be on display DISP TEXT FEED CALC2 Show the non statistical result CALC2 LIM STATE ON Enable limit testing CALC2 LIM DISP GRAPH Display the limit test result graph CALC IMM Cause a calculation to be made to update display Commands for Displaying Statistics Results The following lines enable Statistics The default value displayed is Mean DISP MENU OFF Clear any menu items that may be on display Show statistical results DISP TEXT FEED CALC3 Enable statistics CALC3 AVER ON 3 44 Programming Guide Chapter 3 Programming Your Universal Counter for Remote Operation Elements of SCPI Commands 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 To achieve maximum HP IB throughput the display must be disabled DISP ENABLE OFF Disable the display all segments off DISP ENABLE ON Normal display mode Programming Guide 3 45 Chapter 3 Programming Your Universal Counter for Remote Operation How to Program the
307. y state 4 28 unsecure 4 28 calibration error status bit 3 32 3 33 CALibration SECurity 4 28 clear 4 123 CME 3 24 comma 3 8 3 12 3 16 command abbreviated 3 9 keyword 3 7 parameter 3 11 short form 3 53 syntax 3 9 terminator 3 13 terminators 3 8 command error definition 5 4 status bit 3 26 command warning status bit 3 32 3 34 commands to set Counter for optimal throughput 3 35 common command format 3 7 syntax 3 8 common commands Programming Guide definition 2 21 summary list 2 22 syntax 2 21 Common Commands Summary Table 2 22 Common Commands IEEE 488 2 4 122 CAL Calibration 4 122 CLS Clear Status 4 123 DDT Define Device Trigger Command 4 124 DMC Define Macro Command 4 125 EMC Enable Macro Command 4 126 EMC Enable Macro Command 4 126 ESE Standard Event Status Enable 4 127 ESE Standard Event Status Enable Query 4 127 GMC Get Macro Contents Query 4 129 IDN Identificarion Query 4 130 LMC Learn Macro Query 4 131 OPC Operation Complete 4 132 OPC Operation Complete Query 4 133 OPT Option Identification 4 134 PMC Purge Macro Command 4 135 RCL Recall 4 136 RST Reset 4 137 SAV Save 4 138 SRE Service Request Enable 4 139 SRE Service Request Enable Query 4 139 STB Status Byte Query 4 140 TRG Trigger 4 141 TST Self Test Query 4 142 WAI Wait to Continue 4 143 ESR Event Status Register Query 4 128 commo
308. you see quotation marks in the 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 in Chapter 3 page 3 61 of this guide for details on how to use double quotes or single quotes to enclose the string parameter of a command Programming Guide 2 3 Chapter 2 Command Summary Front Panel to SCPI Command Maps Input Channels Conditioning Keys to SCPI Command Map For TI 1 TO 2 Time Interval measurements only Channel 3 is optional Figure 2 1 Input Channels Conditioning Keys to SCPI Command Map Part 1 of 2 2 4 Programming Guide Chapter 2 Command Summary Front Panel to SCPI Command Maps Input Channels Conditioning Keys to SCPI Command Map Cont 1 a SENSe EVENt 1 2 LEVel ABSolute AUTO ON OFF b4 SENSe EVENI 1 2 LEVel ABSolute lt numeric_value gt V bo SENSe EVENI 1 2 LEVel RELative lt numeric_value gt PCT c SENSe EVENt 1 2 SLOPe POSitive NEGative d4 SENSe EVENI 1 2 HYSTeresis RELative 100 do SENSe EVENI 1 2 HYSTeresis RELative 50 d3 SENSe EVENI 1 2 HYSTeresis RELative 0 e1 SENSe EVENt2 FEED INPut 1 e2 SENSe EVENt2 FEED INPut2 2 INPut 1 2 IMPedance lt nume ric_value gt OHM 3 INPut 1 2 COUPling ACIDC 4 ay INPut 1 2 ATTenuation 1 ag INPut 1 2 ATTenuation 10 ol INPut 1 2 FILTer ON OFF
309. ypes and query response types See the HP 531331A 32A Operating Guide Table 2 6 for power up values Programming Guide 4 3 ABORt Comments Related Front Panel Keys Chapter 4 Command Reference ABORt Command ABORt Command This command is an event that 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 Flags that were set true by initiation of measuring If ABORt is issued while the measurement cycle is idle INIT CONT OFF and pending operation flag is false the command will be ignored If ABORt is issued while a single measurement is in progress TRIG COUN AUTO OFF or CALC3 AVER OFF INIT CONT OFF and pending operation flag is true the measurement will be aborted and pending operation flag set false If ABORt is issued while repetitive measurement are being made INIT CONT ON the current measurement in progress will be aborted and the pending operation flag set false Then a new measurement will automatically be initiated and the pending operation flag set true If ABORt is issued while a block of measurements is in progress TRIG COUN AUTO ON and CALC3 AVER ON INIT CONT OFF and pending operation flag is true the measurement block will be aborted and the pending operation flag set false When a measuremen
310. zero For example if only the medium stability timebase option is detected the response would be 001 0 This query should be the last query in a terminated program message otherwise error 440 is generated 413400 Programming Guide Chapter 4 Command Reference Introduction PMC Purge Macro Command PMC The Purge MaCros command deletes all macros previously defined using the DMC command Programming Guide 4 135 Chapter 4 Command Reference RCL lt NRf gt Recall Command RCL lt NRf gt Recall Command RCL lt NRf gt lt NRf gt Range lt NRf gt Resolution Comments This command restores the state of the instrument from a copy stored in local non volatile memory Before the recall occurs the current state of the instrument is automatically saved to register 0 0 to 20 1 The following commands states are unaffected by RCL EMC ESE OPC OPC SRE WAI CALibration COUNt CALibration DATA CALibration SECurity CODE CALibration SECurity STATe CONFigure DIAGnostic CALibration INTerpolator AUTO DISPlay ENABle DISPlay MENU STATe DISPLay WINDow TEXT RADix SENSe FREQuency EXPected 11213 SENSe FREQuency EXPected 1I2I3 AUTO SENSe ROSCillator EXTernal CHECk SENSe ROSCillator SOURCe SENSe ROSCillator SOURCe AUTO STATus OPERation ENABle STATus OPERation NTRansition STATus OPERation PTRansition STATus QUEStionable EN ABle STAT
311. 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 Member of digits hat b Bow Acted dhin Tembr 208 lt 9 bytes of datas anew lint BO 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 EOI lt new line gt is defined as a single ASCll encoded byte corresponding to 10 decimal Programming Guide 3 11 Chapter 3 Programming Your Universal 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 can be queried to return the minimum or maximum values they are capable of being set to by sending a MINimum_ or MAXimum parameter after the For example consider the INPut IMPedance query If you send the query without specifying a parameter INP IMP the present impedance value is returned If you send the MIN parameter using INP IMP MIN the command returns the minimum level currently available If you send the MAX parameter the comman
Download Pdf Manuals
Related Search
Related Contents
Electrical Operational Procedure pSeries 7311 Model D10 and Model D20 - ps Courts-métrages - Espace pédagogique MaSSC CLEAN Franke Corinthian Digital Multimeter Instruction Manual 13.07 - MAZDA Copyright © All rights reserved.
Failed to retrieve file