NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

delete user with VB code(customizing operator interface)

1) I'm customaizing my operator interface(VB and I need to give the option to delete a user from the users list.
Is anyone have any idea.

2) how do I update changes made with the EditUser dialog box (Engine.DisplayEditUserDialog).

Advanced thanks, Avi.
0 Kudos
Message 1 of 4
(3,883 Views)
Avi,

I am not sure what version of TestStand you are using but I am going to assume it is TS 2.0. TestStand 1.0.x did not have the property API functionality add and delete users.

1) See the example \Examples\CreateDeleteUsers. Specifically look at the Delete User sequence in this file. This sequence uses the API methods/properties that you will need to use in your VB code.

2)The DisplayEditUserDialog method is now obsolete in TestStand 2.0 and has been replaced by the DisplayPropertiesDialog method.

If you are using TS 2.0 then you will need to
A)use Engine.GetUser to obtain a user object to the user you want to udpate.
B)use User.AsPropertyObject to obtain a property object reference to the user object.
C)use PropertyObject.DisplayPropertiesDialog to
display the dialog with which you can edit the user. This method also takes as an input parameter, the property object file to which the user belongs. By passing a file reference the updated user object is AUTOMATICALLY stored in the user file and the user file is saved.

D) You get a reference to the user file from the Engine.UserFile. Then you use UserFile.AsPropertyObjectFile to get the reference that is needed for the file input parameter of PropertyObject.DisplayPropertiesDialog.


By the way, there is a mistake in the CreateUser sequence. The second and third step, UserProfile and Create New User, both unecessarily create new Engine objects. This add significant overhead to the example. They should both be changed to use Runstate.Egnine for their ActiveX Reference and the Create Object checkbox should be unchecked.


Let me know if you have questions.
0 Kudos
Message 2 of 4
(3,883 Views)
Hi Nemo.
Thanks for your answer.
I'm using TS 1.0.2 and I'm customizing the user interface.
I have the TS 2.0 but I'm afraid to install it 'cause I dont know how it will affect on the customization I did so far and the API's I'm using.
please tell me(if you know) how it will affect the API's I'm using and if I can install it (TS 2.0) safely.

Advanced thanks, Avi
0 Kudos
Message 3 of 4
(3,883 Views)
Avi,

NI has tested installing TS 2.0 over TS 1.0.x without majoor problems.

Some of the problems that I have heard about include customization of the process model. In TestStand 1.0.x some of the steps in the process model call fucntions in modelsupport.dll.

TestStand 2.0 uses modelsupport2.dll. In addition, some of the functions have been removed from modelsupport2.dll that used to exist in modelsupport.dll. The only reason that functions were removed is redundancy. When the TestStand 1.0 process model was created the ActiveX adapter was not completed. Therefore the process model could not use the TS API directly but instead had to call a DLL function which in turn called into the TS API. The functions were simply wrappers around certain TS API. In the TS 2.0 process models the TS API is called directly using the ActiveX adapter. One example of this is the PostUIMessages function.

The solution is to either copy your customization to the TS 2.0 process model, or to replace the modelsupport.dll steps in your customized TS 1.0 model with the equivalent steps from the TS 2.0 model.

I can't think of any other problems but if you run into any your can call or write to the NI TestStand support group who will give you exellent help. I have not heard of one upgrade problem that could not be resolved.

TS 2.0 merges your typepalette.ini file into the new type palette architecture. You might want to back up your typepalette.ini file just in case something happens.

Most customizations should have been stored in the \Components\User directory. The installation will not overwrite the contents of the user directory.

With TS 2.0 you have the option to install it in a different directory than your TS 1.0 installation. You cannot run both at the same time but your are provided a switcher program (see \National Instruments\shared\TestStandVerSelect)that allows you to switch between the version that you want to run. If you choose this option then you will ensure that you can always use TS 1.0, however, you will not benefit from any of the automatic upgrade routines such as processing of your typepalettes.ini file.

Finally, make sure that all of your VIs (if you use LV) are mass compiled to LV 5.1 or later BEFORE installing TS 2.0. LV 5.0 or earlier VIs that use TS ActiveX will not work after installing TS 2.0. This is a LV 5.0 limitation which is corrected by mass compiling to LV 5.1 before changing any of your ActiveX server applictions such as TS.

What have you customized? This might help in predicting what problems, if any, you might encounter.
0 Kudos
Message 4 of 4
(3,883 Views)