NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

user specific templates

Solved!
Go to solution

When using TS, it's possible to create your own templates with code snippets, steps and so on. Is there a way to have different templates for different user, so that when a user logs in, he has his own templates?

 

Thanks.

0 Kudos
Message 1 of 4
(3,686 Views)
Solution
Accepted by topic author paicolman

What you want is doable but not advisable.  Here's what I would do if I really really wanted this:

In the FrontEndCallbacks.seq located here: C:\Program Files\National Instruments\TestStand 4.1.1\Components\Callbacks\FrontEnd you will find steps that get called every time a login and logout occur in TS.  DISCLAIMER: Monkeying around with this callback can cause undesired results.  Ok now that you've read the disclaimer take careful note of the preconditions and the post actions for the two steps in there.  What you can do is call some code in here that will replace your Templates.ini file with a different one.  This file is located in the TestStand Cfg folder.  C:\Program Files\National Instruments\TestStand 4.1.1 then click on Cfg.  Set up one ini file for one developer and one ini for another developer.  Place them in a different location.  Then when TS opens and a login occurs the front end callback will be called.  Your code will replace the Templates.ini file with the correct one based on who logged in.  Use Engine.CurrentUser.LoginName.  I would make the call in my Cleanup Step Group as this will get called after the login occurs. 

 

I have created a simple FrontEndCallbacks.seq that demonstrates how to get the user that just logged in.  If you want to see it in action then rename your old one.  Place this in the folder mentioned above and go to File>>Login from TS.

 

Let me know if you have any questions.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 4
(3,673 Views)

One more thing-

 

You can change the config directory.  Configure>>Station Options>>Preferences.  Change the Configuration Directory to a new location.  Note that all config files except for Users.ini have to be in the same directory.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 4
(3,669 Views)

Hi Jiggawax,

 

Thanks for the answer. Just changing the cfg directory won't help, since they have to use different template.ini files, but same station globals etc. So the way through the callback is the way to go, I thought it must be something like that. Thanks a lot for pointing me in the right direction. I'm aware that this is not very adviceable, since you can make lots of damage. I'll give it a try.

0 Kudos
Message 4 of 4
(3,661 Views)