Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't figure out how to read last voltage set to a physical channel using LV.

I am using LabVIEW 8.5.1 on Windows XP.  I recently got a PCI-6703 for use as a voltage reference and supply.  I can't figure out how to check the last voltage written to the device, which I assume is needed if I want to ramp up voltage over time.

 

Basically, I want to do the following:

 

1: Write a voltage to be set.

2: Start voltage.

3: Read voltage last written and increment accordingly.

4: Stop after reaching desired voltage, leaving voltage on until manually ramped down.

 

Right now, I'm looking to figure out how to read before I code the ramping into the VI.  Any help would be appreciated.

0 Kudos
Message 1 of 8
(3,822 Views)
I don't understand. The last voltage written is the voltage you pass to the DAQmx Write. It's 10 volts in your example. Doing a ramp is simple and does not at all require you to read back what you have just written. You just take a starting value and add the increment when the time interval is elapsed. A while loop with a shift register makes this pretty tirvial.
0 Kudos
Message 2 of 8
(3,808 Views)
I can make a program that ramps up the voltage based on some set increment easily. I need to have the program read the last voltage written in the event that an end-user aborts the program during ramp up, and starts to ramp up again.  The equipment using the referenced voltage is extremely sensitive to voltage changes, so a simple no-safety ramp program is too large a gamble.  Therefore, I need to include a safety check where the program reads the last voltage written, and only increments if Vcurrent<Vset point.  I figured the simplest way to do this was a read command, and that's what I asked for help on, not how to make a timed ramping loop using shift registers.
0 Kudos
Message 3 of 8
(3,797 Views)
Here is the current ramp up program.  It just assumes the last voltage is 0V, which is where the problem lies.  I need to have it know if the last voltage is 0, and if it's not, what the last voltage is.
0 Kudos
Message 4 of 8
(3,796 Views)
To clarify the problem, assume the ramp up program was aborted when last written voltage was 0.7V.  If we start the program again, it assumes the last voltage was 0V, so the voltage goes from 0.7V to 0V immediately when it is overwritten the first time.  This causes too sharp a voltage gradient for our equipment to handle, as the reference voltage translates into 1000 fold the output voltage in our equipment.  If the last voltage written was XV, we need to know what that is, so we can ramp up or down safely, with a low gradient.  Hope this clears up why I need a read command, or its equivalent.  
0 Kudos
Message 5 of 8
(3,794 Views)

Hello Isaac,

 

Thanks for using NI support.  So why would the user be aborting the VI?  Is this some sort of LabVIEW crash?  The reason I ask is because aborting VI's is a very bad practice and should not be used unless extremely necessary.  I was thinking you could use a functional global variable to store your data, but this would not work if LabVIEW closes because its memory would be lost.  I was also thinking that you could write your data to an ini file and read the value once your program started back up, but this isn't a very efficient method.  Could you please give me a little more information about how the program is being stopped and restarted.

Message 6 of 8
(3,774 Views)
The write to a data file option would work. I guess the reason the process would need to stop is if a user incorrectly input a parameter, and the operation needed to be stopped.  LabVIEW itself wouldn't be closed out, but the VI would be stopped using a stop command.  I'm currently using an SCB-68 to supply voltage, so if the VI controlling the voltage is stopped, the voltage remains on, and would need ramped down or ramped up the rest of the way.  I guess my concern is how to read the last voltage set (which would still be active on the SCB-68), so we can determine if we need to ramp up or down the voltage. 
0 Kudos
Message 7 of 8
(3,764 Views)

I don't think you can do an analog read on your analog output. For one thing, in case you haven't noticed, your card only has analog outputs.Smiley Wink

 

What about buying a DAQ card with analog inputs?

 

edit - and why would the VI be necessarily stopped? If an error condition occurs, that does not mean you have to stop the VI.

Message Edited by Dennis Knutson on 07-01-2009 09:56 PM
0 Kudos
Message 8 of 8
(3,754 Views)