03-01-2017 01:09 PM
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?
Solved! Go to Solution.
03-01-2017 01:14 PM
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
03-01-2017 01:15 PM
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).
03-01-2017 01:20 PM
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?
03-01-2017 01:22 PM
Please share a screen shot of the tunnel. may have been just trial and error.
Ben
03-01-2017 01:22 PM
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.
03-01-2017 01:26 PM
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.
03-01-2017 01:34 PM
>> 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.
03-01-2017 01:46 PM
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
03-01-2017 01:53 PM
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