80 !

90DEF FNOr_mode

100COM /Ps/ @Ps

110OUTPUT @Ps; “STS”

120ENTER @Ps; Stat

130RETURN BIT (Stat .2)

140FNEND

Explanation:

10:Assign I/O path name to power supply

20:Declare common block for I/O path name

30:If FNOR_MODE= true then print message

90:Define function OR_MODE Bring in common block for I/O path name

110-120: Read present status of power supply into the variable stat

130:Return value of bit 2 of STAT

Accumulated Status

Accumulated status is structured the same as present status except the bits are latched. This allows the user to determine whether the supply entered an operating mode, even if only momentarily, since last reading the register. The device query "ASTS?" will instruct the supply to output the accumulated status. Reading the accumulated status also sets the accumulated status equal to the present status.

EXAMPLE 4: Function to check any one bit in the accumulated status register. The calling program treats the function as a Boolean variable in a conditional execution statement. This function can be used to determine whether the supply entered a given state since the function was last called. In this case, the ’OR’ bit (bit 2) is tested.

10ASSIGN @Ps T0 705

20COM /Ps /@Ps

30IF FNAstat_bit(2) THEN

40PRINT "SUPPLY ENTERED 0R MODE'“

50

END IF

60

END

70

!

80

!

90DEF FNAstat_bit(Abit)

100COM /Ps/ @Ps

110OUTPUT @Ps; “ASTS”

120ENTER @Ps; Asts

130RETURN BIT (Asts.Abit)

140FNEND

Explanation:

10:Assign I/O path name to power supply

20:Declare common block for I/O path name

30-50:If FNA stat bit= true then print message

90:Define function ASTAT_BIT

100Bring in common block for I/O path name

110-120: Read accumulated status into variable ASTS

130:Return value of bit 2 of ASTS

Programming the Agilent 603xA Power Supplies Using Basic 119

Page 119
Image 119
Agilent Technologies 6032A, 6035A, 6028A, 6033A, 603xA, 6023A, 6038A 6010A, 6031A manual Accumulated Status