Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an --exit argument for LabVIEW to exit after completion of cmd #157

Open
jimkring opened this issue Aug 24, 2023 · 3 comments
Open

Add an --exit argument for LabVIEW to exit after completion of cmd #157

jimkring opened this issue Aug 24, 2023 · 3 comments

Comments

@jimkring
Copy link
Contributor

jimkring commented Aug 24, 2023

One idea (that might be nice in addition to the --kill option) would be to add a new --exit flag (to "Exit LabVIEW on Completion") that is received by the Start CLI Interface.vi, passed along the session wire, and then handled in the Exit with Error Code.vi by invoking LabVIEW's "Exit" function:

Screen Shot 2023-08-24 at 10 31 47 AM

I've been doing this as a user-defined, additional argument, and it would be great it it were built in.

Originally posted by @jimkring in #137 (comment)

@JamesMc86
Copy link
Owner

I like this and it can solve the questions around #137

I feel like it would be best with 3 options:

  • Don't Exit
  • Always Exit
  • Exit if Single Instance

The last option would be default so that coming to Linux would work in a sensible way by default.

The problem would be that it is a breaking change for:

  • People running exes
  • People running Windows with multiple LabVIEW instances

In both cases, I suspect they have implemented this function themselves anyway, but the timing may be different and cause problems.

@jimkring
Copy link
Contributor Author

Hi James. I'm not sure if I quite understand the different options you mentioned.

My thinking is that the current behavior of G-CLI is that it is up to the LabVIEW code to decide to exit (call the LabVIEW quit/exit function).

I would be very happy with a new --exit flag that defaults to False and is handled by LabVIEW inside the g-cli close session VI (behind the scenes where I can't see it).

Since the default setting/behavior (I've suggested) is False (Meaning: do not exit LabVIEW) then adding this feature would not change the default behavior for existing users in any way (I think).

@JamesMc86
Copy link
Owner

I've probably used the wrong terms actually. So don't exit or always exit is exactly what you have described.

What I'm trying to capture with the other option is the times that you probably do want to exit based on the launch context. This has 3 use cases:

  • In built executables you probably want to exit when complete.
  • In LabVIEW on Windows you can set the ini flag so it can run multiple instances so you probably want to close the instance when done.
  • On Linux it will always launch more instances when done.

By adding the 3rd option I basically want the same command to exit in these 3 instances but not in other cases.

However an alternative approach is maybe that distinction should be set in the LabVIEW code by the tool developer who may be better placed to decide on that differentiation. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants