LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running the VI as sub VI behaves differently if independently run

Hi

My project is something that has main menu. So, I made 2 VIs -one for the Menu and one for the Main purpose of the program. And so whenever I run the Main independently (without the use of Menu) it behaves all fine.

 

But when I run the Menu, then click the button that calls Main, firstly it runs properly, then I will click "back to Menu" so the Main closes. Second time around calling the Main with Menu (this is without aborting the whole execution), the Main behaves not exactly like it behaved when it was first called. 

I'm guessing it has something to do with variables being not reset properly. YET I event structured everything in Main to Timeout. and there's a flat sequence that processes ALL the variable defaults that initializes ALL the containers. so when the Timeout is done the variables are all initialized. 

The problem is that it runs all differently. why so?



0 Kudos
Message 1 of 4
(2,514 Views)

No idea.

 

Since you didn't attach the subVI or the main VI, I have no idea how you have one calling the other or back again.  Why didn't you attach them to your message?

 

Do you really need to have a menu call the other?  How is the menu calling the main?

0 Kudos
Message 2 of 4
(2,489 Views)

 


Since you didn't attach the subVI or the main VI

Hey. I forgot to attach the actual VI as I was in a hurry when I posted the topic I apologize. Here it is.

pls play the mn menu.vi

I really appreciate your reply and interest in this topic 🙂


 

0 Kudos
Message 3 of 4
(2,415 Views)

You have so many nested event structures I am not sure it will work as you think. To be honest, I have never seen anyone nest event structures, especially with nested ones running in parallel within an event structure. I think what you really need is an architecture that spawns individual actors (hint, actor framework) that will message the top level display with updates. You have created a ton of parallel loops but these should be actors that are spawned dynamically. I also think you should consider using sub panels. That is how you can load the various game components.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 4
(2,405 Views)