joshxdr Posted February 6, 2010 Report Share Posted February 6, 2010 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? Quote Link to comment
Yair Posted February 6, 2010 Report Share Posted February 6, 2010 I don't have any experience with Solaris, but here are three potential options I can think of: 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. There's a VI in the palettes called System Exec, which I assume should allow you to run shell commands. 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. 1 Quote Link to comment
jeffneuner Posted February 11, 2010 Report Share Posted February 11, 2010 try this: open application reference get the app.username property then show or hide your controls 1 Quote Link to comment
joshxdr Posted February 25, 2010 Author Report Share Posted February 25, 2010 I don't have any experience with Solaris, but here are three potential options I can think of: 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. There's a VI in the palettes called System Exec, which I assume should allow you to run shell commands. 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! Quote Link to comment
crelf Posted February 25, 2010 Report Share Posted February 25, 2010 As an aside, I prefer to disable and gray controls rather than hiding them. Or, if you must hide them, put them on a admin page of a tab control and the switch pages depending on who is logged on. 1 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.