C++ Programming Example - Keysight Technologies N3301A Programming Manual

Dc electronic loads
Table of Contents

Advertisement

3 - Programming Examples
230
OUTPUT 705;"INPUT OFF"
240
PRINT "Burn-in test complete at ";TIME$(TIMEDATE)
250
STOP
260
!
270
Srq_service
280
Load_status=SPOLL(705)
290
IF BIT(Load_status, 6) THEN
300
GOSUB Check_unr
310
ELSE
320
PRINT "A condition other than UNR generated SRQ at ";TIME$(TIMEDATE)
330
END IF
340
ENABLE INTR 7
350
RETURN
360
!
370
Check_unr
380
WAIT 1
390
OUTPUT 705;"STAT:CHAN:COND?"
400
ENTER 705;Value
410
IF Bit(Value, l0)=0 THEN
420
OUTPUT 705;"*CLS"
430
PRINT "UNR was momentarily asserted at ";TIME$(TIMEDATE)
440
ELSE
450
OUTPUT 705;"INPUT OFF"
460
PRINT "UNR is asserted at ";TIME$(TIMEDATE);" Input is turned off"
470
STOP
480
END IF
490
RETURN
500
END

C++ Programming Example

This program demonstrates the use of lists and triggered measurements in a Keysight N3300A Electronic
Load. The load is programmed to step through three values of current at 1 second intervals. At each
current step, the load measures its own current by sampling it 50 times at 10 microsecond intervals. The
program reads back all of the data, averages the 50 samples for each of the three current steps, and
outputs the results. After each current step, the measurement is delayed by 100us to allow the current to
settle.
#include <stdio.h>
#include <stdlib.h>
#include "sicl.h"
#define MEAS_BUF_SIZE 4096 /* Size of measurement buffer in load. */
/* SICL error handler */
void ErrorHandler(INST id, int error)
{
printf("SICL error %d\n", error);
exit(1);
}
/* Each triggered measurement consists of nPoints samples.
* triggered measurements are taken, all of the samples (nPoints times the
* number of measurements) are placed in the load's measurement buffer.
* This function averages the samples in the buffer that are associated
* with one triggered measurement.
* nPoints samples are averaged; when nIndex is 1, the 2nd set of nPoints
* samples are averaged; etc.
*/
52
! Disables the input at end of test
! Service request subroutine
! Conduct serial poll
! Check if SRQ bit is set
! You can also check the other bits
! Re-enable interrupts before return
! Check if UNR bit still set
! Wait 1 s before reading UNR bit
! Read channel condition register
! Return value for UNR bit only
! If 0, clear channel event register
! Disables the inputs
When nIndex is 0, the first set of
If multiple

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the N3301A and is the answer not in the manual?

This manual is also suitable for:

N3300aN3302aN3305aN3303aN3307aN3306a ... Show all

Table of Contents