Teststand-控件


在 LabVIEW 中,TestStand 相关的所有控件都在estStand 选板上
在这里插入图片描述

这些控件全部是Active X控件,LabVIEW对它的编程是属性节点、方法节点及注册回调事件。
在这里插入图片描述
在这里插入图片描述

管理控件

TestStand提供的管理控件:应用程序管理控件、序列文件视图管理控件、执行视图管理控件。
在这里插入图片描述

应用程序管理控件

每个用户界面都需要有且仅有一个应用程序管理控件。

应用程序管理控件负责功能:
初始化或关闭 TestStand 引擎;
用户登入或注销;
加载或卸载序列文件;
启动执行;
追踪已加载的序列文件或执行;
加载类型选板文件;
维护应用程序配置文件;
处理命令式启动选项;
管理 TestStand 许可证。

序列文件视图管理控件

用户界面的每一个窗口要求有一个序列文件视图管理控件。

序列文件视图管理控件功能:
指定某一序列文件为当前活动序列文件;
追踪当前选中的序列、步骤组、步骤;
追踪当前选中的变量、属性;
通过已建立联系的可视化控件以显示序列文件的某些方面的信息;
通过使能已建立联系的可视化控件以更改选择的序列文件、序列、步骤组、步骤;
提供编辑、保存指令;
提供执行当前活动序列文件的方法。

执行视图管理控件

对于每一处显示执行或者允许用户选择当前执行的地方,都相应的需要一个执行视图管理控件。
在并行测试多执行界面中,并行测试的 UUT 的数量也就是执行视图管理控件的数量。
执行视图管理控件负责管理与之建立联系的可视化控件和选定的执行之间交互,及可视化控件该显示当前执行信息的方式。

执行视图管理控件完成任务:
指定某一执行为当前活动的执行;
追踪当前执行中选中的线程、堆栈、序列、步骤组、步骤;
追踪当前执行中选中的变量、属性;
通过已建立联系的可视化控件以显示当前执行的某些方面的信息;
通过使能已建立联系的可视化控件以更改选择的线程、堆栈、序列、步骤组、步骤;
产生事件以通知应用程序当前执行的进度和状态;
提供调试指令;
更新当前执行的报表内容。

可视化控件

可视化控件可以分为视图连接、列表连接、命令连接、信息员连接。包括:按钮、复选框、下拉列表、标签、下拉栏、变量视图、表达式编辑、列表框、报表视图、序列视图、状态栏、插入面板
在这里插入图片描述

视图连接

视图连接即,在管理控件和视图相关的TestStand控件之间建立联系。
视图连接包含变量视图、报表视图、序列视图、插入面板控件
在这里插入图片描述

在这里插入图片描述
序列视图控件和序列文件视图管理控件连接,显示序列文件中某一序列的步骤列表(静态的);和执行视图管理控件连接,显示当前执行中某一序列的步骤列表(动态实时的)。前者代表的是序列的编辑状态,而后者对应的是序列的运行状态。
变量视图控件类似,和不同管理控件连接以显示序列编辑状态或运行状态的所有变量和属性。
插入面板控件和序列文件视图管理控件连接后,用户就可以通过拖拽或双击的方式添加步骤到序列中。
报表视图控件和执行视图管理控件连接以显示当前执行的报表。这些连接通过调用下面的这些方法来实现:
SequenceFileViewMgr.ConnectSequenceView
SequenceFileViewMgr.ConnectVariables
SequenceFileViewMgr.ConnectInsertionPalette
ExecutionViewMgr.ConnectExecutionView
ExecutionViewMgr.ConnectReportView
ExecutionViewMgr.ConnectVariables

列表连接

列表连接即,在管理控件与列表控件间建立联系,管理控件从列表中指定某项,可视化控件陈列列表并显示选中的项目。
列表类控件包括下拉列表、下拉框、列表框
在这里插入图片描述
在这里插入图片描述

管理控件所提供的列表:

管理控件列表
ApplicationManagerAdapters
SequenceFileView ManagerSequence Files
SequenceFileView ManagerSequence
SequenceFileView ManagerStep Groups
ExecutionView ManagerExecutions
ExecutionView ManagerThreads
ExecutionView ManagerStack Frames

表格中的列表连接实现方法:
ApplicationMgr.ConnectAdapterList
SequenceFileViewMgr.ConnectSequenceFileList
SequenceFileViewMgr.ConnectSequenceList
SequenceFileViewMgr.ConnectStepGroupList
ExecutionViewMgr.ConnectExecutionList
ExecutionViewMgr.ConnectThreadList
ExecutionViewMgr.ConnectCallStack

命令连接

命令连接即,在管理控件与按钮、菜单之间建立联系以执行特定命令。按钮与命令关联后,么用户界面运行时,点击按钮即可触发命令,按钮的文本、状态使能会随着应用程序的状态变化而自动更新。
常见的命令有:
OpenSequenceFile、ExecuteEntryPoint、RunSelectedSteps、Break、Resume、Terminate、Exit

