文章目录

  • 用户界面运行流程
  • 例程
  • 创建前面板
  • 设置用户界面主窗口
  • 前面板控件配置
  • 用户事件


用户界面运行流程

teststand 调用labview 弹窗 labview teststand教程_用户界面


用户界面设计的基本元素:管理控件、可视化控件、连接、应用程序启动及关闭、注册事件、处理事件。

LabVIEW中通过Regesiter Event Callback注册事件。

LabVIEW-TestStand常用事件包括:

事件

描述

ExitApplication

应用程序管理控件产生该事件要求退出应用程序。

Wait

应用程序管理控件产生该事件以设置系统光标为忙碌或正常状态。

ReportError

应用程序管理控件产生该事件以报告应用错误。

DisplaySequenceFile

应用程序管理控件产生该事件以显示某特定序列文件。

DisplayExecution

应用程序管理控件产生该事件以显示特定的执行。

例程

这里是做一个单执行用户界面teststand execution example\Single Execution-LabVIEW\Simple UI.lvproj

创建前面板

teststand 调用labview 弹窗 labview teststand教程_控件_02


teststand 调用labview 弹窗 labview teststand教程_控件_03


在按钮上右击-属性浏览器-Caption,修改按钮显示文字

teststand 调用labview 弹窗 labview teststand教程_应用程序_04

设置用户界面主窗口

创建一个方法节点并选择ActiveX类,选择GetEngine方法:

teststand 调用labview 弹窗 labview teststand教程_控件_05


teststand 调用labview 弹窗 labview teststand教程_ui_06


连接Application Manager、方法节点及TestStand-Set TestStand Application Window.vi (此VI将设置当前VI为teststand用户界面的主窗口)

teststand 调用labview 弹窗 labview teststand教程_ui_07

前面板控件配置

连接按钮与方法节点,按钮连接至ConnectCommand方法,SequenceFile下拉列表连接至ConnectSequenceFileList方法,Execution Display序列视图控件连接至ConnectExecutionView方法,Report报表视图连接至ConnectReportView方法

teststand 调用labview 弹窗 labview teststand教程_ui_08

用户事件

创建用户事件,完成事件注册及程序开始;

创建事件结构,处理用户事件;

完成事件的取消注册及销毁。

teststand 调用labview 弹窗 labview teststand教程_ui_09

teststand 调用labview 弹窗 labview teststand教程_应用程序_10

teststand 调用labview 弹窗 labview teststand教程_用户界面_11