Agilent Technologies 66lxxA manual Supplemental Information

Page 98

Supplemental Information

This appendix contains program listings translated into the following DOS-compatible languages and GPIB interfaces:

GWBASIC and the Agilent 61062/82990/82335A GPIB Command Library for MS-DOS

GWBASIC and the National Instruments GPIB-PC Interface Card

Microsoft C and the Agilent 61062/82990/82335A GPIB Command Library for MS-DOS

Microsoft C and the National Instruments GPIB-PC Interface Card

Each program is translated from the Agilent BASIC listing found in application #3. This example program was chosen as representative of all application programs because it shows how to:

Configure the interface card.

Address the power module.

Write strings to the power module.

Write real arrays to the power module.

Receive real numbers from the power module.

The six other application programs all use a subset of the above functions.

1’ MERGE "SETUP.BAS" AS DESCRIBED IN YOUR GPIB COMMAND LIBRARY MANUAL

2

1000

‘ APPLICATION #3: CONTROLLING VOLTAGE RAMP UP AT TURN ON

1010

‘ FOR GWBASIC AND THE Agilent 61062/82990/82335A GPIB COMMAND LIBRARY

1020

‘ PROGRAM: Agilent 3.BAS

 

 

1030

 

 

 

1040

OPTION BASE 1

 

 

1050

INTERFACE = 7

‘ SELECT CODE OF THE GPIB CARD

1060

SLOTO

705001

‘ SELECT CODE 7, MAINFRAME ADDRESS 05, SLOT 00

1070

CR.LFS

CHR$(13) + CHR$(10)

‘ CARRIAGE RETURN + LINE FEED = END OF LINE TERMINATION

1080

DIM VSTEP(20)

‘ ARRAY TO HOLD THE VOLTAGE RAMP STEPS

1090

NUM.POINTS = 20

‘ NUMBER OF POINTS IN THE VOLTAGE RAMP ARRAY

1100

VSTART = 2

‘ START VOLTAGE FOR RAMP

1110

VSTOP = 10

‘ STOP VOLTAGE FOR RAMP

1120

RAMPTIME = .5

‘ TIME IN SECONDS TO CHANGE FROM VSTART TO VSTOP

1130

DWELL = RAMPTIME / 19

‘ DWELL TIME FOR EACH POINT

1140

 

 

 

1150

‘ SINCE THE OUTPUT STAYS AT THE LAST VOLTAGE POINT AFTER ITS DWELL TIME EXPIRES, THE DWELL TIME OF THE

1160

‘ LAST POINT IS NOT PART OF THE TRANSITION TIME. THEREFORE, DIVIDE THE TOTAL TIME BY 19 POINTS, NOT 20.

1170

‘ YOU WANT THE SAME DWELL TIME FOR EVERY POINT IN THE LIST, SO YOU NEED TO DOWNLOAD ONLY 1 DWELL TIME.

1180

 

 

 

1190

FOR I=1 TO 20

 

 

1200

VSTEP(I) = VSTART + ((( VSTOP - VSTART ) / 20 ) * I )

‘ CALCULATES VOLTAGE LIST POINTS

1210

NEXT I

 

 

 

1220

 

 

 

1230

NOTE REGARDING GPIB READ/WRITE TERMINATIONS:

 

1240

 

 

 

1250

‘ THE DEFAULT MODE OF THE INTERFACE CARD IS THAT EOI IS ENABLED AND THE READ/WRITES TERMINATE

1260

‘ ON CARRIAGE RETURN/LINE FEED. THE MODULE TERMINATES ON EITHER EOI OR LINE FEED, SO THE

1270

‘ DEFAULT SETTINGS OF THE CARD ARE SUFFICIENT.

 

1280

 

 

 

1290

CMD$ = "*RST;*CLS;STATUS:PRESET"

‘ RESET AND CLEAR MODULE

1300

L = LEN( CMD$ )

 

 

1310

CALL IOOUTPUTS( SLOTO, CMD$, L )

 

 

1320

IF PCIB.ERR<>0 THEN ERROR PCIB.BASERR

 

 

1330

 

 

 

Application Programs 99

Image 98
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?OPC? IDN?OPC OPT? PSCRST RCLRCL SRE SAVSRE TRG Bit Configuration of Status Byte RegisterSTB? 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 FIXVolttrig 1200 MV Voltlevtrig VOLTSENSSOUR?Volttrig Power Module Programming Parameters Link Parameter ListStatus Reporting Power Module Status StructureStatus Register Bit Configuration Operation Status GroupQuestionable Status Group Bit Signal Bit Configurations of Status Registers MeaningStatus Questionable Commands Query Power Module Status Model Standard Event Status GroupLocation Of Event Handles Status Byte RegisterOutput Queue Initial Conditions At Power On ExamplesSTATOPEREVEN?QUESEVEN? Statoperptr 5376ENABStatquesptr 18ENAB Statoperptr 1024NTR Statoperenab 1024*SREModel of Fixed-Mode Trigger Operation Synchronizing Power Module Output ChangesTrigger Subsystem Initiated State Delaying StateIdle 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 RI Remote Inhibit Subsystem DFI Discrete Fault Indicator SubsystemScpi Command Completion 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$ = SlotoStop ‘ General Error HandlerIf IBSTA% 0 then Goto Selected AS a Trigger Source 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