Agilent Technologies 66lxxA manual Using the National Instruments Gpib Interface

Page 18

Using the National Instruments GPIB Interface

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

The module is identified as a device in two ways. First, the GPIB.COM driver is modified to include the module. Use the mainframe address as the primary bus address and the slot address as the secondary address. The driver requires secondary address 0 (which is for slot 0) to be entered as 96, secondary address 1 to be entered as 97, etc.

It is recommended that you disable auto serial poll in the GPIB.COM driver.

The module expects each command to be terminated by a line feed (character 10) and/or EOI. Configure the GPIB.COM driver to terminate all reads and writes with EOI.

The GPIB driver does all communication via strings. To send numeric data, number to-string conversion must be performed before the IBWRT( ). To read numeric data, string-to-number conversion must be performed after each IBRD( ).

Error handling is accomplished by checking the variable IBSTA%. If it is less than zero, an error has occurred. See the GPIB interface documentation for trapping and interpreting this error variable.

General Setup Information for Microsoft C

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

The address of a module is of type long and is determined the same as with Agilent BASIC. For example, the address 70501L 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 a 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.

Each command library call returns an int. If the value is zero, no error has occurred. Error handling is accomplished by checking the return value. See the command library documentation for interpretation of this error value.

Using the National Instruments GPIB Interface

The module is identified as a device in two ways. First, the GPIB.COM driver is modified to include the module. Use the mainframe address as the primary bus address. Use the slot address as the secondary address. The driver requires that secondary address 0 (which is for slot 0) be entered as 96, secondary address 1 be entered as 97, etc.

It is recommended that you disable the auto serial poll in the GPIB.COM driver.

The module expects each command to be terminated by either a line feed (character 10) and/or EOI. Configure the GPIB.COM driver to terminate all reads and writes with EOI.

The GPIB driver does all communication via strings. To send numeric data, number to-string conversion

must be performed before the ibwrt( ). To read numeric data, string-to-number conversion must be performed after each ibrd( ).

Error handling is accomplished by checking the variable IBSTA%. If bit 15 is set, an error has occurred. See the GPIB interface documentation for the interpretation of this error variable.

18 Introduction To Programming

