如何通过 LabVIEW 从Sequence文件中获取Step属性

更新 Nov 17, 2022

环境

软件

  • TestStand

我正在寻找一种无需打开 TestStand 即可从Sequence文件中获取Step属性的方法。我是否能使用LabVIEW来调用TestStand API达到此目的?

  1. 启动NI TestStand并创建一个新的Sequence文件。
  • 新增一个Statement step
  • 将step重命名为Test
  • Expression中加入Random(1,100)
  • 将文件命名为Test.seq并保存在C:\Test\
10.png
  1. 启动LabVIEW并创建一个新VI。现在,您应该参考TestStand API Reference Help来实现以下功能。
  2. 创建TestStand UI Application Manger的instance。
  • 使用ApplicationMgr.GetEngine方法创建TestStand Engine object
11.png
  1. 使用Engine.GetSequenceFileEx方法来调用位于C:\Test\Test.seq的文件。
12.png
  1. 使用SequenceFile.GetSequence方法来存取MainSequence 并将index的值设为0。
13.png
  1. 使用Sequence.AsPropertyObject方法来存取PropertyObject 类中定义的属性和方法。
14.png
  1. 使用PropertyObject.GetValString方法。
  • 使用lookup string Main["Test"].TS.PostExpr来获取Test step的Post-Expression
  • 将options的值设定为0
15.png
  1. 使用Engine.ReleaseSequenceFileEx方法释放sequence文件并关闭所有reference。
16.png
  1. 此时,VI 将如下所示。
17.png

运行 VI 后,该 VI 将在 GetValString的string indicator中显示“Random(0,100)”。