08-01-2014 10:18 AM
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
08-01-2014 10:23 AM
no files are attached
08-01-2014 10:24 AM
Sorry, it gave some strange error about too many posts
Hopefully it goes through this time
08-01-2014 04:02 PM - edited 08-01-2014 04:06 PM
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.
08-01-2014 04:04 PM
I'm on labview 2011, could you screen shot it quick?
08-01-2014 04:09 PM - edited 08-01-2014 04:24 PM
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.
08-02-2014 08:41 AM
@BowenM wrote:
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.
08-04-2014 10:17 AM
@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.
08-04-2014 10:37 AM
@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?
08-04-2014 11:03 AM
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.