LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make zero voltage AO output when a Laview is stopped

Solved!
Go to solution

By using DAQ Assistant, I made AO output Labivew. But, when I stopped this Labivew, AO held the last value.

So, I want to make zero voltage output from AO channel when I stop a Labivew.

 

I want to know if this can be done when using DAQ Assistant.

0 Kudos
Message 1 of 11
(565 Views)

Write a 0 value on the last iteration. How Can I Reset to Zero My Analog Output Value After I Stopped My Application?

Assuming you are using a while loop with a Stop button, you can use a Select node to force a 0 value to DAQ Assistant when the Button is pressed. 

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 11
(540 Views)

Thank you for your reply!

 

According to your suggestion, I added a Select node to set zero voltage AO output when the stop button is pressed.

 

But, it does not work. The commanding AO output voltage became zero when I pressed the stop button. But, the program was stopped before the AO output voltage went through the AO output DAQ Assistant. So the AO channel still had the last AO output value.

 

Maybe, if there is a delay between the stop button being pressed and the program being ended, it may work. 

 

Can you suggest any idea or other way?

0 Kudos
Message 3 of 11
(498 Views)

A VI will not terminate before the code running inside is complete, unless you are using the abort button or STOP function (or a crash).  Please show us your code.

0 Kudos
Message 4 of 11
(489 Views)

Capture.PNG

 Thank you for your reply!

 

I attached a picture of my code. Can you check my code?

0 Kudos
Message 5 of 11
(443 Views)

Well, a picture of the code is not the code, so it's basically impossible for anyone to see what those DAQ Assistants are doing. How are you verifying that your output isn't going to 0V? If you are using your "Measured Signals" value to verify that output has been set to 0V, you don't have anything to control when that read happens relative to the write (i.e. a race condition).  At the very least, if that's the case, you should feed the error out lines from the DAQ writes to the error in on the DAQ read

0 Kudos
Message 6 of 11
(433 Views)

To avoid Race conditions and other nasties it's best to set the output to 0 after you exit the loop. Remember to wire Error through so it actually executes after the loop finishes.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 11
(424 Views)

I can see the zero output from the input voltage graph in my Labview when I run my code. But, when I measure the output voltage from the AO channel using a multimeter, it does not become zero. It still has the last output value.

 

I attached my Labview code. I would appreciate it if you could see my code.

 

 

0 Kudos
Message 8 of 11
(423 Views)

My current issue may come from using DAQ Assistant module.

 

I don't know how to re-run DAQ Assistant module with the same device and the same AO channel outside the loop because another DAQ Assiant module already exists inside the loop.

0 Kudos
Message 9 of 11
(418 Views)
Solution
Accepted by naba

you could add your code to write 0 on the AO outside the loop after the stop is pressed. 

 

LVNinja_0-1718635755459.png

 

0 Kudos
Message 10 of 11
(415 Views)