02-01-2010 05:12 AM
Hi Ppl,
I tried programmatically inserting a search directory. I used the method Engine.SearchDirectory.Insert. After calling this method I called the SearchDirectory.Reload method. Despite calling this method the newly added directory was not displayed in the search directories list in sequence editor. When we change Mytypes.ini or other configurations external to sequence editor I get the pop up to reload them. But when I inserted search directory It didnt ask for reloading. I had to restart sequence editor for the new directory to be listed. How do I reload without restarting sequence editor ?
Below is the code that I used .
Solved! Go to Solution.
02-01-2010 06:17 AM
02-01-2010 06:23 AM
Hi Juergen,
I tried it. But still the directory is not listed without restarting sequence editor.
Thanks
02-01-2010 06:35 AM
Hi
Sounds bad and according to this old thread
it sounds worse.
http://forums.ni.com/ni/board/message?board.id=330&message.id=807&query.id=1116352#M807
"Note: The changes that you make to the config file will not take effect until you restart the Sequence Editor. This is due to the fact that we cache the config file when the Sequence Editor is loaded.
"
Maybe the "blue ones" have some workarounds i am courious on the answer
Juergen
02-01-2010 06:57 AM
Juergen,
Do you think there is any work around ?
Thanks
02-01-2010 04:47 PM
Sathish -
Are you calling this VI from TestStand or stand-alone in the LabVIEW environment? I tested out the same API and was able to get it working using the TestStand Expression language. What version of TestStand are you using?
02-01-2010 11:23 PM
Manooch,
I'm using TestStand 4.2. I tried calling this VI from LabVIEW. It was not from TestStand. I created the automation reference of TestStand Engine and used it in the VI.
Thanks
02-02-2010 08:46 AM
Sathish -
I believe the behavior you are seeing is expected. When you call the VI stand-alone outside of TestStand, you are creating a different instance of the engine. Thus, you have one instance of the TestStand Engine in the Sequence Editor process, and one instance of the TestStand Engine in the LabVIEW process.
Now, when you call SearchDirectories.Reload() from the LabVIEW VI, you are telling the LabVIEW instance of the TestStand Engine to reload the SearchDirectories that it has cached from the SearchDirectories on disk, however, this has no effect on the Sequence Editor instance of the TestStand Engine.
Now, if you were to call your VI as a code module from a sequence that you execute within the Sequence Editor, and you pass the Engine as an input to the VI (RunState.Engine), then you would see the behavior you are expecting.
You could also try the following as a test: With the Sequence Editor open, run your VI as you have been. Then, in the Sequence Editor, execute a step that calls RunState.Engine.SearchDirectories.Reload() (if you're in TestStand 4.0 or newer, you can simply call this in a Statement step). Then check the Search Directories... have they updated?
Hope this helps.
02-02-2010 10:53 AM
Manooch,
I will have to call this VI from a operator interface. So I will use ApplicationManager.GetEngine. So far I was only trying to check if this will work. When I call this VI from the operator interface I think this should work.
Thanks