Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read the setpoint on an AO channel?

I am working on a user interface for a PXI-6704 AO card. Since it will be used for debugging automtated tests, the user will need to be able to start and stop the interface at random. When the interface is started it needs to see what the current state of the test stand is. How do I read the existing setpoints on the analog output channels?
0 Kudos
Message 1 of 5
(3,081 Views)

Hi lars,

 

Unfortunately, the only way I know to read the AO value, is to read it back in on an analog input line. We would usually recommend reading it through an internal channel "_ao0_vs_aognd" for instance and is described in this KB. Since you have an Analog Output card, you don't have any input channels to read the value.

 

I believe there is still a relatively simple solution to this problem though. You can use an uninitialized shift register or a global variable to maintain the most recent value you wrote to the analog output channel. This would maintain your current value when you restart the VI. If the VI is closed (removed from memory), the shift register and/or global will no longer maintain the value, so if you need to be able to completely close out of the VI (not simply stopping and starting) then you can consider writing the value to a file (in the shutdown phase of your program) and reading from the file upon the next execution of the VI (during the startup phase of the program). I hope this helps!

0 Kudos
Message 2 of 5
(3,056 Views)
Thanks for the reply, Mike.  Not good news, but we'll need to figure out how to deal with it. Unfortuanately the shift register trick won't work as the values could be changed during our automated testing (the part we're debugging.) I guess I could see if I can figure out how to use the same background VI's to run the manual test and our TestStand tests. That should be an interesting project Smiley Happy
0 Kudos
Message 3 of 5
(3,053 Views)
That makes using a functional global or global variable dangerous as you might run into situations in which the manual testing VI is closed before your tests are run. One option I didn't think of originally is the Shared Variable. You could use a Network Published Shared Variable to maintain the value. You won't have to worry about it being unloaded from memory as it will stay in the SVE until you undeploy it. Good luck!
0 Kudos
Message 4 of 5
(3,050 Views)
I'll dig into that. Thanks!!
0 Kudos
Message 5 of 5
(3,048 Views)