LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sudden stop possible when a continuos loop running ?

If you don't include the data type then the "Set Control Value" method will generate an error. In my example I wasn't carrying the error cluster all the way out to an indicator so you wouldn't see this error. So, what was probably happening in your case is that you were getting an error in that node and the subVI wasn't running since the call to run the VI would have been automatically bypassed.

I don't really understand what you mean by "doing a live update, but in general you should not be precluded from doing something else within your subVIs or another parallel VI.
0 Kudos
Message 11 of 15
(571 Views)
Yeah, I've now fixed it. Everything works great.

Is it more efficient to use these control values, and invoke nodes to run a subvi ? In my problem I use events, and once I say run subVI, it goes to timeout on my event. I've noticed that the memory load is a lot lesser.

I've learnt a lot from this particular discussion. Thanks very much.

Kudos are the best way to say thanks 🙂
0 Kudos
Message 12 of 15
(557 Views)
Well, there really is no other method for launching a subVI dynamically and have it run autonomously while your main VI continues to run and respond to events. Thus, the question of efficiency is pretty much moot in this case. It's not that much different from spawning a thread to execute a function in C-based program so that you can continue to the next step while that function chugs away.

You didn't provide a full picture of how your code is structured or what you do in your main VI, but it sounds like you've got a main VI with an event structure you use to respond to events. Presumably you have a button that when clicked launches one of these VIs and then you return to your event loop, as long as the "wait until done" is false. If you have a constant wired to the event structure's "Timeout" input then you will then execute the "Timeout" case if no other events are pending since that's how you've configured the event structure. Otherwise, it will just site there waiting for another event.
0 Kudos
Message 13 of 15
(551 Views)
Do i need to do something extra while building a stand-alone application ?

When I am referencing a subVI, I get an error. I tried to include the subVI as a dynamic VI but I am still getting some error. Am I missing something ?

Kudos are the best way to say thanks 🙂
0 Kudos
Message 14 of 15
(538 Views)
You didn't say what the error was - what is the code?

Typically the problem has to do with paths since when you build an application and use the "Current VI's Path" function and extra "directory" gets added that is the application name and sometimes people using this to create new paths get wrong paths. So, if you had your VI at "C:\Work\Main.vi" and then did a query inside of Main.vi as to its path when running as an application you'd get "C:\Work\Application.exe\Main.vi". However, if the dynamic subVIs are included in the build then this shouldn't be an issue since their "paths" would be affected in the same way. That is, if you're using the "Current VI's Path" function to create the path for the VI that you want to load. If you're using hard-coded paths for whatever reason then you'd have a problem. In this case you would need to check if you're running as an application and modify your path accordingly. You can use the following bit of code to check what environment you're running under:


Message Edited by smercurio_fc on 03-15-200611:14 AM

0 Kudos
Message 15 of 15
(527 Views)