Agilent Technologies 66lxxA manual Error Handling, Agilent Basic Controllers

Page 17

Your application program will not include the power module symbolic name and GPIB address. These must be specified during configuration (when you run IBCONF.EXE). Note that the primary address range is from 0 to 30 but any secondary address must be specified in the address range of 96 to 126. The power supply expects a message termination on EOI or line feed, so set EOI w/last byte of Write. It is also recommended that you set Disable Auto Serial Polling.

All function calls return the status word IBSTA%, which contains a bit (ERR) that is set if the call results in an error. When ERR is set, an appropriate code is placed in variable IBERR %. Be sure to check IBSTA %, after every function call. If it is not equal to zero, branch to an error handler that reads IBERR% to extract the specific error.

Error Handling

If there is no error-handling code in your program, undetected errors can cause unpredictable results. This includes "hanging up" the controller and forcing you to reset the system. Both of the above DOS drivers have routines for detecting program execution errors.

Important Use error detection after every call to a subroutine.

Agilent BASIC Controllers

The Agilent BASIC Programming Language provides access to GPIB functions at the operating system level. This makes it unnecessary to have the header files required in front of DOS applications programs. Also, you do not have to be concerned about controller "hangups" as long as your program includes a timeout statement. Because the power module can be programmed to generate SRQ on errors, your program can use an SRQ service routine for decoding detected errors. The detectable errors are listed in "Chapter 5 - Error Messages".

TRANSLATION AMONG LANGUAGES

This section explains how to translate between Agilent BASIC and several other popular programming environments. For explicit information on initializing interface cards or syntax of language, see the documentation that accompanies your GPIB interface product.

General Setup Information for GWBASIC

Using the Agilent 82335A/82990A/61062B GPIB Command Library

When CALLs are made to the GPIB Command Library, all parameters are passed as variables.

The address of a module is a real number, determined in the same manner as in Agilent BASIC. For example, the address 70501 means 7 is the select code of the GPIB interface, 05 is the GPIB address of the mainframe, 01 is the slot number (secondary address) of the module.

The module expects each command to be terminated by line feed (character 10) and/or EOI. The default configuration of the GPIB Command Library is carriage return + line feed for end-of-line termination and EOI at the end of a line. Therefore, the defaults are correct for use with the module.

The GPIB Command Library supports strings, numeric and array data formats. However, multiple data types cannot be sent in a single command. To send both string and numeric data in one command, convert all numeric data to strings, concatenate with the string data and send the combined string to the module. To read multiple data types, read the data into a string, and then manipulate the string by converting each piece into the appropriate data format.

Error handling is accomplished by checking the variable PCIB.ERR. If it is nonzero, an error has occurred. See the command library documentation for trapping and interpreting this error variable.

Introduction To Programming 17