Image 18
Contents Agilent Part No Microfiche Part No Update April Programming GuideSafety Guidelines Contents Abor Status Reporting Synchronizing Power Module Output Changes Error MessagesDocumentation Summary IntroductionAbout This Guide External ReferencesAccessing Online Help VXIplug&play Power Products Instrument DriversDownloading and Installing the Driver Supported ApplicationsModule Gpib Address Gpib Capabilities Of The Power ModuleIntroduction To Programming Introduction To ScpiRST *IDN? *SRE Volt LEV Prot Curr Voltlev 8.0 Prot 8.8 CURR?Outpprotdel Traversing the Command Tree Effect of Optional HeadersVoltagelevel 7PROTECTION 8CURRENTLEVEL 3MODE List Outputprotectionclear STATUSOPERATIONCONDITION?OUTPUTPROTECTIONCLEARSTATUSOPERATIONCONDITION? Volttrig 7.5INIT*TRG Outp OFF*RCL 2OUTP onListening Formats SymbolNumerical Data Formats Talking Formats Suffixes and Multipliers Class Unit Unit with MultiplierSystem Considerations Assign @PM3TOError Handling Agilent Basic ControllersUsing the National Instruments Gpib Interface Sending the Command Volt 5 in Basic Sending the Command Volt 5 in CReceiving Data from the Module Receiving Module Data with BasicReceiving Module Data with C Language Dictionary IntroductionMeaning and Type Description Of Common CommandsCLS DescriptionESE Bit Configuration of Standard Event Status Enable RegisterESE ESR?IDN? OPCOPC? OPT? PSCRCL RCLRST SAV SRESRE Bit Configuration of Status Byte Register STB?TRG WAI Description of Subsystem CommandsTST? AborSubsystem Tree Diagram Calibration Subsystem CalautoCalcurrlev Calauto 1 Calauto OnceCalcurr CalpassCalvolt CalsaveCalstat CalvoltlevCurr 500 MA Currlev CalvoltprotCurr CurrmodeCurrtrig CurrprotstatCurrprotstat OFF Currtrig 1200 MA CurrlevtrigListcoun Listcoun INF Init Initcont 1 Initcont onListcoun ListcurrLISTDWELPOIN? LISTCURRPOIN?Listdwel ListstepLISTVOLTPOIN? ListvoltListvolt 2.0,2.5,3.0 Listvolt MAX,2.5,MIN MEASCURR? MEASVOLT?Outp Outpstat ON,NORELAY OutpprotOutprelpol Outpprotcle Outpprotdel 75E-1Outprel NormOutpttltlink OutpttltOutpttlt 1 Outpttlt OFF Outpttltsour LinkSTATOPERCOND? STATOPER?STATOPEREVEN? StatoperenabStat Oper NTR 32 Stat Oper PTR StatpresSTATQUESCOND? STATQUES?STATQUESEVEN? Stat Ques COND?Trigger Subsystem SYSTERR?SYSTVERS? TrigTrigdel .25 Trigdel MAX Trig Trig IMMTrigdel TriglinkVoltmode VoltVoltlev Voltmode List Voltmode FIXVOLTSENSSOUR? VolttrigVolttrig 1200 MV Voltlevtrig Power Module Programming Parameters Link Parameter ListStatus Reporting Power Module Status StructureStatus Register Bit Configuration Operation Status GroupBit Signal Bit Configurations of Status Registers Meaning Status Questionable Commands QueryQuestionable Status Group Power Module Status Model Standard Event Status GroupStatus Byte Register Output QueueLocation Of Event Handles Initial Conditions At Power On ExamplesSTATOPEREVEN?QUESEVEN? Statoperptr 5376ENABStatquesptr 18ENAB Statoperptr 1024NTR Statoperenab 1024*SRESynchronizing Power Module Output Changes Trigger SubsystemModel of Fixed-Mode Trigger Operation Delaying State Idle StateInitiated State Trigger Status and Event Signals Model of List Mode Trigger OperationINITiateCONTinuous Command Output Change StateOutpttltsour List Subsystem Listcurr 2,3,12,15 Listvolt 3.0,3.25,3.5,3.75 Listdwel 10,10,25,40Automatically Repeating a List Triggering a ListTiming diagrams of Liststep Operation DFI Discrete Fault Indicator Subsystem Scpi Command CompletionRI Remote Inhibit Subsystem System Error Messages Error MessagesPower Module Hardware Error Messages Standard Event Status Register Error Bits222 -223 -241 -310 -330 -350 -400 -410 -420 -430 Scpi Conformance Information Scpi Confirmed CommandsScpi Approved Commands Scpi VersionNon-SCPI Commands Application Programs Application 1. Sequencing Multiple Modules During Power Up Figure B1-1. Block Diagram of Application #1 Variations On This ImplementationFigure B1-2. Timing Diagram of Application #1 Enable Output Reset and Clear ModuleEnable Backplane TTL Trigger Drive Enable Response to TriggerImplementation Details How The MPS Implements The Solution MPS Set Up Figure B2-1. Block Diagram of Application #2 Enable Response to TTL Trigger When a CV-TO-CC Transition OccursEnable TTL Trigger Drive 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 Stop Voltage for Ramp Option BaseStart Voltage for Ramp SecondsApplication 4. Providing Time-Varying Voltages Figure B4-1. Voltage Waveform for Application #4Module set up Variations On This Implementation Enable Detection of OC Condition Enable OCPNo Delay Before Protection Occurs 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 Dwell Time Data GO to 12 V When TriggeredCurrent Limit Data SET to GET Current from ListApplication 6. Output Sequencing Paced by the Computer Nominal 12MPS Set Up Figure B6-1. Block Diagram of Application #6 To be Tested These are the BiasSupply Limit Conditions Number of Bias Supply Limit C0MBINATIONSReturn Overview Of Application Advantages/Benefits Of The MPS Solution Figure B7-1. Block Diagram of Application #7 Enable SRQ Interrupt When the Module Indicates SIC Step CompletedWhen IT Completes the LIST. OPC Generates SRO Enable Intr Identify Handler SubroutineSupplemental Information ‘ Conversion to Send Real Numbers Over the BUS CMD$ = Output on ‘ Enable OutputCMD$ = Initiate ‘ Enable Trigger to Start List CMD$ = Voltmode List ‘ SET to GET Voltage from ListCONDITION.DATA = Call Iooutputs SLOTO, CMDS, LWaiting for Trigger BIT 5 of the Operation Status Register Wend‘ Program N3.BAS ‘ Disable Auto Serial PollIf IBSTA% 0 then Goto ‘ AS Part of the Command String ‘ INSTRUMENT.NAME$ = Sloto‘ General Error Handler If IBSTA% 0 then Goto Selected AS a Trigger SourceStop Application #3 Controlling Voltage Ramp UP AT Turn on Dwell = ramptimeTo 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 Agilent Sales and Support Offices United States Latin AmericaManual Updates