Jump to content
News about the LabVIEW Wiki! Read more... ×
cristianv

Allow only one instance of executable

Recommended Posts

Hello.

 

How can you allow only one instance of an executable on linux? I've tried to add

 

allowmultipleinstances=False

 

in the config file, and it does not work. In Windows it works perfectly...

 

Thanks!

Cristian :)

Share this post


Link to post
Share on other sites

Perhpaps you need the correct capitalization? Linux (in general) is capital aware while Windows is not.

If I look at a windows LabVIEW.exe it has the following string somewhere in the binary file: allowMultipleInstances so you might need to CamelCase your INI key.

I'd test:

AllowMultipleInstances

allowMultipleInstances

 

And I'd test it with different spellings of False/false/FALSE

 

Ton

Share this post


Link to post
Share on other sites

Thank you.

 

I've tested several way of writting like you suggested but nothing seems to be working...

Share this post


Link to post
Share on other sites

I wouldn't think capitalization is the issue, simply because I thought that it defaulted to false.  Meaning if there was no entry in the INI it wouldn't allow multiple instances, and only if you set it to true does its behavior change.  Sorry never see this before.

Share this post


Link to post
Share on other sites

Under Windows there is a special root loop in LabVIEW that registers a LabVIEW Window Class on startup. That supposedly fails when it is already registered and in old days LabVIEW simply passed control to that other instance and then terminated.

 

The allowMultipleInstances ini key is a fairly new addition (well around LabVIEW 7 or so) that seems to make LabVIEW not terminate on RegisterClass() returning an error but instead simply continues. Under Linux there is no such mechanisme and it is even more unusual for an application to not allow being started more than once. They would have to add some internal IPC mechanisme to check for that on startup and I'm sure that never really has come up so far and even a Product Suggestion has a very low chance to ever make it into LabVIEW.

 

allowMultipleInstances most likely is nowhere present in any non-Windows version of LabVIEW.

 

However, at least in Linux (and I suppose on OSX too) you can easily do this by creating a startup shell script for your LabVIEW application and check in there with shell commands for the existence of another instance of the same app. Look here for a fairly simple possibility to do that.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.