LabVIEW Channel Wires

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Why and when is a Tag Cleared?

解決済み
解決策を見る

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.

 

Example_VI_BD.png

メッセージ1/8
12,870件の閲覧回数
解決策
トピック作成者Hooovahhが受理

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:

https://www.ni.com/docs/en-US/bundle/labview/page/communicating-data-between-parallel-sections-of-co...

 

You'd have to pay more attention if you make subVIs and they are not in the same overall loop I think.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
メッセージ2/8
12,860件の閲覧回数

Sorry - hit Post too soon on first message - edited my response.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 件の賞賛
メッセージ3/8
12,855件の閲覧回数

> 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).

メッセージ4/8
12,837件の閲覧回数

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.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 件の賞賛
メッセージ5/8
12,829件の閲覧回数

@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.

0 件の賞賛
メッセージ6/8
12,823件の閲覧回数

I did earn my Channel Wires badge!  😄

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
メッセージ7/8
12,821件の閲覧回数

It seems that the badge system updated and the channel badge disappeared?  Along with some of your other badges.

LabVIEW ChampionLabVIEW Channel Wires

0 件の賞賛
メッセージ8/8
10,264件の閲覧回数