NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

CreateDeleteUsers

I've seen the example sequence file CreateDeleteUsers.seq. and I stepped through the example and got it to work.  However, I want, instead, to have this functionality available to the user from my (customized test exec) from the Configure Menu.  I added a Configuration Sequence to my process model, and after configuring it, I see it in the drop down list. In the Main of that sequence, I added a message popup just to see that it would call it at runtime, and it did.  I later replaced that with an Action call to simple VI.
 
What I want to do now, is create a VI that looks similar to the attached png (from an excel example), yet lets me add/delete users.  I'd llke this to be available only to Admin types.   I would initially populate it with the current list of users, then add to it if the user adds a name in the blank line above this list.  What LabVIEW widget lets me add names to a list (of strings) like shown? 
 
Also, in my very minimal experimentation, I had made the call to the VI from a sample sequence file - it runs, returns, and says "Passed".  I don't want it to generate a test result.  Any suggestions?
0 Kudos
Message 1 of 15
(4,803 Views)
I have the code snippet (attached) that gets the Engine->UserFile->UserList, but I don't know how to get the list out to an array of strings, so I can populate my list menu, and start this thing off.
 
0 Kudos
Message 2 of 15
(4,793 Views)
Hello Mrbean,

the UserList is a PropertyObject, which contains all User objects. You can not directly get the LoginName string from UserList object, but from the User object.

I have attached an example, may that can help you.
Regards
MY
0 Kudos
Message 3 of 15
(4,784 Views)
Hello Mrbean,

sorry, i think i don't have completely misunderstood your last question.

Again, the UserList is a Property Object that contains an array of all User Objects. You should save all information from every User Object (Like FullName, LoginName...) into a cluster, then build an array of those cluster.
Regards
MY
0 Kudos
Message 4 of 15
(4,781 Views)
How did you create the "User" constant going into the 'type' input of the Variant to Data (inside the for-loop).  If I go to the UserFile or UserList outputs and right-click, I can create a constant of their respective types, but I don't see User in the Select ActiveX Class list?
0 Kudos
Message 5 of 15
(4,769 Views)
I've changed gears, and I'm doing all of this from my process model instead, taking advantage of ActiveX calls.  I've got quite a bit of this working, but I can't figure out from ActiveX, how to display (I do this only for an Admin) all the available users so he can select the one that he wants to edit.  I have the UsersFile and I've got the UserList, but I'm not sure how to get the LoginName (if that's what I need) of each to display in a popup for the admin to choose from.  I want to pass the selected user to the DisplayEditUserDialog.  Thoughts?
0 Kudos
Message 6 of 15
(4,766 Views)
Hi Mrbean,

please see the attachment, it is a Sequence file which collects all LoginNames in an Array.

And in my LabView Program i have create an User constant from Engine.GetUser function.
Regards
MY
0 Kudos
Message 7 of 15
(4,759 Views)

Any idea what the sytax error is in you statement?  TestStand is complaining

 

Locals.LoginName[Locals.UserIndex] = Locals.UserListRef.GetPropertyObjectByOffset(Locals.UserIndex, 0).AsUser.LoginName

0 Kudos
Message 8 of 15
(4,738 Views)
Hello Mrbean,

do you mean this? It is "No Errors" now.


Locals.LoginName[Locals.UserIndex] =  Locals.UserListRef.AsPropertyObject.GetPropertyObjectByOffset(Locals.UserIndex, 0).AsUser.LoginName

Regards
MY
0 Kudos
Message 9 of 15
(4,721 Views)
Now that I have the list of user logins (array of strings), I'd like to use an ActiveX call to TestStand or LabVIEW or Windows,to display a popup containing the users (by their logins), and it needs to allow the operator to select one of those names.  This name would then get passed to the DisplayEditUserDialog.  Thoughts?
0 Kudos
Message 10 of 15
(4,695 Views)