Jump to content

Control hiding for certain users


joshxdr

Recommended Posts

I am using LV7.0 on an old Solaris machine. I want certain debugging controls to be automatically hidden when the "operator" user runs the vi. It doesn't have to be super-secure, it is just a question of making the interface cleaner and simpler for the operator. Can you grab environment variables and use those? For example, in the .bashrc script I could make a variable called USER and set it to operator. Of course if would be even cooler if I could use shell commands like "id" to get the user. Is this possible in LV7.0?

Link to comment

I don't have any experience with Solaris, but here are three potential options I can think of:

  1. There's an Application class property called User or something similar (which I believe should be available in 7.0) which returns the name of the current user. I don't remember if this is the OS user, or just the LabVIEW user, though.
  2. There's a VI in the palettes called System Exec, which I assume should allow you to run shell commands.
  3. In Windows, you can make a DLL call using the Call Library Function node to call into the Windows API. If Solaris has a similar API accessible through SOs, I assume you should be able to use it using the same method.

  • Like 1
Link to comment
  • 2 weeks later...

I don't have any experience with Solaris, but here are three potential options I can think of:

  1. There's an Application class property called User or something similar (which I believe should be available in 7.0) which returns the name of the current user. I don't remember if this is the OS user, or just the LabVIEW user, though.
  2. There's a VI in the palettes called System Exec, which I assume should allow you to run shell commands.
  3. In Windows, you can make a DLL call using the Call Library Function node to call into the Windows API. If Solaris has a similar API accessible through SOs, I assume you should be able to use it using the same method.

I used system exec to query environment variables. Worked like a champ!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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