LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Soft Close LabVIEW application Running Under Different User

Hello All,

 

We're working in an environment where all users will now require unique windows accounts rather than a shared "public," account. However, this is creating an issue where.

 

  1. User A Logs in and starts the LabVIEW exe application.
  2. User A Completes work and logs out of the computer, but leaves the LabVIEW exe running.
  3. User B Logs in and starts the LabVIEW exe application. 
  4. The LabVIEW exe errors out because User A Still has the application running.

Is there a way to efficiently (in order of preference):

  1.  "Link," the LabVIEW.exe across all users so that the exe maintains state and is universally available to all users.
  2.  Have User B's start of LabVIEW.exe send an event (over TCP?) that will disconnect and close User A's instance of the software.
  3. Have User B's start of LabVIEW.exe force close all other instances of LabVIEW.exe as can be done via task manager.
0 Kudos
Message 1 of 17
(1,286 Views)

This is tricky, logically, the best way to implement is to auto-shutdown the application on user logout instead of some other user telling it to shut down.

 

I feel another user should not have control over what you run on your windows login. Why can't the application run multiple instances? does it use the same hardware resource causing an issue?

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 17
(1,274 Views)

@santo_13 wrote:

I feel another user should not have control over what you run on your windows login. Why can't the application run multiple instances? does it use the same hardware resource causing an issue?

 



Correct.

 

The application runs test hardware that will only allow one connection at a time.

0 Kudos
Message 3 of 17
(1,259 Views)

Usually when you log out, all applications will be terminated.  You can't leave LabVIEW running unless it's a service.

 

If you make your LabVIEW program run as a service, then all user should be able to get data/status from it.

 

 

George Zou
0 Kudos
Message 4 of 17
(1,237 Views)

@zou wrote:

Usually when you log out, all applications will be terminated.  You can't leave LabVIEW running unless it's a service.

 

If you make your LabVIEW program run as a service, then all user should be able to get data/status from it.

 

 


I think they must doing "switch user".  In that case, all tasks for that user are suspended while the other user is logged in.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 17
(1,234 Views)

@zou wrote:

Usually when you log out, all applications will be terminated.  You can't leave LabVIEW running unless it's a service.

 


For us, we have a "Switch user" option in our logout menu. If a user idles for too long, a login screen appears and another user can log in as if this option was selected.

JScherer_0-1677082870188.png

 

0 Kudos
Message 6 of 17
(1,229 Views)

@JScherer wrote:

Is there a way to efficiently (in order of preference):

  1.  "Link," the LabVIEW.exe across all users so that the exe maintains state and is universally available to all users.
  2.  Have User B's start of LabVIEW.exe send an event (over TCP?) that will disconnect and close User A's instance of the software.
  3. Have User B's start of LabVIEW.exe force close all other instances of LabVIEW.exe as can be done via task manager.

To clarify, you are talking about a LabVIEW application right? LabVIEW.exe is the LabVIEW development environment itself, whereas "a LabVIEW exe" typically means any application built in LabVIEW. The options make it sound like User B is opening the LabVIEW development environment. Is that what you meant?

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 7 of 17
(1,219 Views)

Switch user is different from logout.

 

Again, you can use service to solve the problem.

 

https://lavag.org/topic/19286-running-labview-executable-as-a-windows-service/ 

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000004AUiSAM&l=en-US

 

 

George Zou
0 Kudos
Message 8 of 17
(1,216 Views)

@JScherer wrote:

@zou wrote:

Usually when you log out, all applications will be terminated.  You can't leave LabVIEW running unless it's a service.

 


For us, we have a "Switch user" option in our logout menu. If a user idles for too long, a login screen appears and another user can log in as if this option was selected.

JScherer_0-1677082870188.png

 


Yes, that is what I figured.  AFAIK, if you have admin privileges, you can kill the task or kill the user.  Well, not literally - although sometimes when this happens the thought crosses your mind.

 

The best way is to adopt a policy that prevents this from happening.  (Good luck with that!)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 17
(1,211 Views)

Have User B's start of LabVIEW.exe send an event (over TCP?) that will disconnect and close User A's instance of the software.

This option is a lot easier.

Everyone should use a "launcher" instead of the original application.

If launcher detects the application is running, it should close the application before launch another instance.

You can use TCP, Shared Variable, or other methods to notify the application to close "softly".

 

George Zou
0 Kudos
Message 10 of 17
(1,186 Views)