命令连接是通过以下方法来实现:
• ApplicationMgr.ConnectCommand
• SequenceFileViewMgr.ConnectCommand
• ExecutionViewMgr.ConnectCommand
如果需要在程序中自动运行命令,而不需要采用和控件建立连接的方式,则可以使用下面的某一种方法先获取一个命令对象,之后就可以使用方法 Command.Execute 调用命令。
• ApplicationMgr.GetCommand
• ApplicationMgr.NewCommands
• SequenceFileViewMgr.GetCommand
• ExecutionViewMgr.GetCommand

信息源连接

信息源连接即,在管理控件与可视化控件之间建立连接以显示标题、图标、数值信息。
可视化控件包括:
标签、表达式编辑、状态栏
在这里插入图片描述
在这里插入图片描述
标题的连接通过下面的方法实现:
ApplicationMgr.ConnectCaption
SequenceFileViewMgr.ConnectCaption
ExecutionViewMgr.ConnectCaption
如果不借助于控件连接而获取标题,可以使用 GetCaptionText 方法:
ApplicationMgr.GetCaptionText
SequenceFileViewMgr.GetCaptionText
ExecutionViewMgr.GetCaptionText

ImageSources 枚举了所有的图标,图标的连接通过以下方法实现:
ApplicationMgr.ConnectImage
SequenceFileViewMgr.ConnectImage
ExecutionViewMgr.ConnectImage
如果不借助于控件连接而获取图标,可以使用 GetImageName 方法:
ApplicationMgr.GetImageName
SequenceFileViewMgr.GetImageName
ExecutionViewMgr.GetImageName

将状态栏控件和执行视图管理管理控件连接之后,可以显示当前执行的进度,通过ExecutionViewMgr.ConnectNumeric 方法实现,如果不借助于控件连接而获取数值,可以用ExecutionViewMgr.GetNumericValue 方法。

