Tuesday, December 31, 2013

Using Agilent Command Expert to Help Write Programs

Happy New Year everyone!  

I am writing this on New Years Eve 2013 and I want to wish everyone a happy and safe 2014.  Ed, Gary, and I had a goal of getting 4 blog posts out a month this year and with this being the fourth blog post this month, we have met that goal!  Thank you to everyone for taking the time to read our blog.

Today, I am going to provide a short intro to  Agilent Command Expert (hereto referred to as ACE). ACE is a free tool that Agilent offers that helps you program your instruments. You can write simple scripts in ACE that you can save and share with other programmers.  The coolest feature of ACE is that it allows you to export the sequence to different programming languages.   You can find the latest version of Command Expert at: 

Using ACE is pretty easy.  The first thing that you need to do is set up your instrument.  My instrument is an Agilent N6700B.  Here is what the setup/edit screen looks like:  

Once you choose the instrument, ACE will download the command set so you do not need to have the programming guide handy.  This is a great feature since you can easily see all of the commands as well as all of the inputs and outputs of the commands. 

Here is the set voltage screen:

You can see here that it shows you all of the programmable items in the command (in this case the voltage and the channel list).  Once you set everything up as you'd want, click add step and it adds it to the sequence.

You can also do queries with ACE.  Here is how you would do a MEAS:VOLT? query:

Again, it shows you all of the programmable items (in this case only the channel list).  It also shows you that there is returned data.  Click add step to get it added to the sequence.

I am going to continue using the same SCPI command as I used in my example last week, here is completed sequence from the example from last month:

Now for the fun part!  You can export the sequence to just straight SCPI:

To C#:

To C++:


To Matlab:

It gives you the option to copy the text to the clipboard so that you can paste it into the text editor for your programming language.  

There is also a tool included that allows you to create sequences in Labview.  There is a really good tutorial included with the software that shows you how to do this.

There is a ton more info on the ACE webpage link at the beginning of this blog post.

I hope that this short intro to Agilent Command Expert was useful to everyone.  Please feel free to leave a comment.  Happy New Year everyone!

Sunday, December 29, 2013

Shower by cell phone and the attitude of gratitude

As I type this, I’m sitting on an airplane, clean, comfortable (as much as that’s possible sitting in economy), clean shaven, well fed, flying home to New Jersey from Frankfurt. Things could have been different…
I started my travels today from a hotel in Sindelfingen, Germany, drove to the Stuttgart airport, and took a short flight to Frankfurt where I connected with this much longer flight home (8.5 hours). I was visiting some of Agilent’s distribution partners in Germany and France over the last ten days to present training on our newest power supply products.

Last night, before I went to sleep, I called the front desk of the hotel to ask for a 6 am wake-up call. I wanted to have time to shower, shave, dress, eat breakfast, check out, gas-up the car, drive to the airport, return the car, exchange my leftover Euros for US dollars, and finally make my morning flight. I also set my new cell phone alarm for the same time (6 am). I recently purchased my first smart phone, so I’m happy to be using its features!

6 am rolls around, my cell phone alarm goes off (yes, I managed to set it correctly), and I wake up momentarily not knowing exactly where I am or what is happening (typical for trips where you change hotels a lot). 5 seconds after the alarm starts its intermittent beeping, I come to my senses in my nearly pitch-black, normally very quiet room. The only light is a dim glow from a tiny LED on the room thermostat and the only sound is a low hum from the heating system fan in between the alarm beeps. 10 seconds after the alarm started beeping, the room suddenly become absolutely pitch-black. No light at all! I wonder if I’m dreaming and I feel like I have completely lost my eyesight! But then I noticed that the heating system fan went from humming to silent, and the thermostat LED is no longer glowing. Totally dark and totally quiet (between phone beeps) with no thermostat LED and no fan? OK, perhaps I’m not dreaming and most likely, this is a power failure! In the absolute darkness, I fumble for my beeping cell phone and manage to push a button on it partially illuminating the screen. I turn off the alarm, and now can see just enough to try the lamp switch next to the bed. Click, click on the lamp….no light. Yeah, definitely a power failure. I know that the cell phone, an Apple 5S, has a flashlight feature that is a nice, bright white LED. Turning that on, I’m now able to easily maneuver around the room. I pick up the room phone, but it is dead. I look outside, and it is dark everywhere. Yep, it’s not just my room, nor is it just the hotel. The power is out everywhere. Guess I won’t be getting my 6 am wake-up call!

