Agilent Technologies 66lxxA ‘ Program N3.BAS, ‘ Disable Auto Serial Poll, ‘ Followed by a Comma

Page 101

1‘ MERGE "DECL.BAS" AS INSTRUCTED IN YOUR NATIONAL INSTRUMENTS GPIB-PC MANUAL

2

1000

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

1010

‘ FOR GWBASIC AND THE NATIONAL INSTRUMENTS GPIB-PC INTERFACE CARD

1020

‘ PROGRAM: N3.BAS

 

1030

 

1040

‘ CONFIGURE THE GPIB.COM HANDLER FOR THE FOLLOWING:

1050

 

1060

‘ EOI ENABLED FOR BOTH READ AND WRITE

 

1070

‘ DISABLE AUTO SERIAL POLL

 

1080

 

 

1090

‘ INSTRUMENT.NAME$ = "SLOTO"

 

1100

CALL IBFIND( INSTRUMENT.NAME$, SLOTO% )

 

1110

IF SLOTO% < 0 THEN PRINT “COULDN'T FIND MODULE" : STOP

1120

 

1130

OPTION BASE 1

 

1140

VSTEP$ = “”

‘ STRING TO HOLD THE VOLTAGE RAMP STEPS

1150

VSTART = 2

‘ START VOLTAGE FOR RAMP

1160

VSTOP = 10

‘ STOP VOLTAGE FOR RAMP

1170

RAMPTIME = .5

‘ TIME IN SECONDS TO CHANGE FROM VSTART TO VSTOP

1180

DWELL = RAMPTIME / 19

‘ DWELL TIME FOR EACH POINT

1190

 

1200

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

1210

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

1220

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

1230

'

 

1240

' SINCE THE NATIONAL INSTRUMENTS GPIB-PC WORKS WITH STRINGS, THE RAMP DATA MUST BE CONSOLIDATED INTO A

1250

' SINGLE STRING WHICH CONTAINS ALL THE POINTS, SEPARATED BY COMMAS.

1260

 

1270

FOR I=1 TO 20

‘ MAKES THE STRING EQUIVALENTS OF THE

1280

VSTEP$ = VSTEP$ + STR$( VSTART + ((( VSTOP - VSTART ) / 20 *I )) ‘ VOLTAGE POINTS AND CONCATENATES THEM ONLY

1290

IF I <> 20 THEN VSTEP$=VSTEP$+","

‘ FOR THE FIRST 19 POINTS, EACH FOLLOWED

1300

NEXT I

‘ BY A COMMA. THE LAST POINT IS NOT

1310

‘ FOLLOWED BY A COMMA.

1320

 

1330

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

‘ RESET AND CLEAR MODULE

1340

CALL IBWRT( SLOTO%, CMD$ )

 

1350

IF IBSTA% < 0 THEN GOTO 1960

 

1360

 

1370

CMD$ = "VOLT “ + STR$( VSTART )

‘ START RAMP AT VSTART. USE NUMBER TO STRING

1380

CALL IBWRT( SLOTO%, CMD$ )

‘ CONVERSION TO SEND REAL NUMBERS OVER THE BUS

1390

IF IBSTA% < 0 THEN GOTO 1960

‘ AS PART OF THE COMMAND STRING.

1400

 

1410

CMD$ = "CURR .1"

 

1420

CALL IBWRT( SLOTO%, CMD$

 

1430

IF IBSTA% < 0 THEN GOTO 1960

 

1440

 

1450

CMD$ = "OUTPUT ON"

‘ ENABLE OUTPUT

1460

CALL IBWRT( SLOTO%, CMD$ )

 

1470

IF IBSTA% < 0 THEN GOTO 1960

 

1480

 

1490

CMD$ = "VOLT:MODE LIST"

‘ SET TO GET VOLTAGE FROM LIST

1500

CALL IBWRT( SLOTO%, CMD$ )

 

1510

IF IBSTA% < 0 THEN GOTO 1960

 

1520

 

1530

CMD$ = "LIST:VOLT “ + VSTEP$

‘ DOWNLOAD VOLTAGE LIST POINTS

1540

CALL IBWRT( SLOTO%, CMD$ )

 

1550

IF IBSTA% < 0 THEN GOTO 1960

 

1560

 

1570

CMD$ = "LIST:DWELL” + STR$(DWELL )

‘ DOWNLOAD 1 DWELL TIME. USE NUMBER TO STRING

102 Application Programs

Image 101
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