Norm Kirchner Posted September 27, 2004 Report Share Posted September 27, 2004 Does anyone have a clean method of making an EXE which can have multiple instances open :question: Quote Link to comment
Michael Aivaliotis Posted September 27, 2004 Author Report Share Posted September 27, 2004 Have you read this FAQ? Can I run multiple instances of LabVIEW? Quote Link to comment
m3nth Posted September 27, 2004 Report Share Posted September 27, 2004 Have you read this FAQ?Can I run multiple instances of LabVIEW? 2013[/snapback] I believe the question was in reference to running a compiled LabVIEW app, not LabVIEW itself. And if you have to start mapping drives to have more than one copy run that doesn't strike me as very 'clean'. Personally, I have run into this problem before, however in my situation I had to ensure that only one instance could open--hence no problems. I would be interested in knowing how to spawn multiple instances of the same app also. Quote Link to comment
Michael Aivaliotis Posted September 28, 2004 Author Report Share Posted September 28, 2004 I would be interested in knowing how to spawn multiple instances of the same app also.2014[/snapback] If you can give me a use case (a possible scenario) then I can show an alternate solution. You have to consider what the purpose of this would be. Would you be talking to different hardware with each executable or common hardware? I think this would be a key factor. The easiest way to work with multiple exe's would be just to rename them... no? Have the original exe create a copy of itself and then just launch it. Sounds possible. Quote Link to comment
Norm Kirchner Posted September 28, 2004 Report Share Posted September 28, 2004 For this specific case, an application has been built for demonstration purposes, w/ no hardware. The software is modular so that multiple types of demos can be called from the same app. The problem is when you want to compare 2 of the same model or possibly different models. I understand that there are other ways of accomplishing this specific task, (1 master program calling multiple instances of a slave) but the application has been designed & built and now this functionality has been requested The expectation is for it to behave, as say notepad does, when you call it twice. As far as renaming the exe then running it, I have seen it work on my PC but when the customer attempted it, they said that they got two separate apps open, but when a button was clicked in one, both responded to it. Bizarre Quote Link to comment
JackHamilton Posted October 5, 2004 Report Share Posted October 5, 2004 I agree with Mike; Why do you want several instances of the same application running? If the single application was written correctly - it should handle the job? Are you wanting to create mulitple 'views' of the same data? If you're creating a demo CD - could you not create a menu/lanching application that will let the user browse and select demos? You could use HTML to do this too. You can run mulitple LabVIEW.exe's on a machine - that should not be a problem. Quote Link to comment
Norm Kirchner Posted October 6, 2004 Report Share Posted October 6, 2004 Thank you Mr. Hamilton for the poke in the side. But the program was written and the customer asked for this specific feature after the fact. But for those of you interested in the actual answer to the riddle :ninja: Just found it =8^ ) allowmultipleinstances=True just throw it into the exe's INI file works like a charm Quote Link to comment
m3nth Posted October 6, 2004 Report Share Posted October 6, 2004 allowmultipleinstances=Truejust throw it into the exe's INI file works like a charm 2128[/snapback] Very cool! Thanks for the info. :thumbup: Quote Link to comment
Michael Aivaliotis Posted October 6, 2004 Author Report Share Posted October 6, 2004 Very cool! Thanks for the info. :thumbup: 2130[/snapback] Yes, cool. The FAQ's been updated: http://forums.lavausergroup.org/index.php?...findpost&p=2129 Norm, you've just won the golden donkey award! Congrats. :thumbup: Quote Link to comment
Joernh Posted October 19, 2004 Report Share Posted October 19, 2004 allowmultipleinstances=Truejust throw it into the exe's INI file works like a charm 2128[/snapback] Hi there, does somebody know, if this is working with LV 6.0 too. I tried it but it didn't work. I can only run one instance of the application.exe :headbang: Could somebody help me?! Regards... Quote Link to comment
Michael Aivaliotis Posted October 19, 2004 Author Report Share Posted October 19, 2004 Hi there,does somebody know, if this is working with LV 6.0 too. I tried it but it didn't work. I can only run one instance of the application.exe :headbang: Could somebody help me?! Regards... 2382[/snapback] I've tested this feature successfully on LV61, 70, and 71. It does NOT work on LV60. Quote Link to comment
Joernh Posted October 20, 2004 Report Share Posted October 20, 2004 thank you Michael, do you know, if there's another chance with LV6.0 to get a multiple launchable application? (except making copies.... ) Quote Link to comment
JackHamilton Posted October 22, 2004 Report Share Posted October 22, 2004 Thank you Mr. Hamilton for the poke in the side.But the program was written and the customer asked for this specific feature after the fact. But for those of you interested in the actual answer to the riddle :ninja: Just found it =8^ ) allowmultipleinstances=True just throw it into the exe's INI file works like a charm 2128[/snapback] Don't take my poke the wrong way - I've learned a few things overs the years consulting. One is the magic word you can use with clients "No". Sometimes, clients and consultants think we carry some magic bag of tricks and can whip up bug-free solution to a complex problem in no-time. The reality is sometimes the solution is very simple and direct. It's like having a flat tire - the solution is to 'Get out and fix it' no amount of button pushing on the dashboard is going to solve it. I too like to keep a poker face when pitched a problem - sometimes it's better to run for the hills. I'm glad you found a solution.. Regards Mr. Hamilton (Jack) Quote Link to comment
Mike Ashe Posted December 31, 2004 Report Share Posted December 31, 2004 do you know, if there's another chance with LV6.0 to get a multiple launchable application?(except making copies.... ) 2403[/snapback] You can map multiple network drives on your machine, all pointing to your application's subdirectory. You can then create shortcuts to run "MyApp Instance 1", "MyApp Instance 2", etc, etc... Quote Link to comment
Norm Kirchner Posted April 29, 2005 Report Share Posted April 29, 2005 Norm, you've just won the golden donkey award! Congrats. :thumbup: 2131[/snapback] Do I get the award at NI week this year??!! Quote Link to comment
ASTDan Posted June 22, 2010 Report Share Posted June 22, 2010 (edited) Thank you Mr. Hamilton for the poke in the side. But the program was written and the customer asked for this specific feature after the fact. But for those of you interested in the actual answer to the riddle :ninja: Just found it =8^ ) allowmultipleinstances=True just throw it into the exe's INI file works like a charm This is a cool feature! Here is the official NI word on it How can I tell if there is an application instance already open? I have a use case where the customer wants 2 instances of the program. Instance 1 uses com1. Instance 2 uses Com 2. I have the com port info saved in an .ini file. I need the 2nd instance to use a 2nd .ini file. So I need to detect if there is an instance already running. If so use the 2nd ini file. Any suggestions? Dan Edited June 22, 2010 by ASTDan Quote Link to comment
ASTDan Posted June 22, 2010 Report Share Posted June 22, 2010 Solved by using a system call to the task manager Quote Link to comment
asbo Posted June 22, 2010 Report Share Posted June 22, 2010 You could also lock the INI file while the program is running. When the second instance runs, it checks if the first INI is locked and if it is falls back to the second INI file. Quote Link to comment
Tim_S Posted June 25, 2010 Report Share Posted June 25, 2010 You could also lock the INI file while the program is running. When the second instance runs, it checks if the first INI is locked and if it is falls back to the second INI file. I'd use a command-line switch to pick the ini file instead. I've had locked files get stuck that way when things crash. Tim Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.