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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unused tunnels to While Loop

Solved!
Go to solution

I'm cleaning up an old LabView application with most of the usual mistakes.  One I thought was a mistake proved to be a new construct at least to me.  The application uses three continuously running while loops.  The original application had wires running to an unused tunnel on each loop with a note "Do not remove these wires".  I removed the wires, thinking they were one of the things to clean up, and discovered that one loop hogged all the computer cycles.  Wires restored and back to functioning.  Can someone explain the function of the wires and where I should have learned about them?  I have built several similar applications over the years without having the problem.  Have I just been lucky and do I need to go back and update my applications?

0 Kudos
Message 1 of 12
(3,472 Views)

Share an image or code to let us help you.

 

Speculating....

 

Where the tunnels auto indexing?

 

Could be the tunnels were creating an output array and the allocating of memory would stall the loops and let other loops run.

 

If this line of speculation is valid...

 

A "zero" wired to a wait function will help LV do cooperative multitasking and multiple loops play nice together.

 

Done with the wild and blind speculating.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 12
(3,464 Views)

I guess original schematic is quite large, I do not want to dig into it...

I guess they were enforcing order of execution - loop starts after results in that wire appeared. And that ensured some necessary data for that loop were ok (through global or something).

0 Kudos
Message 3 of 12
(3,462 Views)

Thanks for the response.  Yes, the application is large and neither you or I want to dig into it.  Yes, clearly it is enforcing some starting sequence on the loops.  I would like to know how the original programmer knew to do that?

0 Kudos
Message 4 of 12
(3,453 Views)

Please share a screen shot of the tunnel. may have been just trial and error.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 12
(3,450 Views)

They were likely there for sequencing purposes.  In other words, things had to be initialized before those loops could run.  So the loops would run once all of their inputs were available, including the unused tunnels.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 12
(3,448 Views)

I'd like to see that example!  And the source version.

 

Just guessing, the developer added the wires to force something else to happen before the loops started.  Basic Dataflow concept, the while loops cannot start until all inputs are available and you should know that from any getting started tutorial or LabVIEW core I or from any other LabVIEW developer you met.  Dataflow paradigm programming concepts do come up a few times on the forums but, usually from very new users.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 12
(3,438 Views)

>> I would like to know how the original programmer knew to do that?

He wanted something to happen in order. Sometimes this approach can be used, but needs documentation better than "do not remove, or it will stop working".

Most often good design pattern would make it more clear and reliable.

0 Kudos
Message 8 of 12
(3,430 Views)

Here is a corner of the block diagram.  No one claims this is good code which is why I am working on it.  The "Do not remove these wires" was one of the more useful notes in the whole project.

 

Bill

0 Kudos
Message 9 of 12
(3,422 Views)
Solution
Accepted by topic author Indiana_Bill

Where was that note you mentioned?

 

The DAQ wires should force the sequence of the two shown structures but if there was another loop off to the right that needed to be delayed until after the next to last frame of the seq structure...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 12
(3,417 Views)