Page 1
HP 8163A Lightwave Multimeter & HP 8164A Lightwave Measurement System Programming Guide...
Page 2
Hewlett-Packard GmbH a service facility designated by Service Office. Herrenberger Str. 130 HP. Buyer shall prepay shipping 71034 Böblingen charges to HP and HP shall pay Certification Germany shipping charges to return the product to Buyer. However, Hewlett-Packard Company certi-...
Page 3
HP 8163A Lightwave Multimeter & HP 8164A Lightwave Measurement System Programming Guide...
The Structure of this Manual This manual is divided into 5 parts: • Chapter 1 gives a general introduction to SCPI programming with the HP 8163A Lightwave Multimeter and the HP 8164A Lightwave Measurement System. • Chapter 2 lists all instrument specific commands.
Front Matter Conventions used in this Manual • All commands and typed text is written in Courier font, for example INIT[:IMM]. • SCPI commands are written in mixed case: text that you MUST print is written in capitals; text which is helpful but nor necessary is written in lower case.
Please note that User Guides no longer contain programming information, and must now be used in conjunction with this manual. If you are not familiar with the HP-IB, then refer to the following books: • HP publication 5952-0156, Tutorial Description of HP-IB.
Conventions used in this Manual ........5 Related Manuals ..............6 1 Introduction to Programming 1.1 HP-IB Interface ............17 Setting the HP-IB Address ..........18 Returning the Instrument to Local Control ......19 1.2 Message Queues ............20 How the Input Queue Works ..........20 The Output Queue ..............
Page 8
Table of Contents 2.1 Specific Command Summary ....... 37 3 Instrument Setup and Status 3.1 IEEE-Common Commands ........47 3.2 Status Reporting – The STATus Subsystem ..56 3.3 Interface/Instrument Behaviour Settings – The SYS- Tem Subsystem ............. 65 4 Measurement Operations & Settings 4.1 Root Layer Command ...........
Page 9
Getting Started with HP VEE ..........173 Getting Started with LabView ..........176 Getting Started with LabWindows ........177 A.3 Features of the HP 816x Instrument Driver ..178 A.4 Directory Structure ..........179 A.5 Opening an Instrument Session ......180 A.6 Closing an Instrument Session ......181 A.7 VISA Data Types and Selected Constant Definitions...
Page 10
Preset Defaults ..............189 Removed Command ............189 Obsolete Commands ............190 Changed Parameter Syntax and Semantics ......191 Changed Query Result Values ..........192 Timing Behavior ..............193 Error Handling ..............193 Command Order ..............194 Instrument Status Settings ...........194 C Error Codes C.1 HP-IB Error Strings ..........197...
Page 11
List of Figures Figure 1-1 Remote Control ..................19 Figure 1-2 The Event Status Bit ................. 26 Figure 1-3 The Registers and Filters for a Node............28 Figure 1-4 The Operational Status System ..............29 Figure 1-5 The Questionable Status System............... 29 Figure 1-5 The Questionable Status System...............
Descriptions for the actual commands for the instruments are given in the following chapters. The information in these chapters is specific to the HP 8163A Lightwave Multimeter & HP 8164A Lightwave Measurement System, and assumes that you are already familiar with programming the HP-IB.
The HP-IB conforms to IEEE standard 488-1978, ANSI standard MC 1.1 and IEC recommendation 625-1. If you are not familiar with the HP-IB, then refer to the following books: • Hewlett-Packard Company. Tutorial Description of Hewlett- Packard Interface Bus, 1987.
Instruments. Published periodically by various publishers. To obtain a copy of this manual, contact your Hewlett-Packard representative. The interface of the HP 8163A Lightwave Multimeter and of the HP 8164A Lightwave Measurement System to the HP-IB is defined by the IEEE Standards 488.1 and 488.2.
• You can set the HP-IB address by using the command “:SYSTem:COMMunicate:GPIB[:SELF]:ADDRess” on page 68. • You can set the HP-IB address from the front panel. See your instrument’s User’s Guide for more information. The default HP-IB address is 20.
Introduction to Programming Message Queues 1.2 Message Queues The instrument exchanges messages using an input and an output queue. Error messages are kept in a separate error queue. How the Input Queue Works The input queue is a FIFO queue (first-in first-out). Incoming bytes are stored in the input queue as follows: 1 Receiving a byte: •...
Introduction to Programming Programming and Syntax Diagram Conventions The Output Queue The output queue contains responses to query messages. The instrument transmits any data from the output queue when a controller addresses the instrument as a talker. Each response message ends with a carriage return (CR, 0D ) and a LF (0A ), with EOI=TRUE.
Introduction to Programming Programming and Syntax Diagram Conventions • A command message is ended by a line feed character (LF) or <CR><LF>. • You can use any valid number/unit combination. In other words, 1500NM,1.5UM and 1.5E-6M are all equivalent. If you do not specify a unit, then the default unit is assumed. The default unit for the commands are given with command description in the next chapter.
Page 23
Introduction to Programming Programming and Syntax Diagram Conventions The characters between angled brackets (<...>) indicate the kind of data that you should send, or that you get in a response. You do not type the angled brackets in the actual message. Descriptions of these items follow the syntax description.
Introduction to Programming Programming and Syntax Diagram Conventions Units Where units are given with a command, usually only the base units are specified. The full sets of units are given in the table below. Unit Default Allowed Mnemonics meters PM, NM, UM, MM, M decibel MDB, DB second...
Introduction to Programming Common Commands bytes, and <Block> is the data block. For example, for a Binary Block with 1 digit and 6 bytes this is: #16TRACES<END>. 1.4 Common Commands The IEEE 488.2 standard has a list of reserved commands, called common commands.
Introduction to Programming Common Commands NOTE These commands are described in more detail in “IEEE-Common Commands” on page 47. Common Status Information There are three registers for the status information. Two of these are status-registers and one is an enable-registers. These registers conform to the IEEE Standard 488.2-1987.
Introduction to Programming The Status Model The SESR contains the information about events that are not slot specific. For details of the function of each bit of the SESR, see “Standard Event Status Register” on page 32. The SESEM allows you to choose the event that may affect the ESB of the Status Byte.
Introduction to Programming The Status Model The structures of the Operational and Questionable Status Systems are similar. Figure 1-5 and Figure 1-4 respectively describe how the Questionable Status Bit (QSB) and the Operational Status Bit (OSB) of the Status Byte Register are determined. Enable Registers To the Condition Register...
Introduction to Programming The Status Model The Operational/Questionable Slot Status Event Register (OSSER/ QSSER) contains the status of a particular module slot. A bit changes from 0 → 1 when an event occurs, for example, when a laser is switched on. For details of the function of each bit of these registers, see “Operation/Questionable Status Summary Register”...
Page 32
Introduction to Programming The Status Model Standard Event Status Register • Bit 0 is set if an operation complete event has been received since the last call to *ESR?. • Bit 1 is always 0 (no service request). • Bit 2 is set if a query error has been detected. •...
Page 33
Introduction to Programming The Status Model Operation/Questionable Slot Status • The Operation/Questionable Slot Status consist of a condition and an event register. • A "rising" bit in the condition register is copied to the event register. • A "falling" bit in the condition register has no effect on the event register.
Introduction to Programming The Status Model Status Command Summary *STB? returns status byte, value 0 .. +255 *ESE sets the standard event status enable mask, parameter 0 .. +255 *ESE? returns SESE, value 0 .. +255 *ESR? returns the standard event status register, value 0 .. +255 *OPC parses all program message units in the message queue.
Specific Commands This chapter lists all the instrument specific commands relating to the HP 8163A Lightwave Multimeter and the HP 8164A Lightwave Measurement System, with a single-line description. Each of these summaries contains a page reference for more detailed information about the particular command later in this...
Specific Commands Specific Command Summary 2.1 Specific Command Summary The commands are ordered in a command tree. Every command belongs to a node in this tree. The root nodes are also called the subsystems. A subsystem contains all commands belonging to a specific topic. In a subsystem there may be further subnodes.
Page 38
Specific Commands Specific Command Summary Command Description Page :POWer[:DC]? Returns the current power value from a sensor. :INITiate[n]:[CHANnel[n]] [:IMMediate] Starts a measurement. :CONTinuous/? Starts or Queries a single/continuous measurement. Switches the lock on/off or returns the current :LOCK/? state of the lock. :OUTPut[n][:CHANnel[n]] :CONNection/? Selects or returns Analog Output parameter.
Page 39
Specific Commands Specific Command Summary Command Description Page :PARameter:STABility/? Sets or returns the total time, delay time and the averaging time, t , for stability. :RESult? Returns the data array of the last function. :STATe/? Enables/disables the function mode or returns whether the function mode is enabled.
Page 40
Specific Commands Specific Command Summary Command Description Page :OPTions? Returns the module’s options. :TST? The module performs a selftest and returns the results. [:SOURce[n]][:CHANnel[n]] :MODout/? Returns the mode of the modulation output. [:SOURce[n]][:CHANnel[n]:]AM [:INTernal]:FREQuency/? Sets or returns the frequency of an internal signal source.
Page 41
Specific Commands Specific Command Summary Command Description Page [:SOURce[n]][:CHANnel[n]:]WAVelength [:CW|:FIXed]/? Sets or returns the absolute wavelength of a source. :FREQuency/? Sets the frequency difference used to calculate a relative wavelength for a source. :REFerence? Returns the reference wavelength of a source. [:SOURce[n]][:CHANnel[n]:]WAVelength:CORRection :ARA Realigns the laser cavity.
Page 42
Specific Commands Specific Command Summary Command Description Page :PREVious Performs the previous sweep step again. [:WIDTh]/? Sets or returns the width of the sweep step. :SPECial :REBoot Reboots the mainframe and all modules. :STATus[n] :PRESet Presets all Enable Registers. :STATus:OPERation [:EVENt]? Returns the Operational Status Event Summary Register.
Page 43
Sets or returns the instrument’s internal date. :ERRor? Returns the contents of the instrument’s error queue. :HELP:HEADers? Returns a list of HP-IB commands. :PRESet Sets all parameters to their default values. :TIME/? Sets or returns the instrument’s internal time. :VERSion? Returns the instrument’s SCPI version.
Instrument Setup and Status This chapter gives descriptions of commands that you can use when setting up your instrument. The commands are split into the following separate subsytems: • IEEE specific commands that were introduced in “Common Commands” on page 25. •...
Instrument Setup and Status IEEE-Common Commands 3.1 IEEE-Common Commands “Common Commands” on page 25 gave a brief introduction to the IEEE-common commands which can be used with the instruments. This section gives fuller descriptions of each of these commands. command: *CLS syntax: *CLS...
Page 48
Instrument Setup and Status IEEE-Common Commands command: *ESE syntax: *ESE<wsp><value> 0 ≤ value ≤ 255 description: The standard Event Status Enable command (*ESE) sets bits in the Stand- ard Event Status Enable Mask (SESEM) that enable the corresponding bits in the standard event status register (SESR). The register is cleared: •...
Page 49
Instrument Setup and Status IEEE-Common Commands command: *ESR? syntax: *ESR? description: The standard Event Status Register query *ESR? returns the contents of the Standard Event Status Register. The register is cleared after being read. parameters none response The bit value for the register (a 16-bit signed integer value): Mnemonic Decimal Value 7 (MSB) Power On...
Page 50
Instrument Setup and Status IEEE-Common Commands command: *OPC syntax: *OPC description: The instrument parses and executes all program message units in the input queue and sets the operation complete bit in the standard event status register (SESR). This command can be used to avoid filling the input queue before the previous commands have finished executing.
Page 51
Instrument Setup and Status IEEE-Common Commands command: *OPT? syntax: *OPT? description: The OPTions query *OPT? returns the modules installed in your instrument. parameters: none response: Returns the part number of all installed modules, separated by commas. Slots are listed starting with slot 0, if a large tunable laser source module is installed in slot 0.
Page 52
The *RST command is equivalent to the *CLS command AND the syst:preset command. The following are not changed: • HP-IB (interface) state • Instrument interface address • Output queue • Service request enable register (SRE) •...
Page 53
Instrument Setup and Status IEEE-Common Commands command: *STB? syntax: *STB? description: The STatus Byte query *STB? returns the contents of the Status Byte register. parameters: none response: The bit value for the register (a 16-bit signed integer value): Mnemonic Decimal Value 7 (MSB) Operation Status Not used...
Page 54
Instrument Setup and Status IEEE-Common Commands command: *TST? syntax: *TST? description: The self-TeST query *TST? makes the instrument perform a self-test and place the results of the test in the output queue. If the self-test fails, the results are also put in the error queue. We recommend that you read self-test results from the error queue.
Page 55
Instrument Setup and Status IEEE-Common Commands command: *WAI syntax: *WAI description: The WAIt command prevents the instrument from executing any further commands until the current command has finished executing. All pending operations are completed during the wait period. parameters: none response: none example:...
Instrument Setup and Status Status Reporting – The STATus Subsystem 3.2 Status Reporting – The STATus Subsystem The Status subsystem allows you to return and set details from the Status Model. For more details, see “The Status Model” on page 27. command: :STATus:OPERation[:EVENt]? syntax:...
Page 57
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATusn:OPERation[:EVENt]? syntax: :STATusn:OPERation[:EVENt]? description: Returns the Operational Slot Status Event Register (OSSER) of slot n. parameters: none response: The results for the individual slot events (a 16-bit signed integer value, where 0 ≤...
Page 58
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATusn:OPERation:CONDition? syntax: :STATusn:OPERation:CONDition? description: Returns the Operational Slot Status Condition Register of slot n. parameters: none response: The results for the individual slot events (a 16-bit signed integer value, where 0 ≤...
Page 59
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATus:OPERation:ENABle? syntax: :STATus:OPERation[:ENABle]? description: Returns the OSESM for the OSESR parameters: none response: The bit value for the operation enable mask as a 16-bit signed integer value (0 .. +32767) stat:oper:enab? →...
Page 60
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATus:PRESet syntax: :STATus:PRESet description: Presets all bits in all the enable masks for both the OPERation and QUES- tionable status systems to 0, that is, OSSEM, QSSEM, OSESM, and QSESM.
Page 61
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATusn:QUEStionable[:EVENt]? syntax: :STATusn:QUEStionable[:EVENt]? description: Returns the questionable status of slot n - the Questionable Slot Status Event Register (QSSER). parameters: none response: The results for the individual slot events (a 16-bit signed integer value, where 0 ≤...
Page 62
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATus:QUEStionable:CONDition? syntax: :STATus:QUEStionable:CONDition? description: Returns the Questionable Status Condition Summary Register. parameters: none response: The sum of the results for the Questionable Status Condition Summary Register as a 16-bit signed integer value (0 .. +32767) Mnemonic Decimal Value 5-15...
Page 63
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATus:QUEStionable:ENABle syntax: :STATus:QUEStionable:ENABle<wsp><value> description: Sets the bits in the Questionable Status Enable Summary Mask (QSESM) that enable the contents of the QSESR to affect the Status Byte (STB). Setting a bit in this register to 1 enables the corresponding bit in the QSESR to affect bit 3 of the Status Byte.
Page 64
Instrument Setup and Status Status Reporting – The STATus Subsystem command: :STATusn:QUEStionable:ENABle? syntax: :STATusn:QUEStionable[:ENABle]? description: Returns the QSSEM for slot n parameters: none response: The bit value for the QSSEM as a 16-bit signed integer value (0 .. +32767) stat:ques:enab? → +128<END> example:...
Instrument Setup and Status Interface/Instrument Behaviour Settings – The SYSTem Subsystem 3.3 Interface/Instrument Behaviour Settings – The SYSTem Subsystem The SYSTem subsystem lets you control the instrument’s serial interface. You can also control some internal data (like date, time, and so on) command: :SYSTem:DATE syntax: :SYSTem:DATE<wsp><year>,<month>,<day>...
Page 66
The number of the latest error, and its meaning. syst:err? → -113,"Undefined header"<END> example: command: :SYSTem:HELP:HEADers? syntax: :SYSTem:HELP:HEADers? description: Returns a list of HP-IB commands. parameters: none response: Returns a list of HP-IB commands → example: Returns a list of all HP-IB commands syst:help:head?
Page 67
Sets the mainframe and all installed modules to their standard settings. This command has the same function as the Preset hardkey. The following are not affected by this command: • the HP-IB (interface) state, • the backlight and contrast of the display, • the interface address, •...
Page 68
The revision year and number. syst:vers? → 1995.0<END> example: command: :SYSTem:COMMunicate:GPIB[:SELF]:ADDRess syntax: :SYSTem:COMMunicate:GPIB[:SELF]:ADDRess<wsp> <HP-IB Address> description: Sets the HP-IB address. parameters: The HP-IB Address response: none example: SYST:COMM:GPIB:ADDR 20 command: :SYSTem:COMMunicate:GPIB[:SELF]:ADDRess? syntax: :SYSTem:COMMunicate:GPIB[:SELF]:ADDRess? description: Returns the HP-IB address.
Measurement Operations & Settings This chapter gives descriptions of commands that you can use when you are setting up or performing measurements. The commands are split up into the following subsystems: • Root layer commands that take power measurements, configures triggering, and return information about the mainframe and it’s slots •...
Introduction to Programming Root Layer Command 4.1 Root Layer Command command: :LOCK syntax: :LOCK<wsp><boolean>, <value> description: Switches the lock off and on. High power lasers cannot be switched on, if you switch the lock on. High power lasers are switched off immediately when you switch the lock on. parameters: A boolean value: 0 or OFF: switch lock off...
Page 72
Introduction to Programming Root Layer Command command: :SLOT[n][:HEAD[n]]:EMPTy? syntax: :SLOT[n][:HEAD[n]]:EMPTy? description: Returns whether the module slot is empty. parameters: none response: A boolean value: 0: there is a module in the slot 1: the module slot is empty → examples: There is a module in slot1 slot1:empt? 0<END>...
Page 73
Introduction to Programming Root Layer Command command: :SLOT[n][:HEAD[n]]:TST? syntax: :SLOT[n][:HEAD[n]]:TST? description: The module returns the latest selftest results. NOT E This command does not perform a selftest. Use selfTeST command, *TST? on page 54, to perform a selftest. parameters: none response: Returns an error code and a short description of the error.
Introduction to Programming Measurement Functions – The SENSe Subsystem 4.2 Measurement Functions – The SENSe Subsystem The SENSe subsystem lets you control measurement parameters for a Power Sensor or Optical Head Interface module. command: :FETCh[n][:CHANnel[n]][:SCAlar]:POWer[:DC]? syntax: :FETCh[n]:[CHANnel[n]][:SCAlar]:POWer[:DC]? description: Reads the current power meter value. It does not provide its own triggering and so must be used with either continuous software triggering (see “:INITiate[n]:[CHANnel[n]]:CONTinuous”...
Page 75
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :INITiate[n]:[CHANnel[n]]:CONTinuous syntax: :INITiate[n]:[CHANnel[n]]:CONTinuous<wsp><boolean> description: Sets the software trigger system to continuous measurement mode. parameters: A boolean value: 0 or OFF: do not measure continuously 1 or ON: measure continuously response: none example: init2:cont 1...
Page 76
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :READ[n][:CHANnel[n]][:SCALar]:POWer[:DC]? syntax: :READ[n]:[CHANnel[n]][:SCALar]:POWer[:DC]? description: Reads the current power meter value. It provides its own software triggering and does not need a triggering command. If the software trigger system operates continuously (see “:INITiate[n]:[CHANnel[n]]:CONTinuous”...
Page 77
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:CORRection[:LOSS][:INPut] [:MAGNitude]? syntax: :SENSe[n]:[CHANnel[n]]:CORRection[:LOSS][:INPUT][:MAGNitude]? description: Returns the calibration factor for a module. parameters: none response: The calibration factor as a float value. Units are in dB, although no units are returned in the response message.
Page 78
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:CORRection:COLLect:ZERO :ALL syntax: SENSe[n]:[CHANnel[n]]:CORRection:COLLect:ZERO:ALL description: Zeros the electrical offsets for all installed modules. parameters: none response: none example: sens:chan:corr:coll:zero:all affects: All power meter modules...
Page 79
Introduction to Programming Measurement Functions – The SENSe Subsystem N OT E Setting parameters for the logging function sets some parameters for the stability and MinMax functions and vice versa. command: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:LOGGing syntax: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:LOGGing<wsp> <data points>,<averaging time>[NS|US|MS|S] description: Sets the number of data points and the averaging time for the logging func- tion.
Page 80
Data Points is the number of samples that are recorded in the memory buffer used by the WINDow and REFResh modes. Data Points is an integer value. See Chapter 3 of the HP 8163A Lightwave Multimeter & HP 8164A Lightwave Measurement System User’s Guide, for more information on MinMax mode.
Page 81
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:MINMax? syntax: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:MINMax? description: Returns the MinMax mode and the number of data points for the MinMax function. parameters: none response: CONT: continuous MinMax mode WIND: window MinMax mode REFR: refresh MinMax mode The number of data points is returned as an integer value.
Page 82
Introduction to Programming Measurement Functions – The SENSe Subsystem NOT E Setting parameters for the stability function sets some parameters for the logging and MinMax functions and vice versa. command: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:STABility syntax: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:STABility<wsp> <total time>[NS|US|MS|S],<period time>[NS|US|MS|S], <averaging time>[NS|US|MS|S] description: Sets the total time, period time, and averaging time for the stability function. parameters: Total time: The total time from the start of stability mode until it is...
Page 83
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:STABility? syntax: :SENSe[n][:CHANnel[n]]:FUNCtion:PARameter:STABility? description: Returns the total time, period time, and averaging time for the stability func- tion. parameters: none response: Total time, delay time, and averaging time are float values in seconds. →...
Page 84
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n][:CHANnel[n]]:FUNCtion:STATe? syntax: :SENSe[n][:CHANnel[n]]:FUNCtion:STATe? description: Returns the function mode and the status of the function. parameters: none response: NONE No function mode selected LOGGING_STABILITY Logging or stability function MINMAX MinMax function PROGRESS Function is in progress COMPLETE...
Page 85
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n][:CHANnel[n]]:FUNCtion:THReshold? syntax: :SENSe[n][:CHANnel[n]]:FUNCtion:THReshold? description: Returns the start mode and the threshold value. parameters: none response: ABOV: Function starts when power is above the threshold value. BEL: Function starts when power is below the threshold value.
Page 86
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:POWer:RANGe[:UPPer] syntax: :SENSe[n]:[CHANnel[n]]:POWer:RANGe[:UPPer]<wsp> <value>[DBM] description: Sets the power range for the module. The range changes at 10 dBm intervals. The corresponding ranges for linear measurements (measurements in Watts) is given below: Range Upper Linear Range...
Page 87
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:POWer:RANGe:AUTO syntax: SENSe[n]:[CHANnel[n]]:POWer:RANGe:AUTO <wsp><boolean> description: Enables or disables automatic power ranging for the module. If automatic power ranging is enabled, ranging is automatically determined by the instrument. Otherwise, it must be set by the sens n :pow:rang command.
Page 88
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:POWer:REFerence syntax: :SENSe[n]:[CHANnel[n]]:POWer:REFerence<wsp> TOMODule|TOREF,<value>PW|NW|UW|MW|Watt|DBM|DB description: Sets the sensor reference value. parameters: TOMODule: Sets a reference relative to another channel TOREF: Sets a constant reference value in Watts or dBm The reference as a float value. NOTE You must append a unit type •...
Page 89
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:POWer:REFerence:DISPlay syntax: :SENSe[n]:[CHANnel[n]]:POWer:REFerence:DISPlay description: Takes the input power level value as the reference value. parameters: none response: none example: sens1:pow:ref:disp affects: All power meter modules command: :SENSe[n]:[CHANnel[n]]:POWer:REFerence:STATe syntax: :SENSe[n]:[CHANnel[n]]POWer:REFerence:STATe<wsp><boolean> description: Sets the measurement units to relative or absolute units.
Page 90
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:POWer:REFerence:STATe:RATio syntax: :SENSe[n]:[CHANnel[n]]POWer:REFerence:STATe:RATio<wsp> <slot number>|255|TOREF,<channel number> description: Selects the reference for the module. parameters: slot number: an integer value representing the slot number you want to reference results are displayed relative to an absolute reference 255 or TOREF: an integer value representing the channel number you channel number:...
Page 91
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSe[n]:[CHANnel[n]]:POWer:UNIT syntax: :SENSe[n]:[CHANnel[n]]:POWer:UNIT<wsp>DBM|0|Watt|1 description: Sets the sensor power unit parameters: An integer value: 0: dBm 1: Watt or DBM or Watt response: none example: sens1:pow:unit 1 affects: All power meter modules command: :SENSe[n]:[CHANnel[n]]:POWer:UNIT? syntax:...
Page 92
Introduction to Programming Measurement Functions – The SENSe Subsystem command: :SENSE[n]:[CHANnel[n]]:POWer:WAVelength syntax: :SENSE[n]:[CHANnel[n]]:POWer:WAVelength<wsp> <value>|MIN|MAX|DEF [PM|NM|UM|MM|M] description: Sets the sensor wavelength. parameters: The wavelength as a float value in meters. Also allowed are: MIN: minimum programmable value MAX: maximum programmable value DEF: This is not the preset (*RST) default value but is half the sum of, the mini- mum programmable value and the maxi-...
Introduction to Programming Signal Generation – The SOURce Subsystem 4.3 Signal Generation – The SOURce Subsystem The SOURce subsystem allows you to control a Laser Source or Tunable Laser module. command: :OUTPut[n][:CHANnel[n]]:CONNection syntax: OUTPut[n][:CHANnel[n]]:CONNection<wsp>MOD|VPP|VPL description: Sets the analog output parameter. parameters: MOD: The modulation frequency modulates the analog output.
Page 94
Introduction to Programming Signal Generation – The SOURce Subsystem command: :OUTPut[n][:CHANnel[n]]:PATH syntax: :OUTPut[n][:CHANnel[n]]:PATH<wsp><path> description: Sets the regulated path. parameters: HIGHpower: The High Power output is regulated. LOWSse: The Low SSE output is regulated. BHRegulated: Both outputs are active but only the High Power output is Regulated.
Page 95
Introduction to Programming Signal Generation – The SOURce Subsystem command: :OUTPut[n][:CHANnel[n]][:STATe] syntax: :OUTPut[n]:STATe<wsp>OFF|ON|0|1 description: Switches the laser current off and on. The laser emits light only when the current is on. Set the state to OFF or 0 to switch the laser current off. Set the state to ON or 1 to switch the laser current on.
Page 96
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:AM[:INTernal:FREQuency syntax: [:SOURce[n]][:CHANnel[n]]:AM[:INTernal]:FREQuency<wsp> <frequency>[THZ|GHZ|MHZ|KHZ|HZ] description: Sets the frequency of the amplitude modulation of the laser output. parameters: The frequency as a float value in Hz. Also allowed are: MIN: minimum programmable value MAX: maximum programmable value DEF: This is not the preset (*RST) default value but is half the sum of, the minimum programmable...
Page 97
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:AM:SOURce syntax: [:SOURce[n]][:CHANnel[n]]:AM:SOURce<wsp> INT|INT1|INT2|EXT|0|1|2 description: Selects the type or source of the modulation of the laser output. parameters: 0, INT1, or INTernal internal digital modulation 1, COHCtrl, or INT2 coherence control 2, AEXTernal, or EXT external analog modulation 3 or DEXTernal...
Page 98
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:AM:SOURce? syntax: [:SOURce[n]][:CHANnel[n]]:AM:SOURce? description: Returns the current state of modulation. parameters: internal digital modulation coherence control external analog modulation external digital modulation low frequency coherence control wavelength locking external digital modulation using Input Trigger Connector response: none...
Page 99
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:AM:STATe syntax: [:SOURce[n]][:CHANnel[n]]:AM:STATe<wsp> OFF|ON|0|1 description: Enables and disables amplitude modulation of the laser output. parameters: A boolean value: OFF or 0: modulation disabled (default) ON or 1: modulation enabled. NOT E When the internal modulation is selected, the Modulation Output on the front panel outputs a version of the modulating signal that has the same frequency and phase as the modulating signal, but...
Page 100
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:MODout syntax: [:SOURce[n]][:CHANnel[n]]:MODout<wsp>FRQ|FRQRDY|0|1 description: Sets the modulation output parameters: FRQ or 0: modulation signal is output all the time FRQRDY or 1: modulation is combined with the laser-ready signal. In this case, the output is kept low when no optical signal is output (for example, while the laser is settling after a change of wavelength).
Page 101
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation syntax: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation<wsp><value>[DB] description: Sets the level of attenuation of an in-built optical attenuator, if this is installed. parameters: Any value in the specified range (see the specifications in the appropriate User’s Guide).
Page 102
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation? syntax: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation?[MIN|DEF|MAX] description: Returns the attenuation level of the optical attenuator if this has been installed. The value returned applies only to the attenuation mode (see [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation:AUTO? on page 103). parameters: Also allowed are: MIN: minimum amplitude level...
Page 103
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation:AUTO? syntax: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation:AUTO? description: Returns whether the instrument is in Automatic or Manual Attenuation Mode. parameters: none response: Manual Attenuation Mode Automatic Attenuation Mode → example: sour2:pow:att:auto? 1<END> affects: All Tunable Laser modules with an in-built optical attenuator command: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation:DARK syntax:...
Page 104
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation:DARK? syntax: [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation:DARK? description: Queries whether the attenuator is set to ‘dark’ position (where all light is blocked by the laser). parameters: none response: dark position not set dark position set →...
Page 105
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer[:LEVel][:IMMediate] [:AMPlitude] syntax: [:SOURce[n]][:CHANnel[n]]:POWer[:LEVel][:IMMediate] [:AMPlitude]<wsp><value>[PW|NW|UW|MW|Watt|DBM] description: Sets the power of the laser output. NOT E If you have the optical attenuator installed, the range is specified in the Specifications in the appropriate User’s Guide. If you are using the Attenuation Mode (see [:SOURce[n]][:CHANnel[n]]:POWer:ATTenuation:AUTO on page 102), then this value sets the laser output power, which is not...
Page 106
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer[:LEVel][:IMMediate] [:AMPlitude]? syntax: [:SOURce[n]][:CHANnel[n]]:POWer[:LEVel][:IMMediate] [:AMPlitude]?<wsp>[MIN|DEF|MAX] description: Returns the amplitude level of the output power. The value returned is the actual amplitude that is output, which may be dif- ferent from the value set for the output. If these two figures are not the same, it is indicated in the STATus:OPERation register.
Page 107
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer[:LEVel]:RISetime syntax: [:SOURce[n]][:CHANnel[n]]:POWer[:LEVel]:RISetime<wsp> <value>[NS|US|MS|S] description: Sets the laser rise time of the chosen source. parameters: Any value in the specified range (see the appropriate User’s Guide). Also allowed are: MIN: minimum programmable value MAX: maximum programmable value DEF: This is not the preset (*RST) default value but is half the sum of, the minimum programmable...
Page 108
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer:STATe syntax: [:SOURce[n]][:CHANnel[n]]:POWer[1|2]:STATe<wsp><boolean> description: Switches the laser of the chosen source on or off. parameters: A boolean value: 0: Laser Off 1: Laser On response: none example: sour2:pow:stat 1 affects: All source modules command: [:SOURce[n]][:CHANnel[n]]:POWer:STATe?
Page 109
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer:UNIT? syntax: [:SOURce[n]][:CHANnel[n]]:POWer:UNIT? description: Return the current power units parameters: Watts response: none → example: sour2:pow:unit? +0<END> affects: All Tunable Laser modules command: [:SOURce[n]][:CHANnel[n]]:POWer:WAVelength syntax: [:SOURce[n]][:CHANnel[n]:POWer:WAVelength[<wsp> LOWer|UPPer|BOTH] NOT E For compatibility reasons, WAVelength may be replaced with WAVE.
Page 110
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:POWer:WAVelength? syntax: [:SOURce[n]][:CHANnel[n]:POWer:WAVelength? NOTE For compatibility reasons, WAVelength may be replaced with WAVE. description: Returns the wavelength source for a dual-wavelength Laser Source. parameters: none response: The lower wavelength source The upper wavelength source BOTH Both wavelength sources...
Page 111
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength[:CW|:FIXed]? syntax: [:SOURce[n]][:CHANnel[n]:WAVelength[:CW|:FIXed]?[<wsp> [MIN|DEF|MAX] description: Returns the current wavelength in meters. parameters: none Also allowed are: MIN: minimum wavelength MAX: maximum wavelength DEF: This is not the preset (*RST) default value but is half the sum of, the minimum wavelength value and the maximum wavelength value response:...
Page 112
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:FREQuency syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:FREQuency<wsp> <value>[THZ|GHZ|MHZ|KHZ|HZ] description: Sets the frequency difference used to calculate a relative wavelength. The output wavelength is made up of the reference wavelength and this fre- quency difference. The default units for frequency are Hertz.
Page 113
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:REFerence? syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:REFerence? description: Returns the reference wavelength (λ parameters: none response: The wavelength as a float value in meters. → example: sour2:wav:ref? +1.5500000E-006<END> affects: All Tunable Laser modules command: [:SOURce[n]][:CHANnel[n]]:WAVelength:REFerence:DISPlay syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:REFerence:DISPlay...
Page 114
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:CYCLes? syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:CYCLes? [<wsp>MIN|MAX|DEF] description: Returns the number of cycles. parameters: none Also allowed are: MIN: minimum programmable value MAX: maximum programmable value DEF: This is not the preset (*RST) default value but is half the sum of, the minimum programmable value and the maximum programmable value response:...
Page 115
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:DWELl? syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:DWELl? [<wsp>MIN|MAX|DEF] description: Returns the dwell time. parameters: none Also allowed are: MIN: minimum programmable value MAX: maximum programmable value DEF: This is not the preset (*RST) default value but is half the sum of, the minimum programmable value and the maximum programmable value response:...
Page 116
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:MODE? syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:MODE? description: Returns the sweep mode. parameters: none response: STEP: Stepped sweep mode MAN: Manual sweep mode CONT: Continuous sweep mode → example: wav:swe:mode? STEP<END> affects: All Tunable Laser modules command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:PMAX? syntax:...
Page 117
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:REPeat syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:REPeat<wsp><mode> description: Sets the repeat mode. parameters: ONEWay: TWOWay: response: none example: wav:swe:rep twow affects: All Tunable Laser modules command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:REPeat? syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:REPeat? description: Returns the repeat mode. parameters: none response:...
Page 118
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:SPEed? syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:SPEed? description: Returns the speed for continuous sweeping. parameters: none response: Speed as a float value in meters per second (m/s). → example: wav:swe:spe? +5.00000000E-008<END> affects: All Tunable Laser modules command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:STARt syntax:...
Page 119
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:STOP syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:STOP<wsp> <stop value>[PM|NM|UM|MM|M] description: Sets the end point of the sweep. parameters: The wavelength at which the sweep ends as a float value in meters. If you specify no units in your command, meters are used as the default. response: none example:...
Page 120
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:[STATe]? syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:[STATe]? description: Returns the state of a sweep. parameters: none response: Sweep is not running Sweep is running → example: wav:swe? +0<END> affects: All Tunable Laser modules command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:STEP:NEXT syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:STEP:NEXT...
Page 121
Introduction to Programming Signal Generation – The SOURce Subsystem command: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:STEP: [WIDTh] syntax: [:SOURce[n]][:CHANnel[n]]:WAVelength:SWEep:STEP:[WIDTh] <wsp><value>[PM|NM|UM|MM|M] description: Sets the width of the sweep step parameters: The width of the sweep step as a float value. If you specify no units in your command, meters are used as the default. response: none example:...
Introduction to Programming Triggering - The TRIGger Subsystem 4.4 Triggering - The TRIGger Subsystem The TRIGger Subsystem allows you to configure how the instrument reacts to incoming or outgoing triggers. command: :TRIGger syntax: :TRIGger<wsp>NODEA|1|NODEB|2 description: Generates a hardware trigger. parameters: 1 or NODEA: Is identical to a trigger at the Input Trigger Connector.
Page 123
Introduction to Programming Triggering - The TRIGger Subsystem command: :TRIGger[n][:CHANnel[n]]:INPut syntax: :TRIGger[n][:CHANnel[n]]:INPut<wsp><trigger response> description: Sets the incoming trigger response. parameters: IGNore: Ignore incoming trigger. SMEasure: Start a single measurement. If a measurement function is active, see “:SENSe[n][:CHANnel[n]]:FUNCtion:STATe” on page 83, one sample is performed and the result is stored in the data array, see “:SENSe[n][:CHANnel[n]]:FUNCtion:RESult?”...
Page 124
Introduction to Programming Triggering - The TRIGger Subsystem command: :TRIGger[n][:CHANnel[n]]:INPut? syntax: :TRIGger[n][:CHANnel[n]]:INPut? description: Returns the incoming trigger response. parameters: none response: IGNore: Ignore incoming trigger. SMEasure: Start a single measurement. If a measurement function is active, see “:SENSe[n][:CHANnel[n]]:FUNCtion:STATe” on page 83, one sample is performed and the result is stored in the data array, see “:SENSe[n][:CHANnel[n]]:FUNCtion:RESult?”...
Page 125
Introduction to Programming Triggering - The TRIGger Subsystem command: :TRIGger[n][:CHANnel[n]]:OUTPut syntax: :TRIGger[n][:CHANnel[n]]:OUTPut description: Specifies when an output trigger is generated. parameters: DISabled: Never. AVGover: When averaging time finishes. MEASure: When a complete measurement (for example a logging function operation) is finished. MODulation: For every leading edge of a digitally-modulated (TTL) signal...
Page 126
Introduction to Programming Triggering - The TRIGger Subsystem command: :TRIGger[n][:CHANnel[n]]:OUTPut? syntax: :TRIGger[n][:CHANnel[n]]:OUTPut? description: Returns the condition that causes an output trigger. parameters: none response: DISabled: Never. AVGover: When averaging time finishes. MEASure: When a complete measurement (for example a logging function operation) is finished.
Page 127
Introduction to Programming Triggering - The TRIGger Subsystem command: :TRIGger:CONFiguration syntax: :TRIGger:CONFiguration<wsp><triggering mode> description: Sets the hardware trigger configuration with regard to Output and Input Trig- ger Connectors. parameters: 0 or DISabled: Trigger connectors are disabled. 1 or DEFault: The Input Trigger Connector is activated, the incoming trigger response for each slot “:TRIGger[n][:CHANnel[n]]:INPut”...
Page 128
Connector generates a trigger at the Input Trigger Connector automatically. A custom configuration is active using either the command CUSTOM: “:TRIGger:CONFiguration:EXTended” on page 129 or the HP 816x VXIplug&play Instrument Driver. See Appendix A “The HP 816x VXIplug&play Instrument Driver”. trig:conf? → DEF<END> example:...
Introduction to Programming Triggering - The TRIGger Subsystem Extended Trigger Configuration This section includes information for advanced users about how to customize your use of the trigger system. You can configure the ouputs and inputs from two nodes, Node A and Node B.
Page 130
Introduction to Programming Triggering - The TRIGger Subsystem command: :TRIGger:CONFiguration:EXTended? syntax: :TRIGger:CONFiguration:EXTended? description: Returns the extended hardware trigger configuration. parameters: none response: Node A Input Configuration: A 32-bit unsigned integer, see below. Node B Input Configuration: A 32-bit unsigned integer, see below. Output Matrix Configuration: A 32-bit unsigned integer, see below.
Page 132
Introduction to Programming Triggering - The TRIGger Subsystem Node A Input Configuration This 32-bit unsigned integer determines how inputs to Node A are generated. Mnemonic Hexadecimal #H80000000 Logic: 0 for OR, 1 for AND #H40000000 Input Trigger Connector: 0 - Inactive, 1 - Trigger at Input Trigger Connector can trigger Node A #H20000000 Node B: 0 - Inactive, 1 - Trigger at Node B can trigger Node A...
The short example below demonstrates how to use extended triggering configuration to make tunable laser source modules sweep simultaneously. Setup your mainframe with two HP 81689A modules in slots 1 and 2. The example below presumes you set up identical stepped sweeps for both modules, for example, by...
Page 134
Introduction to Programming Triggering - The TRIGger Subsystem trig:conf:ext #H2,#H0,#H0 trig2:outp dis trig2:inp next sour2:wav:swe star trig1:outp stf trig1:inp ign sour1:wav:swe star trig:conf:ext #H2,#H0,#H0 is described by Figure 4-1 and sets one bit: • for Node A Input Configuration: • Bit 1 - an event at slot 1 can trigger Node A. As trig1:outp stf is set, Node A can be triggered if a sweep step finishes for a Tunable Laser module installed in slot 1.
Page 135
Mass Storage, Display, and Print Functions...
Controls the brightness for the display. parameters: An integer value in the range 0 to 100 response: none example: disp:brig 75 affects: HP 8163A Lightwave Multimeter command: :DISPlay:BRIGhtness? syntax: :DISPlay:BRIGhtness? description: Requests the brightness for the display. parameters: none...
Page 138
Requests the contrast for the display. parameters: none response: An integer value in the range 0 to 100 disp:cont? → +50<END> example: affects: HP 8163A Lightwave Multimeter command: :DISPlay:ENABle syntax: :DISPlay:ENABle<wsp><boolean> description: Enables or disables the display. parameters: A boolean value: 0 –...
Programming Examples The given programming examples are implemented using MS Developer Studio. Independent, of the environment you use, keep the following in mind: • The resultant application is a "console application" • Make sure the include path spans visa.h and visatype.h •...
Programming Examples How to Use VISA Calls 6.1 How to Use VISA Calls The following example demonstrates how to communicate using VISA calls. Also, the use of instrument identification commands is demonstrated. #include <stdio.h> #include <stdlib.h> #include <visa.h> /* This function checks and displays errors, using the error query of the instrument; Call this function after every command to make sure your commands are correct */ void checkError(ViSession session, ViStatus err_status ) ViStatus error;...
Page 142
Programming Examples How to Use VISA Calls void main (void) ViStatus errStatus; /*return error code from visa call */ ViSession defaultRM; /*default visa resource manager variable* ViSession /*current session handle */ ViChar replyBuf[256]; /*buffer holding answers from the instrument*/ ViChar /* Initialize visa resource manger */ errStatus = viOpenDefaultRM (&defaultRM);...
Page 143
Programming Examples How to Use VISA Calls /* get the identification string of the instrument mainframe*/ errStatus = viQueryf(vi,"%s\n","%t","*IDN?",replyBuf); if(errStatus < VI_SUCCESS) checkError(vi,errStatus); else printf("%s",replyBuf); /* identify the installed modules */ errStatus = viQueryf(vi,"%s\n","%t","*OPT?",replyBuf); if(errStatus < VI_SUCCESS) checkError(vi,errStatus); else printf("%s",replyBuf); /* get information about the available options of a slot */ errStatus = viQueryf(vi,"%s","%t","SLOT1:OPT?\n",replyBuf);...
Programming Examples How to Set up a Fixed Laser Source 1.2 How to Set up a Fixed Laser Source This example sets up a fixed laser source. Install a Laser Source in Slot 2, before executing this example. #include <stdio.h> #include <stdlib.h>...
Page 145
Programming Examples How to Set up a Fixed Laser Source printf("Failed to open VISA Resource manager\n"); exit(errStatus); /* Open session to HPIB device at address 20;*/ errStatus = viOpen (defaultRM, "GPIB::20::INSTR", VI_NULL,VI_NULL,&vi); if(errStatus < VI_SUCCESS) printf("Failed to open instrument\n"); exit(errStatus); /*set timeout to 20 sec;...
Page 146
Programming Examples How to Set up a Fixed Laser Source errStatus = viPrintf(vi,"SOURCE2:CHAN1:POW:STATE 1\n"); if (errStatus < VI_SUCCESS) checkError(vi,errStatus); /* loop, until a key is pressed */ while(!scanf("%c",&c)); /* turn the laser off */ errStatus = viPrintf(vi,"SOURCE2:CHAN1:POW:STATE 0\n"); if (errStatus < VI_SUCCESS) checkError(vi,errStatus); /* close the session */ viClose(vi);...
Programming Examples How to Measure Power using FETCH and READ 1.3 How to Measure Power using FETCH and READ The example shows the difference between a "FETCH" and a "READ" command. Install a power meter in Slot 1, before executing this example. #include <stdio.h>...
Page 148
Programming Examples How to Measure Power using FETCH and READ errStatus = viOpenDefaultRM (&defaultRM); if(errStatus < VI_SUCCESS) printf("Failed to open VISA Resource manager\n"); exit(errStatus); errStatus = viOpen (defaultRM, "GPIB::20::INSTR", VI_NULL,VI_NULL,&vi); if(errStatus < VI_SUCCESS) printf("Failed to open instrument\n"); exit(errStatus); /*set timeout to 20 sec; this should work for all commands except zeroing */ errStatus = viSetAttribute(vi,VI_ATTR_TMO_VALUE,20000);...
Page 149
Programming Examples How to Measure Power using FETCH and READ /*set the averaging time for measuring to 0.5s*/ averagingTime = 0.5; errStatus = viPrintf(vi,"SENS1:CHAN1:POW:ATIME %f\n",averagingTime); if (errStatus < VI_SUCCESS) checkError(vi,errStatus); /* turn continous measuring off */ errStatus = viPrintf(vi,"INIT1:CHAN1:CONT 0\n"); if (errStatus <...
Page 150
Programming Examples How to Measure Power using FETCH and READ /* now the read command is used in the same manner to demonstrate the difference between fetch and read*/ /* read also 10 values, compare them and display the result; */ for (i = 0;...
Page 151
Programming Examples How to Measure Power using FETCH and READ void checkError(ViSession session, ViStatus err_status ) ViStatus error; ViChar errMsg[256]; error = viQueryf(session,"SYST:ERR?\n","%t",errMsg); if (error == VI_ERROR_TMO) printf("System Error!\n") ; exit(1); else /* only errors should be displayed */ if(errMsg[0] != '+') printf("error:%ld -->...
Programming Examples How to Co-ordinate Two Modules 1.4 How to Co-ordinate Two Modules This example shows the interaction of two modules in the same frame. Install a Power Sensor in Slot 1 and a Laser Source in Slot 2 and connect the Laser Source output to the Power Sensor input, before executing this example.
Page 153
Programming Examples How to Co-ordinate Two Modules errStatus = viOpenDefaultRM (&defaultRM); if(errStatus < VI_SUCCESS) printf("Failed to open VISA Resource manager\n"); exit(errStatus); /* Open session to HPIB device at address 20; */ errStatus = viOpen (defaultRM, "GPIB::20::INSTR", VI_NULL,VI_NULL,&vi); if(errStatus < VI_SUCCESS) printf("Failed to open instrument\n");...
Page 154
Programming Examples How to Co-ordinate Two Modules errStatus = viPrintf(vi,"SENS1:CHAN1:POW:RANGE:AUTO 1\n"); checkError(vi,errStatus); /* change the power unit of the power meter to dBm */ errStatus = viPrintf(vi,"SENS1:CHAN1:POW:UNIT 0\n"); checkError(vi,errStatus); /*set the averaging time for measuring to 20 ms, therefore no timeout needs to implemented */ errStatus = viPrintf(vi,"SENS1:CHAN1:POW:ATIME 0.02\n");...
Page 155
Programming Examples How to Co-ordinate Two Modules /* set the power meter reference to the displayed value (display to reference) */ errStatus = viPrintf(vi,"SENS1:CHAN1:POW:REF:DISP\n"); checkError(vi,errStatus); read 30 values and display the result; after ten measurements the source output will be halved by making use of the attenuation; after an other ten measurements the source output will be halved a second time;...
Page 156
Programming Examples How to Co-ordinate Two Modules /* loop, until a key is pressed */ while(!scanf("%c",&c)); /* turn the laser off */ errStatus = viPrintf(vi,"SOURCE2:CHAN1:POW:STATE 0\n"); if (errStatus < VI_SUCCESS) checkError(vi,errStatus); /*close the session */ viClose(vi); void checkError(ViSession session, ViStatus err_status ) ViStatus error;...
Programming Examples How Power Varies with Wavelength 1.5 How Power Varies with Wavelength This example shows how the measured power depends on wavelength. Install a Power Sensor in Slot 1 and a Tunable Laser Source in Slot 2 and connect the Tunable Laser Source output to the Power Sensor input, before executing this example.
Page 158
Programming Examples How Power Varies with Wavelength ViInt32 cmdDone; /* return value for OPC command */ errStatus = viOpenDefaultRM (&defaultRM); if(errStatus < VI_SUCCESS) printf("Failed to open VISA Resource manager\n"); exit(errStatus); errStatus = viOpen (defaultRM, "GPIB::20::INSTR", VI_NULL,VI_NULL,&vi); if(errStatus < VI_SUCCESS) printf("Failed to open instrument\n"); exit(errStatus);...
Page 159
Programming Examples How Power Varies with Wavelength /* set the power meter to same wavelength like the tunable laser source */ errStatus = viPrintf(vi,"SENS1:CHAN1:POW:WAV %s\n",replyBuf); checkError(vi,errStatus); /* read the maximum wavelength from the tunable laser source */ errStatus = viQueryf(vi,"SOURCE2:WAV? MAX\n","%s",replyBuf); checkError(vi,errStatus);...
Page 160
Programming Examples How Power Varies with Wavelength /* turn laser on */ errStatus = viPrintf(vi,"SOURCE2:POW:STATE 1\n"); checkError(vi,errStatus); /* increase the wavelength of the tunable laser source 10 nm until the maximum is reached. read the results from the power meter and display it */ for(i=1;1;i++) /*query the power */ errStatus = viQueryf(vi,"READ1:CHAN1:POW?\n","%s",replyBuf);...
Page 161
Programming Examples How Power Varies with Wavelength /* loop, until a key is pressed */ while(!scanf("%c",&c)); /* turn laser off */ errStatus = viPrintf(vi,"SOURCE2:CHAN1:POW:STATE 0\n"); checkError(vi,errStatus); /* close the session */ viClose(vi); void checkError(ViSession session, ViStatus err_status ) ViStatus error; ViChar errMsg[256];...
Programming Examples How to Log Results 1.6 How to Log Results This example demonstrates how to use logging functions. Install a Power Sensor in Slot 1, before executing this example. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <visa.h> #define MAX_LOG_VALUES 4000 /* max number of values the instrument is capable to log */ #define HEADER_SIZE 7 /* includes 6 bytes header and 1 CR */ /* function prototypes for this examples/*...
Page 163
Programming Examples How to Log Results ViChar replyBuf[256]; /* buffer holding answers of the instrument */ ViChar /* used in the keyboard wait loop */ ViInt32 slot; /* slot number where the power meter is plugged */ ViInt32 chan; /* channel to be logged */ ViInt32 i;...
Page 164
Programming Examples How to Log Results averagingTime); checkError(vi,errStatus); /* start logging */ viPrintf(vi,"SENS%1d:CHAN%1d:FUNC:STAT LOGG,START\n",slot,chan); checkError(vi,errStatus); /* to display the results, logging should be completed */ /* the instrument has to be polled about the progress of the logging */ errStatus = viQueryf(vi,"SENS%1d:CHAN%1d:FUNC:STATE?\n","%t",slot,chan,r eplyBuf);...
Page 165
Programming Examples How to Log Results errStatus = viPrintf(vi,"SENS%1d:CHAN%1d:FUNC:RES?\n",slot,chan); /* only query an error, if there is one, else the query will be interrupted ! */ if(errStatus < VI_SUCCESS)checkError(vi,errStatus); /* read the data binary */ errStatus = viRead(vi, logBuffer, MAX_LOG_VALUES * sizeof(ViReal32) + HEADER _SIZE, &retCnt);...
Page 166
Programming Examples How to Log Results void checkError(ViStatus session, ViStatus err_status ) ViStatus error; ViChar errMsg[256]; error = viQueryf(session,"SYST:ERR?\n","%t",errMsg); if (error == VI_ERROR_TMO) printf("System Error!\n") ; exit(1); else /* only errors should be displayed */ if(errMsg[0] != '+') printf("error:%ld --> %s\n", err_status,errMsg) ; ViStatus InitVisa ( ViSession *iHandle) ViStatus errStatus;...
Page 168
The HP 816x VXIplug&play Instrument Driver This appendix gives you extra information about using the instrument with the HP 816x VXIplug&play driver.
Installing the HP 816x Instrument Driver A.1 Installing the HP 816x Instrument Driver The HP 816x VXIplug&play Instrument Driver comes as a self- extracting archive with an installation wizard. The installation wizard extracts all the files to preset destinations, asking you appropriate questions as it does so.
The HP 816x VXIplug&play Instrument Driver Installing the HP 816x Instrument Driver NOT E If HP 816x VXIplug&play Instrument Driver is already installed on your system, you see a message asking you if you want to uninstall the old version.
The HP 816x VXIplug&play Instrument Driver Installing the HP 816x Instrument Driver N OT E If you do not have VISA installed, press Cancel to temporarily exit this installation procedure; install VISA on your PC, then run hp816x.exe again. If you have VISA installed, press Next> to continue. You see a window that requests you to choose your Setup.
Readme file. 9 Press Finish to complete installation, viewing the Readme file if you wish. A webpage explaining how to get started with the HP 816x VXIplug&play Instrument Driver using HP VEE or LabView appears.
HP VEE allows you to leverage your investment in textual languages by integrating with languages such as C, C++, Visual Basic, FORTRAN, Pascal, and HP BASIC. HP VEE controls HP-IB, VXI, Serial, GPIB, PC Plug-in, and LAN instruments directly over the interfaces or by using instrument drivers.
• Name: enter hp816X. • Interface: HP-IB • Address: Enter the HP-IB address of your HPIB interface board (the default is 7). Append the HP-IB address of your instrument (the default is 20). NOT E To find out or change the instrument’s HP-IB address, press the hardkey on the instrument’s front panel and choose HP-IB...
6 Enter the Parameters to the init() call by entering GPIB::xx::INSTR where xx is your instrument’s HP-IB address. N OT E 20 is the default HP-IB address for your instrument. 7 Select whether to Perform Reset or to Perform Identification Query whenever HP VEE opens the instrument for interaction.
The HP 816x VXIplug&play Instrument Driver Using Visual Programming Environments Getting Started with LabView The 32-bit HP 816x driver can be used with LabView 5.0 and above. LabView 5.0 is a 32-bit version of LabView which runs on Windows 95 and Windows NT.
VI's can then be accessed like any other VI library in LabView. N OT E You must use the 32-bit version of the HP 816x driver with LabView 5.0. N OT E LabView is a trademark of National Instruments Corporation Getting Started with LabWindows The 32-bit HP 816x driver can be used with LabWindows 4.0 and...
• The HP 816x VXIplug&play Instrument Driver conforms with the VXIplug&play standard. There is one exception as the HP 816x driver does not have a soft front panel or a knowledge-based file. • The HP 816x VXIplug&play Instrument Driver is built on top of VISA, and uses the services provided.
C/C++ pointers. A.4 Directory Structure The setup program which installs the HP 816x instrument driver creates the VXIPNP directory if it does not already exist. The structures for the Windows NT and Windows 95 vxipnp subdirectory tree are shown in Figure A-8.
The HP 816x VXIplug&play Instrument Driver Opening an Instrument Session A.5 Opening an Instrument Session To control an instrument from a program, you must open a communication path between the computer/controller and the instrument. This path is known as an instrument session, and is...
The file visatype.h contains a complete listing of the VISA data types, function call casts and some of the common constants. N OT E You can find a partial list of the type definitions and constant definitions for the visatype.h in the HP 816x VXIplug&play Instrument Driver Online Help.
The HP 816x VXIplug&play Instrument Driver Error Handling A.8 Error Handling Events and errors within a instrument control program can be detected by polling (querying) the instrument. Polling is used in application development environments (ADEs) that do not support asynchronous activities where callbacks can be used.
Page 183
The HP 816x VXIplug&play Instrument Driver Error Handling 4 Create a routine to respond to the error or event. This example queries whether an error has occured, checks if the error is an instrument error and then checks if the error is a driver error.
The following information is useful if you are using the driver with a version of VISA. Instrument Addresses When you are using HP VXIplug&play instrument drivers, you should enter the instrument addresses using only upper case letters. This is to ensure maximum portability.
Page 185
VISA DLL. HP VEE 5.01 (or higher) Your copy of HP VEE for Windows contains a document titled Using VXIplug&play drivers with HP VEE for Windows. This document contains the detailed information you need for HP VEE applications.
It may also be obtained on the World Wide Web from ftp://fcext3.external.hp.com/dist/mxd/ vxipnp/pnpdriver.lis. The HP 816x driver is located in a self-extracting archive file called hp816x.EXE. If you do not have ftp or web access, please contact your HP supplier, or use the version of hp816x.exe on your installation...
HP-IB Command Compatibility List This appendix gives information about adapting programs developed for use with HP 8153A Lightwave Multimeter or HP 8167B/8D/8E/8F Tunable Laser Source.
For each table entry in this chapter, it is noted whether the compatibility change affects either: • the HP 8153A Lightwave Multimeter - 8153, • the HP 8167B/8D/8E/8F Tunable Laser Source - 8167/8, or • both of these instruments - Both. HP-IB Bus Compatibility These commands are incompatible.
NTRansition/? STATus:OPERation: PTRansition/? STATus:QUEStionable: NTRansition/? STATus:QUEStionable: PTRansition/? SYSTem:BEEPer:STATe/? Beeper access is not supplied. 8153 User interface or HP-IB settings cannot be stored or 8167/8 *SAV recalled. *RCL Memory card access is not provided. 8167/8 BDATA? DOSMODE/? The TRACe tree is not supported; the CC_UNCAL...
PROGram command tree SENSe:FUNCtion command tree. 8153 Some commands from the PROGram command tree have not been replaced. The HP 8153A application interface on the HP-IB is not supported. Stability/Logging and Min/Max are available via a new interface. Return Loss Module...
Compatibility Issues Accepts TOMODule and TOREF for the first parameter, 8153 SENS:POW:REF instead of accepting TOA|TOB as the HP 8153A does. The numbers 0|1|2 cannot be used, only the strings above. SENS:POW:REF:STAT:RAT Accepts TOREF,0 or values for slot,channel, instead 8153 of accepting TOA|TOB as the HP 8153A does.
Change Command execution may be different. HP-IB will block during command execution, except when executing functions, such as logging and sweep, that don’t tolerate blocking. This is identical to the behavior of the 8167/8. A side effect of this is that *OPC? always returns 1.
Command Order It is not yet known if there are any changes in the command order behavior. Instrument Status Settings The trigger configuration automatically overrides other instrument setting and control capabilities. This applies to both the HP 8153A and HP 8167/8.
Page 196
Error Codes This appendix gives information about error codes used with the HP 8163A Lightwave Multimeter and the HP 8164A Lightwave Measurement System.
Instrument Setup and Status HP-IB Error Strings C.1 HP-IB Error Strings Error New/Old/Standard Number String -100 to -199 Command Errors Standard -100 "Command Error" Standard -101 "Invalid character" Standard -102 "Syntax error" Standard -103 "Invalid separator" Standard -104 "Data type error"...
Page 198
Instrument Setup and Status HP-IB Error Strings Error New/Old/Standard Number String Standard -134 “Suffix too long” Standard -138 “Suffix not allowed” Standard -141 “Invalid character data” Standard -148 “Character data not allowed” Standard -150 “String data error” Standard -151 “Invalid string data”...
Page 199
Instrument Setup and Status HP-IB Error Strings Error New/Old/Standard Number String Standard -222 “Data out of range” Standard -223 “Too much data” Standard -224 “Illegal parameter value” -231 “Data questionable” -261 “Math error in expression” Standard -272 “Macro execution error”...
Page 200
Instrument Setup and Status HP-IB Error Strings Error New/Old/Standard Number String -322 “Flash programming error” -330 “Self-test failed” -340 “Printing error” -341 “Printing error - paper out” -342 “Printing error - offline” Standard -350 “Queue overflow” -400 to -499 Query Errors...
Instrument Setup and Status HP-IB Error Strings Error New/Old/Standard Number String all positive errors -110 “Command header error” -111 “Header seperator error” -114 “Header suffix out of range” -130 “Suffix error” -140 “Character data error” -144 “Character data too long”...
Page 202
Instrument Setup and Status HP-IB Error Strings Error New/Old/Standard Number String -286 “Program runtime error” -311 “Memory error” [checksum or parity] -312 “Protect user data memory lost” -313 “Calibration memory lost” -314 “Save/Recall Memory lost” -315 “Configuration memory lost” Table C-2...
Page 203
Options Status Command Summary ..48 Event Status Enable ..26 Status Information Event Status Register ..56 Status Reporting ...139 Example Programs ..56 STATus subsystem Power Meter Stop continuous measurement ....108 laser start measurement Subsystem ..17 ....137 HP-IB Interface Power meter DISPlay...
Page 204
Index ..... 74 SENSe ... 93 SOURce ... 56 STATus ..65 SYSTem ... 122 TRIGger . 65 SYSTem subsystem ...... 54 Test ....68 Time ... 68 Trace Data Access TRIGger Subsystem ....24 Units ..... 55 Wait...