08-09-2017 11:04 AM
So I made a simple Tag Channel where I need to signify a stop between a loop, and a set of code that will take an unknown amount of time to execute. So I write to the tag when the operation is complete, which stops the loop. But I realized there is no point that I write a false to the channel, only a true when it is done. Yet the channel is set back to false when I enter this loop again.
I obviously like this, but am interested in knowing when a channel is reset or cleared back to the default data of that data type. Is it simply when that channel wire isn't being used anymore? Can I reliable use this type of design expecting the value to be reset? This seems like beginner stuff but I couldn't seem to find anything on it in my poor search terms. Thanks.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Solved! Go to Solution.
08-09-2017 12:23 PM - edited 08-09-2017 12:31 PM
Once both of your inner code is finished the Channel Wire for the Tag is also finished - the Writer and Reader are no longer needed. When the outer loop comes around again the Channel Wire is reinitialized.
In your code the Reader doesn't have an update from the Writer after creation so it till return the default value for the data type.
Good question - what's happening in the background?
See Understanding the Lifetime Of Channel Wires Section:
http://zone.ni.com/reference/en-XX/help/371361N-01/lvconcepts/channel_wires_intro/
You'd have to pay more attention if you make subVIs and they are not in the same overall loop I think.
08-09-2017 12:32 PM
Sorry - hit Post too soon on first message - edited my response.
08-09-2017 02:25 PM
> You'd have to pay more attention if you make subVIs and they are not in the same overall loop I think.
Not really. It's still on the next iteration of the diagram that contains both endpoints. So just find the common diagram of those subVIs. When that next iterates, the channels are reset.
If you think of the channel as connecting two subprocesses within an outer process, the reset is when the outer process iterates, starting the two subprocesses over (exactly as if they were a subroutine).
08-09-2017 03:09 PM - edited 08-09-2017 03:11 PM
I was more thinking if the writer and reader were in two separate running loops that did not have a surrounding loop - true parallel modules that would not end and restart, but stay running until the application is shut down. You'd have to reset the Tag yourself since the application wouldn't be starting over.
That still falls under your description - the outer process then becomes the top application.
08-09-2017 03:19 PM
@RVallieu wrote:
I was more thinking if the writer and reader were in two separate running loops that did not have a surrounding loop - true parallel modules that would not end and restart, but stay running until the application is shut down. You'd have to reset the Tag yourself since the application wouldn't be starting over.
That still falls under your description - the outer process then becomes the top application.
Bingo. It just means the outer process never iterates.
My rough translation of Terry Pratchett's description of The Great Clock: It has a second hand, a minute hand, an hour hand, a day hand, a week hand, several different month hands, an odd hand-like thing for years that handles leap year, a century hand, an eon hand. And then there's the Biggest Hand. It only goes around once.
08-09-2017 03:21 PM
I did earn my Channel Wires badge! 😄
05-24-2018 01:20 PM