最全的Teststand 教程(英文版) Introduction Introduction.................................................................................................................xi Technical Support Options.........................................................................................xii Course Objectives.......................................................................................................xiii Course Description .....................................................................................................xiii Course Map.................................................................................................................xiv Items You Need for this Course Module:...................................................................xv Note on Hands-On Exercises......................................................................................xvi Lesson 1 Introduction to TestStand Introduction.................................................................................................................1-1 The Role of a Test Executive......................................................................................1-2 The TestStand Goal ....................................................................................................1-3 What is TestStand?.....................................................................................................1-4 The TestStand Architecture........................................................................................1-5 The Sequence Editor...................................................................................................1-6 The Operator Interface................................................................................................1-7 The TestStand Engine.................................................................................................1-8 Module Adapters ........................................................................................................1-9 The TestStand Architecture........................................................................................1-10 Summary.....................................................................................................................1-13 Exercises Exercise 1-1 Running a Sequence File..................................................................1-15 Exercise 1-2A Running a Sequence File from the LabVIEW Operator Interface ............................................................................1-20 Exercise 1-2B Running a Sequence File from the LabWindows/CVI Operator Interface..............................................1-25 Contents TestStand Development Course Manual iv www.ni.com Lesson 2 The TestStand Environment Introduction.................................................................................................................2-1 What is a Sequence?...................................................................................................2-2 Step Groups.................................................................................................................2-3 TestStand Sequence Files ...........................................................................................2-4 Debugging Tools.........................................................................................................2-5 The TestStand Process Model.....................................................................................2-8 The Default Process Model: Test UUTs Mode ..........................................................2-9 TestStandModel.seq....................................................................................................2-10 The Role of the Process Model within the TestStand Architecture............................2-11 Exercises Exercise 2-1 Understanding the Sequence File.....................................................2-15 Exercise 2-2 Running a Sequence File with Breakpoints and Single Stepping.................................................................................2-21 Exercise 2-3 Understanding the Process Model....................................................2-28 Lesson 3 Creating Sequences Introduction.................................................................................................................3-1 How to Create Test Sequences ...................................................................................3-2 Action 1 : Specify the Adapter ...................................................................................3-3 Action 2: Select the Step Type ...................................................................................3-4 Step Types...................................................................................................................3-5 Action 3: Specify the Test Module.............................................................................3-6 Specifying the Module................................................................................................3-7 Specifying the Module: Search Directories................................................................3-8 Action 4: Configure Step Properties...........................................................................3-9 Step Properties: General Tab......................................................................................3-10 Step Properties: Preconditions....................................................................................3-11 Step Properties: Run Options......................................................................................3-12 Step Properties: Post Actions......................................................................................3-14 Step Properties: Loop..................................................................................................3-15 Step Properties: Expressions.......................................................................................3-17 Exercises Exercise 3-1 Creating Steps in the Sequence Editor .............................................3-23 Exercise 3-2 Configuring Loop Options ...............................................................3-34 Exercise 3-3 Creating a Sequence.........................................................................3-38 Exercise 3-4 Running Sequences in Parallel (Optional) .......................................3-58 Contents © National Instruments Corporation v TestStand Development Course Manual Lesson 4 TestStand Parameters, Variables, and Expressions Introduction.................................................................................................................4-1 Parameters...................................................................................................................4-2 Parameters: Passing data from top-level sequences to subsequences.........................4-3 TestStand Variables....................................................................................................4-4 Local Variables...........................................................................................................4-5 Creating Locals Variables...........................................................................................4-6 Sequence File Global Variables..................................................................................4-8 Creating Sequence File Global Variables...................................................................4-9 Station Globals............................................................................................................4-10 The Expression Browser.............................................................................................4-11 Exercises Exercise 4-1 Using Local Variables......................................................................4-19 Exercise 4-2 Examine the Uses and Differences between Locals, File Globals, and Station Globals.....................................................4-22 Exercise 4-3 Using Expressions to Change Step Properties..................................4-30 Exercise 4-4 Passing Parameters...........................................................................4-39 Exercise 4-5 Dynamically Selecting Which Sequence to Run..............................4-49 Exercise 4-6 Using the UUT Serial Number to Determine Which Sequence to Run...............................................................................4-50 Lesson 5 Creating Test Modules in External Environments Introduction.................................................................................................................5-1 Creating Tests in External Application Development Environments (ADEs)...........5-2 Methods of Data Transfer for TestStand ....................................................................5-3 Method 1—Passing Parameters Directly Using Structures........................................5-3 Using Clusters to Pass Data from LabVIEW..............................................................5-4 Using Structures to Pass Data from LabWindows/CVI..............................................5-6 Method 2—Passing Arbitrary Number of Parameters Directly..................................5-8 Method 3—Using the ActiveX Automation API to Access Properties and Methods .............................................................................................................5-12 What is ActiveX Automation?....................................................................................5-13 Summary of ActiveX Automation..............................................................................5-14 TestStand and ActiveX Automation...........................................................................5-15 Using TestStand ActiveX Automation Functions in LabVIEW.................................5-16 An Example of Using ActiveX Automation in LabVIEW.........................................5-17 Using ActiveX Automation in LabWindows/CVI......................................................5-18 An Example Of Using The TestStand API Instrument Driver In LabWindows/CVI.....................................................................................................5-19 Using TestStand to Generate Code Templates...........................................................5-24 Code Templates ..........................................................................................................5-25 Contents TestStand Development Course Manual vi www.ni.com Exercises Exercise 5-1A Creating Pass/Fail Tests in LabVIEW..............................................5-27 Exercise 5-1B Creating Pass/Fail Tests with LabWindows/CVI.............................5-33 Exercise 5-1C Creating Pass/Fail Tests for the DLL Flexible Prototype Adapter.............................................................................5-44 Exercise 5-2A Creating Numeric Limit Tests with LabVIEW................................5-54 Exercise 5-2B Creating Numeric Limit Tests with LabWindows/CVI.............................................................................5-59 Exercise 5-2C Creating Numeric Limit Tests for the DLL Flexible Prototype Adapter...............................................................5-67 Exercise 5-3A Debugging Tests Using LabVIEW...................................................5-80 Exercise 5-3B Debugging Tests Using LabWindows/CVI......................................5-84 Exercise 5-3C Debugging Tests that use the DLL Flexible Prototype Adapter.............................................................................5-88 Exercise 5-4A Using the ActiveX API in Code Modules with LabVIEW .................................................................................5-91 Exercise 5-4B Using the ActiveX API in Code Modules with LabWindows/CVI ....................................................................5-100 Exercise 5-4C Using the ActiveX API in Flexible DLL Code Modules............................................................................................5-110 Exercise 5-5A Creating a Simple Test Using the LabVIEW Standard Prototype Adapter .............................................................5-122 Exercise 5-5B Creating A Simple Test Using The C/CVI Standard Prototype Adapter .............................................................5-124 Exercise 5-6A Passing Parameters from TestStand to LabVIEW using The TestStand API..................................................................5-125 Exercise 5-6B Passing Parameters from TestStand to LabWindows/CVI using The TestStand API...................................5-127 Exercise 5-7 Passing Data Between TestStand and a Test Module Using the DLL Flexible Prototype Adapter........................5-129 Lesson 6 User Management Introduction.................................................................................................................6-1 The TestStand User Manager .....................................................................................6-2 Default User Profiles in TestStand .............................................................................6-3 Linking Windows System Users.................................................................................6-5 Exercise Exercise 6-1 Setting User Login Access and Privileges........................................6-7 ...............
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

斯金

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值