03-20-2026 01:43 PM - edited 03-20-2026 01:47 PM
Hello,
I'm a new user to labview, so apologize if the questions I'm asking sound pretty basic. I'm putting together an application that can both read incoming voltage data from an Analog Input, while also send output voltage data across two Analog Outputs. I've been able to get the system to work at a basic level. However, now I'm having trouble understanding how to implement a sort of Global stop variable into the program. When searching through the forums, I did find that someone had put together a basic "Global Stop" program, but am having a little trouble understanding how to implement it into my code.
I'm including the VIs for both a more stripped down, basic version of my application, as well as the vi for the Global Stop program I saw mentioned in the forums. Any advice on how to implement it would be greatly appreciated. For reference, I'm using the USB-6008 as my DAQ.
Solved! Go to Solution.
03-21-2026 12:09 AM
Many here don't have LabVIEW 2026 yet. Please do a "save fore previous" (e.g LabVIEW 2019) and attach again.
03-21-2026 12:01 PM
In the lower loop, you should use an event structure for ("knob1, knob2, stop", value change). No need for the stop 2 button or any FGV at all.
03-21-2026 12:08 PM
Here is a quick draft.
(I don't have any DAQ drivers installed and don't know your hardware. I thus cannot comment on the sanity of the hardware IO, but there is definitely some code smell...)
03-23-2026 04:06 PM
Hi altenbach,
First of all, I apologize for the delayed response. Was out of the office for the weekend and didn't have access to Labview at the time. I appreciate the rework you provided. However, I still have a few questions about it.
1) How does putting the "Write Analog Output" loop into an event structure help me in terms of having a single stop button control both loops?
2) I'm still getting errors whenever I press the Stop button on the VI you provided. Specifically, Error -200088: "Task specified is invalid or does not exist".
03-24-2026 12:50 AM
(cannot look at the code at the moment but ...). Make sure to wire the task id across all cases of the event structure
03-24-2026 12:08 PM - edited 03-24-2026 02:32 PM
Yes, my example was just a sketch and you were supposed to fill in the blanks, of course.
As I said, the stop event did not have the task wired across, so when the stop event fires, it resets to the default, which is invalid. (Are you familiar with "use default if unwired" output tunnels?)
You just need to wire across the stop case (top picture). If you want, you could even explicitly set the outputs to zero if that is appropriate (bottom picture).
03-24-2026 05:47 PM - edited 03-24-2026 05:49 PM
Oh I see it now. Not familiar with "use default if unwired" property, so wasn't sure why it wasn't reacting under the "Stop" condition. Had to review a few more tutorials about how Event-Structures work in order to fully grasp it, but not it makes sense. Also like how the Event structure allows you to bypass the limitations that using a local-variable would have.
Thanks!
One question about the way you set-up timeout, though? Since you set the while-loop value to be -1, is including a Timeout feature in the event structure even necessary if it never triggers?
03-24-2026 07:32 PM
The timeout event fires once when the program starts.