Next, it is time to shower. I strategically place the cell phone on the bathroom counter angled just right so the light bounces off the ceiling and I can see reasonably well in the shower. Shaving is a bit more difficult with the limited and oddly angled light, but I manage. Then the lights come back on. Whoo-hoo!  About 10 minutes later, the hotel phone rings and the manager is very apologetic about the wake-up call being 40 minutes late. I tell him “no problem” and explain my phone alarm still woke me on time.
So had my cell phone alarm not awakened me, I may have slept too long resulting in a missed flight. And if I did not have the flashlight feature on the phone, I would not have been able to shower and shave making me more comfortable during a full day of travel. Earlier in my trip, the cell phone GPS also saved my colleague and me by guiding us to our hotel, to the office, and enabling us to find our way back to the hotel after walking around town for lunch.

Cell phones play a very large role in our lives today. While we humans survived the vast majority of our existence without them, smart phones and all electronic technology have vastly changed our lives. While I regularly wonder how my life would have been different had I lived in a time without electricity, today, my smart phone changed my experiences. I could have missed my flight had my cell phone alarm not gone off. I could have been less comfortable during my long travel day had I not been able to shower by cell phone light. Despite a power failure preventing a wake-up call and no light in my hotel room for the early morning, my day was not really disrupted thanks to my cell phone. While these things are minor in the grand scheme of things, I am still grateful for the technology we have that allows us to do the things we do. And I’m glad to be a part of that technology by working with power products. Many cell phone manufacturers use Agilent power products during their design, verification, and manufacturing processes and I am happy to be a part of that chain.

May all of your travels during this holiday season be uneventful…and Happy New Year!

Thursday, December 26, 2013

What is Power and Energy? Part 2

In part 1 (click here to review) of this two-part series on power and energy, I delved into the specifics of what energy is about. But what then exactly is power?

We learned in part 1 how energy can be increased or extracted from a system by work applied to or derived from that system. Work performed changed the energy level in that system. But how long a period was that work performed over? Perhaps it was performed over a minute, a day or a year? Power is a measure of the rate of which work is performed and energy added or removed from a system.

Average power = work performed / interval of time

When we hear the word power the thing that might come to the mind most often is the horsepower one’s car has (OK, let me preface that with the mind of most auto enthusiasts!).  While most commonly used to refer to mechanical systems, horsepower is still power, just the same as the electrical power we get from the wall outlets in our homes, which is also power.

Back in the early days of heat engines James Watt developed the term horsepower as means to compare his steam engines to the rate of work a horse could produce.  Mechanical work is the measure of a force (pounds) moved through a distance (feet). A horse was judged to be able to move 550 foot-pounds in one second, or produce 550 foot-pounds per second of power

Electrical power is also a measure of work performed per unit of time. In this case however it is moving an electrical charge of one coulomb against a potential of one volt in one second. Note also that one ampere equals one coulomb per second. One unit of electrical power equals one watt (in honor of James Watt!).  To summarize:
P (watts) = Q (coulombs) * V (volts) / t (seconds) = I (amps) * V (volts)

Recall in part 1how energy was measured in watt-seconds and kilowatt-hours. Divide by time interval it is used over and it becomes power in watts and kilowatts! So how are mechanical and electrical power related? Well when electrical motors came onto the scene it was necessary to relate the work they could do to that of heat engines which were rated in horsepower, where one horsepower is equal to 550 foot-pounds/ second. It was determined that a 100% efficient motor required 746 watts of electrical power to produce one horsepower of mechanical power. Note that this horsepower rating is based on English mechanical terms. The measure of horsepower based on metric terms ends up being slightly different; about 735 watts instead.

