Thursday, April 30, 2015

Let's See the Watchdog TImer in Action

Hi everybody!

It is the end of the month and time for my monthly blog post.

Quite some time ago, my buddy Gary mentioned our watchdog timer protection in a post.  Here is what he had to say:

The watchdog timer is a unique feature on some Agilent power supplies, such as the N6700 series. This feature looks for any interface bus activity (LAN, GPIB, or USB) and if no bus activity is detected by the power supply for a time that you set, the power supply output shuts down. This feature was inspired by one of our customers testing new chip designs. The engineer was running long-term reliability testing including heating and cooling of the chips. These tests would run for weeks or even months. A computer program was used to control the N6700 power supplies that were responsible for heating and cooling the chips. If the program hung up, it was possible to burn up the chips. So the engineer expressed an interest in having the power supply shut down its own outputs if no commands were received by the power supply for a length of time indicating that the program has stopped working properly. The watchdog timer allows you to set delay times from 1 to 3600 seconds. 

(For the whole post click here)

Since Gary wrote that post, we have released the N6900 and N7900 APS units that also include this useful feature.  What I wanted to do was show how to set it up, how to use it,and how to clear it so that everything is a bit more clear.   All of my programming examples in this post will be done using my APS with the VISA-COM IO Library in Visual Basic.

The setup is pretty easy:

        APS.WriteString("OUTP:PROT:WDOG:DEL 5")
        APS.WriteString("OUTP:PROT:WDOG ON")

This sets the watchdog delay to 5 seconds and enables it.  This means that if there is no IO activity (ie your computer hangs up) for 5 seconds, then the unit will go into protect and shut the output down.

Lets say that I have a program that performs a measurement around every second for a minute.  Here is the program:

        APS.WriteString("OUTP:PROT:WDOG:DEL 2")
        APS.WriteString("OUTP:PROT:WDOG ON")

        For i = 0 To 59
            strResponse = APS.ReadString


        strResponse = APS.ReadString

 The watchdog delay is set for 2 second so while I run in the loop taking my measurements everything is working great.  After the 3 second wait at the end though, the 2 second watchdog timer comes into effect and the unit goes into the protect state and disables the output.  The response to the questionsable status query is 2048 which corresponds to bit 11 of the register which is defined as "Output is disabled by a watchdog timer protection".  This is the expected result.

My reccomendation to clear the watchdog timer would be to first disable the watchdog timer and then clear the protect.  You can then re-start the watchdog timer when you are ready.

        APS.WriteString("OUTP:PROT:WDOG OFF")

The watchdog timer is a pretty cool feature that can perform a pretty useful task.  I hope that this blog post explains what it is and how to use it a bit more.

No comments:

Post a Comment