Agilent Technologies Agilent 6031A Video Gaming Accessories User Manual


 
Programming the Agilent 603xA Power Supplies Using Basic
119
80 !
90 DEF FNOr_mode
100 COM /Ps/ @Ps
110 OUTPUT @Ps; “STS”
120 ENTER @Ps; Stat
130 RETURN BIT (Stat .2)
140 FNEND
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.
10 ASSIGN @Ps T0 705
20 COM /Ps /@Ps
30 IF FNAstat_bit(2) THEN
40 PRINT "SUPPLY ENTERED 0R MODE'“
50 END IF
60 END
70 !
80 !
90 DEF FNAstat_bit(Abit)
100 COM /Ps/ @Ps
110 OUTPUT @Ps; “ASTS”
120 ENTER @Ps; Asts
130 RETURN BIT (Asts.Abit)
140 FNEND
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
100 Bring in common block for I/O path name
110-120: Read accumulated status into variable ASTS
130: Return value of bit 2 of ASTS