LabVIEW Channel Wires

cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Channel Wires Cannot Enter and Leave a Structure

For best performance, make the VI reentrant, inline, and add the case structure.

OK, I know how to make it reentrant, and how to check "inline", but what do you mean, "Add the Case structure"?  Do you mean the code DSB posted?  [I've been trying to wrap my mind around that code ...].  It is not (yet) clear to me how this works and how it avoids (if reentrant) the R-M-W clash (I'll work it out -- the exercise will be "good for me") ...

Bob Schor

P.S. -- thanks for the comments/updates.

0 Kudos
Message 11 of 13
(2,008 Views)

> "Add the Case structure"?  Do you mean the code DSB posted?

Yes.

0 Kudos
Message 12 of 13
(2,008 Views)

The reason that DSB's code avoids the race condition is that it only ever writes the tag to set the value to True. That means that no one ever tries to write a False, so once the value is set to true, it stays true always and forever thereafter. It avoids the r-m-w race because the only modification is always in the same direction, so no loop ever stomps on another loop's written value. So the important part is putting the Write inside the case structure.

Putting the Read of the channel into the other frame of the case structure is just a performance gain when you write True -- if you're already stopping, there's no need to read to find out if someone else said to stop. 🙂

0 Kudos
Message 13 of 13
(2,008 Views)