NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Path to current Process Model

Solved!
Go to solution

I would like to get the path to the current process model, but I can't seem to find any reference to the current process model. The closest I've some is RunState.Root.ProcessModelClient.Path which returns the path to the test sequence which leads me to believe the ProcessModelClient is the sequence-file.

I know, to see the current default process model, I can go to Configure->Station Options->Model, but I am executing some test sequences from another program that might assert their own process model. I therefore want to log this. Is there a method to get the path to the current, active, process model?

0 Kudos
Message 1 of 3
(904 Views)

You're almost there. Use this to get the current executing process model sequence file path:

RunState.Root.SequenceFile.Path

 

Hope this helps.

 

Message 2 of 3
(887 Views)
Solution
Accepted by EnthusiasticTester

An (in my opinion) more robust way would be RunState.SequenceFile.GetModelSequenceFile("").Path. 

 

The difference is that RunState.SequenceFile.GetModelSequenceFile("").Path shows the statically configured Model file (the actual value of the dialog box you described), while RunState.Root.SequenceFile.Path shows the actual sequence model used in the current (running) context.

 

Also RunState.Root.SequenceFile.Path will not work, if you run it from a subsequence, then you'd need RunState.Root.Runstate.Root.SequenceFile.Path

 

On the other hand, RunState.SequenceFile.GetModelSequenceFile("").Path will return the Model file no matter if the model is actually used or not.

 

So in the end it comes down to the narrow details of your application.

 

Stefan

 

 

Message 3 of 3
(869 Views)