From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset AO to 0 after stop trigger

Solved!
Go to solution

Hi All,

 

My application is set up to synchronously and continiously process two analog input channels and generate two analog output voltages.

The application works perfectly but have some problems with a small addition I try to make.

 

What I am trying to implement now is a simple stop trigger which simultaneously resets both AO channels to 0 V.

The stop trigger should come from a simple switch connected to the PFI0 channel of my BNC-2090 / DAQcard 6024E system.

This will just serve as an extra safety measure on top of some more reliable ones already implemented.

 

Following different KnowledgeBase articles and examples I found I came up with the design as attached.

While it does stop the data acquisition and terminates running of the application it doesn't reset the AO to 0 (it stays on the last value set).

 

Any help would be much appreciated.

 

Thanks,

Mark

 

 

 

0 Kudos
Message 1 of 7
(4,224 Views)

The simplest solution would be to write 0 to the AOs before clearing the task.  The empty array of waveforms will not work.  You need to have actual data.  And since you are only applying the single 0V, you can use the single sample 1D array to write the 0s.


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 2 of 7
(4,216 Views)

I tried this, but unfortunately it still doesn't get back to 0. Moving it before clearing the AI task also doesn't work.

 

Any explanation for this? (So the lower task line is the AO - the upper the AI)

 

Thanks (see below the way I build it),

untitled.PNG

0 Kudos
Message 3 of 7
(4,209 Views)

I think I see the problem.  The AO task is set to "sample" on the AI's sample clock.  If the AI clock isn't running (via the task being cleared), then the "clearing" sample will never be outputted.  You need to write the 0V before clearing the AI task.


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 4 of 7
(4,207 Views)

Yeah that makes sense and I tried it, but again no luck.

It seems however that when I start running the application it shortly gets back to 0V before data acquisition starts.

 

Might be a problem of order of execution? (Although I always thought a DAQmx block wouldn't start before all connected lines are active, so data, error and task line).

 

Tried the flat sequence, but that doesn't work.

 

Mark

0 Kudos
Message 5 of 7
(4,201 Views)
Solution
Accepted by topic author MLVDR

Hi Mark,

 

Would it be possible to use a "stop task.vi" function then setting the new writes and then using a "start task.vi" before clearing after your loop? This way you can be clear that the original AO task has stopped executing before changing the values being generated.

 

Kind Regards,


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

Message 6 of 7
(4,171 Views)

Hi,

 

Thanks, copy of the solution below.

Appreciate the help!

 

Mark

 

Solution.png

Message 7 of 7
(4,141 Views)