10! APPLICATION #3: CONTROLLING VOLTAGE RAMP UP AT TURN ON

20! PROGRAM: APP_3

30

!

 

 

40

ASSIGN @Slot0 To 70500

!

SELECT CODE 7, MAINFRAME ADDRESS 05, SLOT 00

50

!

 

 

60

OPTION BASE 1

 

 

70

DIM V_Step(20)

!

ARRAY TO HOLD THE VOLTAGE RAMP STEPS

80

Vstart=2

!

START VOLTAGE FOR RAMP

90

Vstop=10

!

STOP VOLTAGE FOR RAMP

100

Ramp_time=.5

!

SECONDS TO CHANGE FROM Vstart TO Vstop

110

Dwell=Ramp_time/19

!

IN SECONDS

120

!

 

 

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

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

150! ALSO, YOU ONLY NEED TO DOWNLOAD 1 DWELL TIME. IF THE MODULE RECEIVES ONLY 1 DWELL TIME, IT ASSUMES

160! YOU WANT THE SAME DWELL TIME FOR EVERY POINT IN THE LIST.

170!

180FOR I=1 TO 20

190

V_step(l)=Vstart+(((Vstop-Vstart)/20)*I)

!

CALCULATES VOLTAGE LIST POINTS

200NEXT I

210!

220

OUTPUT @Slot0;"*RST;*CLS;STATUS:PRESET"

!

RESET AND CLEAR MODULE

230

OUTPUT @Slot0;”VOLT ";Vstart

!

START RAMP AT Vstart

240

OUTPUT @Slot0;”CURR .1”

 

 

250

OUTPUT @Slot0;"OUTPUT ON"

!

ENABLE OUTPUT

260

OUTPUT @Slot0;”VOLT:MODE LIST"

!

SET TO GET VOLTAGE FROM LIST

270

OUTPUT @Slot0;”LIST:VOLT ";V_step(*)

!

DOWNLOAD VOLTAGE POINTS

280

OUTPUT @Slot0;”LIST:DWELL ";Dwell

!

DOWNLOAD 1 DWELL TIME

290

OUTPUT @Slot0;”LIST:STEP AUTO"

!

DWELL-PACED LIST

300

OUTPUT @Slot0;”INITIATE"

!

ENABLE TRIGGER TO START LIST

310

!

 

 

320! BEFORE TRIGGERING THE MODULE, DETERMINE IF IT IS READY BY CHECKING FOR

330! 'WAITING FOR TRIGGER' (BIT 5 OF THE OPERATION STATUS REGISTER).

340!

350! YOU COULD ELIMINATE THIS STEP BY SIMPLY INSERTING A PAUSE IN THE PROGRAM. HOWEVER, BY

360! CHECKING THE INSTRUMENT STATUS, YOU CAN AVOID TIMING PROBLEMS. ALSO, ANY OTHER OPERATIONS

370! THAT TAKE TIME WILL GIVE THE MODULE A CHANCE TO COMPLETE PROCESSING.

380!

390REPEAT

400

OUTPUT @Slot0;”STATUS:OPERATION:CONDITION?"

 

410

ENTER @Slot0;Condition_data

 

 

420

UNTIL BIT(Condition_data,5)

!

TEST FOR BIT 5 = TRUE

430

!

 

 

440! SEND TRIGGER COMMAND TO START LIST AND GENERATE THE VOLTAGE RAMP

450!

460

OUTPUT @Slot0;”TRIGGER:IMMEDIATE"

!

THIS IS AN IMMEDIATE TRIGGER, WHICH IS ALWAYS ACTIVE.

470

 

!

THEREFORE, IT DOES NOT NEED TO BE SELECTED AS A TRIGGER

 

 

 

SOURCE.

480!

490END

Figure B3-4. Agilent BASIC Program Listing for Application #3

Application Programs 81

Page 80
Image 80
Agilent Technologies 66lxxA Option Base, Start Voltage for Ramp, Stop Voltage for Ramp, Seconds, Download 1 Dwell Time