Friday, June 29, 2012

Using Power Supply Status Registers in your Program – Not So Scary

Hello everyone!  Today I am going to talk about how to use the Operation Status and Questionable Status Registers on Agilent’s power supplies.  All of Agilent’s SCPI based power supplies use these registers.  Figure 1 is a pictorial representation of the status system of the Agilent N6700 Modular Power System:

Figure 1 N6700 Status Model
Looks pretty daunting, doesn’t it?  After reading this blog post, it won’t be so scary anymore.   There are many great uses for these registers in your programs.

The Questionable Status Group lets you know if your power supply is in an abnormal operating state.  Sometimes your power supply will be in protect mode when these states are encountered.  You typically want to query this to make sure that your power supply does not transition to one of these abnormal states.  Here is a list of all the members of the Questionable Status Group:

Figure 2 N6700 Questionable Status Group

The Operation Status Group provides the normal operating modes of the power supply.  You typically want to query this register to either make sure that the power supply is either in the correct operating state or that it has completed some task (such as initiating a trigger or performing a measurement).  Here are the different members of the Operation Status Group:

 Figure 3 Operation Status Group

There are multiple ways to program using the registers.  The main way that I query the resisters is using the Condition Register.  The Condition Register will give you the real time status of the register.  Reading this register does not clear it.   A good example of using this is when you are initiating a triggered measurement:

INIT:ACQ (@1)                                    //This initiates the Acquire trigger system
STAT:OPER:COND? (@1)       //Check the status register
               status = read
Loop Until (status And 8) = 8


Looking at Fig 3, 8 is the WTG_MEAS bit.  Once this is true, the unit is ready to be triggered.  This lets you make sure that you are not triggering the unit before the initiation is done.  Note that all of the statuses are referred to by the instrument by their by the bit weight (listed in the tables as the decimal value).  When you are looking for multiple statues, you need to add the bit weights.

The other main method of Querying the registers is using the Event register.  The Event Register is different than the Condition Register in that it keeps track of transitions in the statuses.  It does not matter when the status change happened, the Event Register will catch it and keep it until it is read back.   You do need to tell the power supply which statuses you are concerned with using the Negative Transition (STAT:OPER:NTR) and the Positive Transition (STAT:OPER:PTR) commands.  The Event Register is a latching register that will clear after it is read.  An example of using this register is when you want to make sure that there were no momentary transitions into an unwanted status.  In the following example, you want to make sure that your power supply does not go into the Unregulated mode (UNR) before you make a current measurement:

STAT:QUES:PTR 1024,(@1)            // This is the UNR bit
STAT:QUES:NTR 0, (@1)                // We are only interested in a positive transition
Body of  your program
STAT:QUES:EVEN?                        //Query the register
Status = readback
If status And 1024 =1024 then
 exit                                     //If the unit went UNR, exit
                MEAS:CURR? (@1)      //measure current
End if

In this case, UNR is bit weight 1024.  When the unit transitions to the unregulated state (the bit transitions from 0 to 1), this bit gets set. 

As you can tell by Figure 1, there is a bunch more that you can do using status, including Service Requests but I will save those for a possible future blog post.

Please feel free to post any questions or comments here.

No comments:

Post a Comment