LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing ramp functions

Hello All,

I'm attempitng to implement some ramping functions for writing to a PCI 6711 analog output board.  There will be many times throughout the experiment where ramping is not necessary, they can just be a static voltage change.  I've attached an excel spreadsheet that tries to breakdown how the array should look within the program, and also what the user would enter in to get this outcome.  I have also attached some code where I tried to implement a ramping function but I can't quite get it to work.  I believe there may be an issuer with using the PFI as a sample clock, perhaps writing a high to a PFI line could trigger one of the analog counters which could produce enough rising edges to output the data correctly.  If anyone can see where my code is going wrong in building the array, that would be very helpful.

Regards,

Steve

0 Kudos
Message 1 of 15
(4,117 Views)

no files are attached

0 Kudos
Message 2 of 15
(4,112 Views)

Sorry, it gave some strange error about too many posts

Hopefully it goes through this time

Download All
0 Kudos
Message 3 of 15
(4,110 Views)

I had to do a very simple single voltage ramp the other day. This was my solution... maybe it will help.

 

Edit: The 1000 you see wired all over the place is the sample clock rate. I basically did everything in ms for simplification.  That middle for loop is the one that actually does the ramp.  The other two are just wait times at top and bottom of the cycle.

0 Kudos
Message 4 of 15
(4,080 Views)

I'm on labview 2011, could you screen shot it quick?

 

0 Kudos
Message 5 of 15
(4,075 Views)

SimpleRamp.png

 

 

Edit:  My math may also make more sense if I told you that the first division (Target Press / 1000) was conversion from pressure (0..10,000 scale) in to voltage (0..10 scale).  The way the math worked was:

 

1: Find voltage range you are ramping over (V_final - V_initial)

2: Find how long it will take to do that given ramp rate (V_f - V_i) / (rate)

3: Multiply by 1000 to get it in to ms

4: For each ms, voltage = i*dV + V_i

 

Where dV = voltage range / number of points.

0 Kudos
Message 6 of 15
(4,070 Views)

@BowenM wrote:

SimpleRamp.png

 

 

Edit:  My math may also make more sense if I told you that the first division (Target Press / 1000) was conversion from pressure (0..10,000 scale) in to voltage (0..10 scale).  The way the math worked was:

 

1: Find voltage range you are ramping over (V_final - V_initial)

2: Find how long it will take to do that given ramp rate (V_f - V_i) / (rate)

3: Multiply by 1000 to get it in to ms

4: For each ms, voltage = i*dV + V_i

 

Where dV = voltage range / number of points.


Why didn't you just use the Ramp Waveform VI?  It would be so much easier.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 15
(4,027 Views)

@crossrulz wrote:

Why didn't you just use the Ramp Waveform VI?  It would be so much easier.


 

Well, since you asked... I have a tendancy to do simple math like this myself in most cases. I trust it more, I know exactly how it is going to act in situations, and I find that it easier and takes less time for me to just program it than it does for me to load up the help, figure out exactly how the VI works, and then dump it in.

 

 

 

0 Kudos
Message 8 of 15
(3,977 Views)

@BowenM wrote:

@crossrulz wrote:

Why didn't you just use the Ramp Waveform VI?  It would be so much easier.


 

Well, since you asked... I have a tendancy to do simple math like this myself in most cases. I trust it more, I know exactly how it is going to act in situations, and I find that it easier and takes less time for me to just program it than it does for me to load up the help, figure out exactly how the VI works, and then dump it in.

 

 

 


I guess in real life you would make all that into a subVI?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 15
(3,969 Views)

If this hadn't been a one time use quick program, yes.  It would be a sub-vi and all of the "1000" constants would be variable instead.

0 Kudos
Message 10 of 15
(3,964 Views)