NI TestStand

取消
显示结果 
搜索替代 
您的意思是: 

Path to current Process Model

已解决!
转到解答

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 项奖励
1 条消息(共 3 条)
2,402 次查看

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

RunState.Root.SequenceFile.Path

 

Hope this helps.

 

2 条消息(共 3 条)
2,385 次查看
解答
已被主题作者 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

 

 

3 条消息(共 3 条)
2,367 次查看