So you can just as easily state the power consumption of your electrical appliances in terms of horsepower as you can watts. Conversely, you can also state the power-generating rating of your automobile’s engine in watts (or kilowatts) instead of horsepower, and this is actually more often practiced nowadays, as the measure of a watt is recognized world-wide, while horsepower is not.

Happy Holidays everyone!

Thursday, December 19, 2013

What is Power and Energy? Part 1

We have recently updated our name to the Power and Energy Division (PED). What does this mean? Aside from needing to get new business cards it is not a huge change as my colleagues and I will continue to be focused on applications relating to power and energy in support of our portfolio of system power products. It is more of having a renewed and greater strategic focus on applications relating to power and energy, which I wholeheartedly welcome. Energy is becoming an increasingly valuable commodity as the world keeps finding ways to consume it at a faster rate than ways to produce it. Even if we were able to produce energy in unlimited abundance its production and consumption leaves an indelible mark on the world. A key part of addressing this demand is making smarter and more efficient use of the energy we produce. It’s great to see how technologies are evolving in a number of industries to do this and that we are taking part in it to help!

This leads me to what I intend to write about today: What is power and energy?
While power and energy are pretty fundamental concepts and many do understand what they are, I sometimes encounter folks mistakenly using one in place of the other. They are indeed closely related but still distinctly different things.

Let me start with energy.  It is probably best to look at it in the classical mechanical sense for a particle in motion. Its kinetic energy is described by the equation:

Ek = ½ mv2

Where Ek is the energy of a particle, m is its mass, and v is its velocity. As long as this particle in motion is not acted on, its energy remains unchanged. But what if it is acted on by an external force? That leads us to what is defined as work. Mechanical work is a force acting over a displacement or distance. If this force is in the same direction as the displacement the work is defined as positive. Energy is added to the particle. If the force is opposite to the displacement then the work is negative. The energy of the particle is reduced. Work is expressed as:

W = Ek2 – Ek1

Where Ek1 is the energy of the particle before it is acted on and Ek2 Is the energy of the particle after it has been acted on by a force. Work is a measureable change in energy of that particle.

This leads to potential energy. In the mechanical world potential energy can be described as what I will call a recoverable force applied against a displacement. Most typically it would be a mass or weight lifted a height against gravity. It can also be a force used to pull a spring over a distance. For gravity the potential energy is by:

Ep = mgy

Where Ep is the potential energy of the particle, m is its mass, g is gravity, and y is the height of the particle above a set reference point. Note that weight is the product of mass and gravity. Work added or detracted correspondingly is lifting or lowering this particle over vertical distance, against gravity.

With electrical things work and energy is one and the same as with mechanical things. It is stated that energy cannot be created or destroyed, only converted from one form to another. Light energy can be converted to electrical energy with a solar cell. Electrical energy can be converted to mechanical energy with an electrical motor, and so on. These processes are not 100% efficient and a good portion of the original energy also gets converted to heat energy.  A common measure of energy is joules, which is 1 watt-second. You probably are most familiar with this when you pay your electrical utility bill, which is based on the amount of kilowatt-hours of electrical energy you consumed since your previous billing.

Like mechanical systems, energy can be stored in electrical systems, in particular in the reactive components; the inductors and capacitors. Energy in an inductor is given by:

E = ½ LI2

Where E is the energy in joules, L is the inductance in Henrys, and I is the current in amps. An inductor stores its energy in its magnetic field. Similarly energy in a capacitor is given by:

E = ½ CV2

Where E Is the energy in joules, C is the capacitance in Farads, and V is the electric potential in volts. A capacitor stores its energy in its electric field.

Hopefully this gives you a little more appreciation about what energy (and work) is.  Look for my upcoming second part when I tie it all together with power!