Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop buffered AO

I'm creating a VI to test a part's response to an input voltage ramp. I'm using buffered AO to get the desired speed on a PCI-6221 card. The AO ramps from 2 to 7 volts in 10 mv steps at 10 usec per step ( a 500 point input to the buffer). AI 0 is monitoring the part's response. AI 1 is measuring the applied input voltage (AO 0). When AI 0 reaches a specified limit (4.2 v) I need to stop everything and reset AO 0 to zero. I've tried a number of different ways to stop AO 0 (clear task, stop task, reset device) but nothing seems to work. AO 0 ramps all the way to 7 volts no matter what.
 
I've attached my vi. I'd appreciate any ideas.
 
Thanks,
ML
0 Kudos
Message 1 of 7
(3,605 Views)
Clearing or stopping your AO task won't automatically reset the DAC output to zero volts, and resetting your device has the disadvantage of aborting all of your other running tasks.

One way you could quickly cause the AO output to reset to zero volts is by using the DAQmx Channel property "Analog Output : General Properties : DAC : Reference Voltage : Connect DAC Reference to Ground Property".  In order to use this property you will first need to set the channel property "Analog Output:General Properties : DAC : Reference Voltage : Allow Connecting DAC Reference to Ground at Runtime Property" to true before starting your task.  This will only work as long as the device is using the internal DAC reference voltage, which is the default setting.


Message Edited by jasonv on 02-12-2008 02:02 PM
0 Kudos
Message 2 of 7
(3,601 Views)

Thanks for responding jasonv. I gave your suggestion a try but the AO still doesn't stop until it hits the end of the buffered data. With only 500 points in the buffer and an output every 10 usec I wonder if its even possible to stop it at all.

 

ML

0 Kudos
Message 3 of 7
(3,580 Views)
Could you attach your updated VI so that I could try it myself and see if there is anything that can be done to improve it?

Regards,
Jason
0 Kudos
Message 4 of 7
(3,578 Views)
Here is the latest version of my vi. One other thing I've noticed is that when I rerun the executable I get a DAQmx Read error. The error number is 200278 and says "attempted to read a sample beyond the final sample". I hadn't seen this before. But I just recently added the analog reads to my vi.
 
Thanks for the help,
ML
0 Kudos
Message 5 of 7
(3,572 Views)
The DAQmx Read error might be preventing the ConnToGnd attribute from disabling the AO channel.

The read error (-
200278) was returned because the DAQmx Timing (Sample Clock).vi used the default sample mode of finite and the default number of samples of 1000.  In this configuration, once 1000 samples have been read no more can be read without restarting the task.

Removing the DAQmx Timing VI to allow the DAQmx reads to default to using On Demand timing should prevent that error from occurring in your application.

0 Kudos
Message 6 of 7
(3,563 Views)
I don't believe the DAQmx read error is causing the ConnToGnd to fail. The executable works the first time it runs. It just doesn't stop the analog output. If I click on the run arrow to run the executable a second time. And then click the start button, I then get the DAQmx error. It would appear that something is not being cleared or released when the vi finishes.
0 Kudos
Message 7 of 7
(3,555 Views)