06-13-2024 03:59 PM
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.
Solved! Go to Solution.
06-13-2024 06:52 PM
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.
06-14-2024 03:34 PM
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?
06-14-2024 03:54 PM
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.
06-17-2024 08:47 AM
Thank you for your reply!
I attached a picture of my code. Can you check my code?
06-17-2024 09:28 AM
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
06-17-2024 09:40 AM
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.
06-17-2024 09:41 AM
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.
06-17-2024 09:47 AM
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.
06-17-2024 09:49 AM
you could add your code to write 0 on the AO outside the loop after the stop is pressed.