Image 17
Contents Programming Guide Agilent Part No Microfiche Part No Update AprilSafety Guidelines Contents Abor Status Reporting Error Messages Synchronizing Power Module Output ChangesAbout This Guide IntroductionDocumentation Summary External ReferencesDownloading and Installing the Driver VXIplug&play Power Products Instrument DriversAccessing Online Help Supported ApplicationsIntroduction To Programming Gpib Capabilities Of The Power ModuleModule Gpib Address Introduction To ScpiRST *IDN? *SRE Voltlev 8.0 Prot 8.8 CURR? Volt LEV Prot CurrOutpprotdel Effect of Optional Headers Traversing the Command TreeOUTPUTPROTECTIONCLEARSTATUSOPERATIONCONDITION? Outputprotectionclear STATUSOPERATIONCONDITION?Voltagelevel 7PROTECTION 8CURRENTLEVEL 3MODE List Volttrig 7.5INIT*TRG Outp OFF*RCL 2OUTP onNumerical Data Formats Talking Formats SymbolListening Formats Suffixes and Multipliers Class Unit Unit with MultiplierAssign @PM3TO System ConsiderationsAgilent Basic Controllers Error HandlingUsing the National Instruments Gpib Interface Sending the Command Volt 5 in C Sending the Command Volt 5 in BasicReceiving Module Data with Basic Receiving Data from the ModuleReceiving Module Data with C Introduction Language DictionaryCLS Description Of Common CommandsMeaning and Type DescriptionESE Bit Configuration of Standard Event Status Enable RegisterESE ESR?OPC? IDN?OPC PSC OPT?RST RCLRCL SRE SAVSRE TRG Bit Configuration of Status Byte RegisterSTB? TST? Description of Subsystem CommandsWAI AborCalauto Subsystem Tree Diagram Calibration SubsystemCalcurr Calauto 1 Calauto OnceCalcurrlev CalpassCalstat CalsaveCalvolt CalvoltlevCurr CalvoltprotCurr 500 MA Currlev CurrmodeCurrprotstat OFF CurrprotstatCurrtrig Currtrig 1200 MA CurrlevtrigListcoun Init Initcont 1 Initcont onListcoun Listcoun INF ListcurrListdwel LISTCURRPOIN?LISTDWELPOIN? ListstepListvolt 2.0,2.5,3.0 Listvolt MAX,2.5,MIN ListvoltLISTVOLTPOIN? MEASCURR? MEASVOLT?Outpprot Outp Outpstat ON,NORELAYOutprel Outpprotcle Outpprotdel 75E-1Outprelpol NormOutpttlt 1 Outpttlt OFF OutpttltOutpttltlink Outpttltsour LinkSTATOPEREVEN? STATOPER?STATOPERCOND? StatoperenabStatpres Stat Oper NTR 32 Stat Oper PTRSTATQUESEVEN? STATQUES?STATQUESCOND? Stat Ques COND?SYSTVERS? SYSTERR?Trigger Subsystem TrigTrigdel Trig Trig IMMTrigdel .25 Trigdel MAX TriglinkVoltlev VoltVoltmode Voltmode List Voltmode FIXVolttrig 1200 MV Voltlevtrig VOLTSENSSOUR?Volttrig Link Parameter List Power Module Programming ParametersStatus Register Bit Configuration Power Module Status StructureStatus Reporting Operation Status GroupQuestionable Status Group Bit Signal Bit Configurations of Status Registers MeaningStatus Questionable Commands Query Standard Event Status Group Power Module Status ModelLocation Of Event Handles Status Byte RegisterOutput Queue Examples Initial Conditions At Power OnStatquesptr 18ENAB Statoperptr 5376ENABSTATOPEREVEN?QUESEVEN? Statoperptr 1024NTR Statoperenab 1024*SREModel of Fixed-Mode Trigger Operation Synchronizing Power Module Output ChangesTrigger Subsystem Initiated State Delaying StateIdle State INITiateCONTinuous Command Model of List Mode Trigger OperationTrigger Status and Event Signals Output Change StateOutpttltsour List Subsystem Automatically Repeating a List Listvolt 3.0,3.25,3.5,3.75 Listdwel 10,10,25,40Listcurr 2,3,12,15 Triggering a ListTiming diagrams of Liststep Operation RI Remote Inhibit Subsystem DFI Discrete Fault Indicator SubsystemScpi Command Completion Power Module Hardware Error Messages Error MessagesSystem Error Messages Standard Event Status Register Error Bits222 -223 -241 -310 -330 -350 -400 -410 -420 -430 Scpi Approved Commands Scpi Confirmed CommandsScpi Conformance Information Scpi VersionNon-SCPI Commands Application Programs Application 1. Sequencing Multiple Modules During Power Up Variations On This Implementation Figure B1-1. Block Diagram of Application #1Figure B1-2. Timing Diagram of Application #1 Enable Backplane TTL Trigger Drive Reset and Clear ModuleEnable Output Enable Response to TriggerImplementation Details How The MPS Implements The Solution MPS Set Up Figure B2-1. Block Diagram of Application #2 Enable TTL Trigger Drive When a CV-TO-CC Transition OccursEnable Response to TTL Trigger Start AT 15Application 3. Controlling Output Voltage Ramp Up at Turn On Figure B3-1. Simulating a Slow Voltage Ramp Generating the Desired Voltage Ramp for Application #3 Start Voltage for Ramp Option BaseStop Voltage for Ramp SecondsFigure B4-1. Voltage Waveform for Application #4 Application 4. Providing Time-Varying VoltagesModule set up Variations On This Implementation No Delay Before Protection Occurs Enable OCPEnable Detection of OC Condition Enables Detection on Positive TRANSITION, I.EApplication 5. Providing Time-Varying Current Limiting Figure B5-1. Typical DUT Current vs. Time Implementation Details How The MPS Implements The Sequence Current Limit Data GO to 12 V When TriggeredDwell Time Data SET to GET Current from ListNominal 12 Application 6. Output Sequencing Paced by the ComputerMPS Set Up Figure B6-1. Block Diagram of Application #6 Supply Limit Conditions These are the BiasTo be Tested Number of Bias Supply Limit C0MBINATIONSReturn Overview Of Application Advantages/Benefits Of The MPS Solution Figure B7-1. Block Diagram of Application #7 When IT Completes the LIST. OPC Generates SRO When the Module Indicates SIC Step CompletedEnable SRQ Interrupt Enable Intr Identify Handler SubroutineSupplemental Information CMD$ = Initiate ‘ Enable Trigger to Start List CMD$ = Output on ‘ Enable Output‘ Conversion to Send Real Numbers Over the BUS CMD$ = Voltmode List ‘ SET to GET Voltage from ListWaiting for Trigger BIT 5 of the Operation Status Register Call Iooutputs SLOTO, CMDS, LCONDITION.DATA = WendIf IBSTA% 0 then Goto ‘ AS Part of the Command String ‘ Disable Auto Serial Poll‘ Program N3.BAS ‘ INSTRUMENT.NAME$ = SlotoStop ‘ General Error HandlerIf IBSTA% 0 then Goto Selected AS a Trigger Source Dwell = ramptime Application #3 Controlling Voltage Ramp UP AT Turn onTo terminate the iooutputa Int error Char *badstring If error != EOl enabled for both read and write Strcatvlist, vpoint This is a generalized error checking routine Index IndexIndex Index Index United States Latin America Agilent Sales and Support OfficesManual Updates