09-05-2024 09:57 AM
Hi all,
I am creating a custom UI with LabVIEW (started with simple OI) and ran into a situation where I need to have user privileges set. I have them set correctly in the teststand user section and they work fine there but in my custom UI they do not work properly. I read several pages about using them and checking the engine but dont know how to get it working properly. I then tried the full OI and it works perfectly there as well. I then started digging in the code and I cannot figure how they got it to work. Can someone please enlighten me on how to use user privileges in a new custom UI so that I can properly set the right click menus and single pass buttons.
Also another weird thing is on my UI the sequence file view does not show the setup and cleanup steps but in the full featured OI it does.
Thanks for the help.
09-05-2024 11:56 AM
Please see this post about the User Manager.
Try various settings until you get the behavior you want.
09-06-2024 08:14 AM
That post you linked was absolutely zero help. As explained in my post the settings in the user manager are correct. What i dont know is WHY when I create a custom UI the user privileges are ignored, and WHY when I use the simple OI or the full featured OI they work. I believe to have everything connected the same as these OI's but I am obviously missing something.
09-06-2024 10:59 AM - edited 09-06-2024 11:01 AM
Just trying to help.
Are you using a custom User.ini location or global; most setups use global.
Are you using the Global environment?
Please review your source code; verify that your UI is loading an environment.
C# example loading an environment during Main(string[] args):
//if using a custom environment set environmentPath to full filepath/name of the .tsenv file
var environmentPath = string.Empty;
var engineInitializationSettings = new EngineInitializationSettingsClass();
// when environmentPath is an empty string TestStand engine will load the GLOBAL environment
engineInitializationSettings.SetEnvironmentPath(environmentPath);
09-06-2024 01:28 PM - edited 09-06-2024 01:32 PM
Global. The custom UI is a modified version of the basic UI with UIMessages that ships with test stand. I don’t see a way in any of the examples that ship with test stand to load the environment as you stated. UI is done LabVIEW.
09-06-2024 02:01 PM
Are you using the LabView UI example from "C:\Users\Public\Documents\National Instruments\TestStand nnnn (nn-bit)\Examples\Modifying User Interfaces\Creating a Basic User Interface"?
When running the UI, the first thing it should do is prompt you to login. Are you able to login with the Basic example?
I can't run/compile the basic example as I don't have Labview. However, I ran the LabView UI from "C:\Users\Public\Documents\National Instruments\TestStand 2019 (32-bit)\UserInterfaces\Simple\LabVIEW"
I get a user login prompt, and I was able to run a demo sequence. You might want to compare the Basic example and the Simple example source files with your project to see what is different.
09-06-2024 02:09 PM
Also, look at your AxApplicationMgr object. Make sure you set the LoginOnStart property node to true.
On the C# Basic Example, I set the property to false and then ran the UI. I was unable to run or open a sequence and the UI has no menu to be able to login.
09-06-2024 02:19 PM
Also another weird thing is on my UI the sequence file view does not show the setup and cleanup steps but in the full featured OI it does.
The AxSequenceFileViewMgr property node StepGroupMode needs to be set to StepGroupMode_AllGroups
09-06-2024 02:32 PM
Thank you. That did it.
09-06-2024 02:33 PM
Yes I get the login screen with all the users.