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.
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.
07-05-2019 06:42 AM
Hello,
I am trying to do something like what's shown in the attached snippet, but the stop button doesn't work. It does when I use property nodes for the data channel, but for code readability I'd much rather use the channel.
The 50ms wait is, sadly, required, since I think that's where the problems lie (it certainly works without it). Any ideas?
Solved! Go to Solution.
07-05-2019 07:08 AM
Do not use the standard setting "infinite time-out" on the "stream" channel reader, otherwise the stream reader waits infinitely for data that never gets generated by your writer loop. Check for yourself by switching to "highlighting" mode after pressing the stop-button.
Alternative: Use a writer stream with abort, then the reader gets destroyed too:
Regards, Jens
07-05-2019 08:12 AM
The Tag setup will effectively signal all of the loops to stop running, but you still have an active Stream Channel. Fix this by wiring the output of the Tag Channel (that becomes True to stop) to the "Last Element?" input of the Stream to also stop the Stream Channel (that's why it is there!).
Bob Schor
07-05-2019 10:25 AM
And a third easy solution, haven't thought about that, so I made a quick screenshot:
Regards, Jens
07-05-2019 10:49 AM
Not only is Jens' solution "easy", it is "better" than my original (correct) Solution. Here's why (and a final example to illustrate the point):
Bob Schor