PDA

View Full Version : Voltage Ramp



tex
08-05-2008, 11:41 AM
I am trying to write a simple excel VBA program that ramps up to a voltage inputed into an excel cell but also has an input for it defining how long it will take to reach said voltage.

I am doing this on a Agilent 33120A which is usually used for waveform arbitration but I know can also do this.

I haven't found any sample code that relates to this task. If anyone could help me out that would be great.

mdmackillop
08-05-2008, 02:23 PM
Hi Tex,
Welcome to VBAX
I've moved your post to the Exel forum.
Sound fairly technical, so the more information/example you can provide the better.
You can post a sample workbook using Manage Attachments in the Go Advanced reply section.
Regards
MD

tex
08-06-2008, 07:28 AM
Thank you, basicaly what im trying to get here is that when you put a time say 100 seconds into the time= cell and say 5volts into the voltage=cell and press start. It will send that to my test equipment but it would make it take 100 seconds to reach 5volts slowly ramping up. (making the equipment read the sheet and respond)Setting up the equipmet connection I think I have. I have columns for other things on my sheet but I think I have those covered. There is some sample VBA embedded, but I can't figure this out as far as where to even start with code that increments the voltage over a set time.

Really you could look at the example as if there were only the voltage and time input with the start button to make it easier.

Edit: I put in a different example that may be closer to what I need. You could add in inputs for time and voltage that it would ramp to and stop at.

tex
08-06-2008, 09:30 AM
This one may actually be closer as it sends data to the exact equipment im using. Only missing of course is a set voltage and time input with the requirements mentioned above.

RonMcK
08-06-2008, 09:32 AM
Tex,

What is the smallest time increment that your device recognizes? Your example shows a 4 sec increment. The shorter the interval the more the voltage will approximate a curve and the less it will look like a step function.

Cheers,

tex
08-06-2008, 12:05 PM
Good point, I actually did not think of that. I believe it increments in 1 second intervals. I can't find anything saying it will do less than that. Also, I have been configuring it for RS-232 communication until I recieve my GPIB card.

My attachment is what I have thus far. I'm deleting the part where it says output is 5v etc etc..And would like to know how to make that variable. And I think a possible way to do a timed ramp could be with the rise time function somehow. Still working to complete this. Thanks. If anyone knows of how to do these things or has a link to some sample code that can do any of these things don't hesistate to holler.

Further, it should be known that the basis for this excel sheet was ripped from an Agilent example program that they provide. I went with it because it sends data to an instrument and has a interesting rise time feature.You can modify these if you want and some of the fearures on the sheet that don't really have anything to do with the set voltage/time ramp may be removed later.

tex
08-15-2008, 08:00 AM
I'll be working on this some more today...So if anyone knows any links to sample code related to what I need don't hesitate to post.