null虚拟仪器开发环境虚拟仪器开发环境虚拟仪器的概念虚拟仪器的概念所谓虚拟仪器(Virtual Instrument,简称VI)是指以通用计算机为核心的硬件平台,配以相应测试功能的硬件作为输入/输出的接口,利用仪器软件开发平台在计算机的屏幕上虚拟出仪器的面板和相应的功能,然后通过鼠标或键盘操作的仪器。软件是构成虚拟仪器的核心,可以说软件就是仪器。nullMay 2003
January 2002
August 2000
March 1998
February 1996
August 1993
September 1992
January 1990
October 1986
April 1983 • LabVIEW 7 Express VIs, I/O Assistants, FPGA/PDA targets
LabVIEW 6.1 Enhanced networking capabilities, analysis
LabVIEW 6i Internet-ready measurement intelligence
• LabVIEW 5.0 ActiveX, Multithreading
• LabVIEW 4.0 Added professional tools, improved debugging
• LabVIEW 3.0 Multiplatform version of LabVIEW
• LabVIEW for Windows
• LabVIEW 2.0 for Macintosh
• LabVIEW 1.0 for Macintosh
• LabVIEW project beginsNI LabVIEW: A History of InnovationnullPC, Mac, Linux, SunLabVIEW EverywhereNetworked I/OPC BoardsWorkstationHandheldEmbedded
(FPGA)Industrial Computer (PXI)WirelessSensorTektronix Open Windows OscilloscopesThe LabVIEW FamilyThe LabVIEW FamilyNI LabVIEW
Graphical Programming Software for Measurement and AutomationLabVIEW Real-Time ModuleLabVIEW FPGA ModuleLabVIEW PDA ModuleLabVIEW Datalogging and
Supervisory Control Modulenull采集
分析
定性数据统计分析pdf销售业绩分析模板建筑结构震害分析销售进度分析表京东商城竞争战略分析
显示LabVIEW可以方便的实现采集、分析、显示用LabVIEW实现采集用LabVIEW实现采集LabVIEW 应用以下器件实现采集
GPIB, Serial, Ethernet, VXI, PXI Instruments
Data Acquisition (DAQ)
PCI eXtensions for Instrumentation (PXI)
Image Acquisition (IMAQ)
Motion Control
Real-Time (RT) PXI
PLC (through OPC Server)
PDA
Modular Instruments
LabVIEW 与NI公司的硬件及其他厂商的硬件接口用LabVIEW分析用LabVIEW分析LabVIEW 包含:
超过400个分析函数用于差分方程、最优化、曲线拟合、微分、线性代数、统计等
12 个快速VI用于滤波和频谱分析
滤波、加窗、变换、峰值检测、谐波分析、频谱分析等信号处理函数
Matlab编写的文件可以在LabVIEW程序中应用LabVIEW中有丰富的信号处理函数用LabVIEW显示用LabVIEW显示LabVIEW 包含以下工具帮助我们显示数据:
计算机上:图形、图表、大罐、图片控制、3D图形、报告等
网络 — 网页发布工具, Datasocket (Windows Only), TCP/IP, VI Server, Remote Panels, Email
Enterprise Connectivity Toolset — SQL Tools (Databases), Internet Tools (FTP, Telnet, HTML)内容内容LabVIEW简介结构模块化编程定制VI数据采集和波形仪器控制数组图表簇选择字符串和文件I/Onull本章目标理解前面板、方框图、连接器/图标
会用LabVIEW的结构和数据类型
编辑和调试VI的方法
创建子程
显示和
记录
混凝土 养护记录下载土方回填监理旁站记录免费下载集备记录下载集备记录下载集备记录下载
数据
用DAQ卡创建应用程序
课程不讨论的内容课程不讨论的内容LabVIEW内嵌对象、函数
Analog-to-digital (A/D) 理论
串口或 GPIB总线的详细操作
创建仪器驱动程序虚拟仪器程序Virtual Instruments (VIs)虚拟仪器程序Virtual Instruments (VIs)Front Panel 前面板
Controls = Inputs 控制
Indicators = Outputs 指示
Block Diagram 程序框图
Accompanying “program” for front panel 与前面板对应
Components wired together 对象连接在一起
控制程序的代码LabVIEW 对话框LabVIEW 对话框创建一个新的VI创建一个新的VIFile»New VI to open a blank VI
File»New… to open the New dialog box and configure a VI template, global variable, control, etc…“新建” 对话框“新建” 对话框MenuMenu
File Edit Operate Tools Browse Window Help前面板前面板Front Panel
ToolbarGraph
LegendBoolean
ControlWaveform
GraphIconPlot
LegendScale
LegendWaveform
Graph
Owned
Label程序框图窗口 Block Diagram Window程序框图窗口 Block Diagram WindowWire
DataGraph
TerminalSubVIWhile Loop
StructureBlock Diagram ToolbarDivide
FunctionNumeric
ConstantTiming
FunctionBoolean Control Terminal前面板和程序框图工具栏前面板和程序框图工具栏Run button
Continuous Run button
Abort button
Pause/Continue buttonExecution Highlighting button
Step Into button
Step Over button
Step Out buttonWarning indicator
Enter button
Broken Run buttonFont ring
Alignment ring
Distribution ring
Resize ring
Reorder ring
Context Help ButtonAdditional Buttons on the Block Diagram Toolbar工具选板 Tools Palette工具选板 Tools PaletteLabVIEW 自动选择所需工具
在前面板和程序框图窗口出现
修改前面板和程序框图的对象
显示工具模板 select Window»Show Tools Palette
LabVIEW8.2中 查看》工具选板前面板 Front Panel − Controls Palette前面板 Front Panel − Controls Palette控件模板Controls Palette
包含常用的控件
All Controls Palette
Shows all controls程序框图Block Diagram − Functions Palette程序框图Block Diagram − Functions Palette函数模板Functions Palette
包含快速VI和常用的函数 Contains the Express VIs (interactive VIs with configurable dialog page) and the most commonly used functionsAll Functions Palette
Shows all functions模板工具Palette Tools模板工具Palette Tools图形化Graphical,浮动模板 floating palettes
可以把子模板放在最上面Subpalettes can be converted to floating palettes
可以改变模板的显示方式Use Palette Options to change palette view from Express to Advanced
SearchPalette Options大头针Up to Owning
Palette查找Searching for Controls, VIs, and Functions查找Searching for Controls, VIs, and Functions可以查找控件Press the search button to perform text searches of the palettes
可以直接把查找到的控件放在框图中,或者打开控件所属的模板Click and drag an item from the search window to the block diagram or double-click an item to open the owning palette定制Customize Control & Function Palette定制Customize Control & Function PaletteKeep vi.lib in the LabVIEW 7.0 directory
Place items in user.lib or instr.lib to have them appear in the Controls and Functions palettesPrograms» National Instruments»LabVIEW 7.0前面板
设计
领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计
---程序框图设计----调试前面板设计---程序框图设计----调试前面板设计包括输入和输出两个部分
获得输入的方法有以下几种:
从设备获取
从文件直接读取
从输入控件读取
输出数据的方法有以下几种:
输出到显示控件
记录到文件
输出到设备A.前面板设计-标签/标
题
快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题
A.前面板设计-标签/标题 标签-短描述
标题-长描述
标题不会在程序框图中出现A.前面板设计-颜色使用技巧A.前面板设计-颜色使用技巧以灰色配置开始
选择一种灰度或两种稍有不同的灰度
尽可能少用高亮色,高亮色一般只用于一些重要的设置,如图表、中止按钮、或者滑动杆上的滑块A.前面板设计-间隔和对齐A.前面板设计-间隔和对齐A.前面板设计-文本和字体A.前面板设计-文本和字体杂乱无章的应用范例:A.前面板设计-选项卡控件A.前面板设计-选项卡控件选项卡控件用于将前面板的输入控件和显示控件重叠放置在一个较小的区域内A.前面板设计-修饰A.前面板设计-修饰使用修饰控件,如方框、线条、箭头等,来组合或分隔前面板上的对象
这些对象仅作修饰之用创建前面板Creating a VI Front PanelBuild the front panel with controls (inputs) and indicators (outputs)Numeric
Control Numeric
Indicator Owned Labels
Increment
ButtonsBoolean
Control Boolean
Indicator 创建前面板Creating a VI Front Panel 快捷菜单
Shortcut Menus for Front Panel Objects 快捷菜单
Shortcut Menus for Front Panel ObjectsRight-click the label to access its shortcut menuRight-click the digital display to access its shortcut menu 属性页Property Page属性页Property Page每个控件有属性页,不同控件属性不同
Right-click a control or indicator on the front panel and select Properties from the shortcut menu to access the property dialog box for that objectB创建框图程序 Creating a VI Block DiagramNodes节点Wires连线Control
Terminals端点 Block DiagramFront PanelIndicator
TerminalsB创建框图程序 Creating a VI Block Diagram节点 Express VIs, VIs and Functions节点 Express VIs, VIs and FunctionsExpress VIs: interactive VIs with configurable dialog page
Standard VIs: modularized VIs customized by wiring
Functions: fundamental operating elements of LabVIEW; no front panel or block diagram节点 Block Diagram Nodes节点 Block Diagram NodesIcon Expandable Node Expanded Node Function Generator VI
同一个VI有三种形式显示
黄色表示
标准
excel标准偏差excel标准偏差函数exl标准差函数国标检验抽样标准表免费下载红头文件格式标准下载
VI
蓝色表示快速VI端点 Block Diagram Terminals端点 Block Diagram Terminals端点是前面板和框图程序交换信息的端口
可理解为传统仪器的接线柱
端点:文本语言中的参数和常数
右击可改变显示方式
包括
控件端点
节点端点
结构端点
常数连线 Wiring the Block Diagram 连线 Wiring the Block Diagram ScalarNumericBooleanString2D Array1D ArrayDynamic连线技术 Wiring Techniques 连线技术 Wiring Techniques Hot Spot自动连线Automatic Wiring
Use Context Help Window when wiring
Right-click wire and select Clean Up Wire
自动连线路径Automatic wire routing
Right-click terminals and select Visible Items»TerminalsView the terminal connections to a functionB.数据类型-接线端B.数据类型-接线端接线端直观地体现了其传递的数据类型B.数据类型-数值型 B.数据类型-数值型 数值数据类型用来表示各种 不同类型的数字
右键单击输入控件、显示控件或常量并从快捷菜单中选择表示法即可改变数字的表示类型B.数据类型-布尔型 B.数据类型-布尔型 机械动作是布尔型控件的指定行为
在LabVIEW中,用绿色代表布尔数据类型 B.数据类型-字符串 B.数据类型-字符串 可显示的或不可显示的 ASCII字符序列
在前面板上,字符串以表格、 文本输入框和标签的形式出现
从快捷菜单中改变显示类型:
正常显示、‘/’代码显示、十六进制显示和密码显示
在程序框图上,用字符串函数来编辑和操作字符串
在LabVIEW中,用粉红色代表字符串数据类型 B.数据类型-枚举型 B.数据类型-枚举型 一个枚举数可以 代表一对数值, 如一个字符串和 一个数值型数字, 而枚举数又可作 为一组数值中的 一个数值B.数据类型-枚举型 B.数据类型-枚举型 枚举数:枚举型输入 控件、枚举型常量或 枚举型显示控件
枚举数非常有用,因为在程序框 图上处理数字要比处理字符串简 单得多B.数据类型-动态数据类型 B.数据类型-动态数据类型 动态数据类型用以保存由ExpressVI所产生或采集的信息
非Express VIs不能接收动态数据类型
如需使用内置VI或函数来分析或处理包含有动态数据类型的数据,必须先进行类型转换
当有连线时,数值、波形或布尔数据的显示控件或输入端可以自动地转换动态数据类型
在LabVIEW中,用深蓝色代表动态数据类型C.代码说明-前面板C.代码说明-前面板提示框
说明
VI属性
良好的设计风格C.代码说明-命名C.代码说明-命名用一个合理的起描述作用的名称给输入控件和显示控件命名可以增强前面板的可用性C.代码说明-程序框图C.代码说明-程序框图用程序框图说明来:
描述算法
说明连线间的数据内容
使用标签工具或从函数选板上 放置一个自由标签数据流编程Dataflow Programming执行顺序是数据流
Block diagram executes dependent on the flow of data; block diagram does NOT execute left to right
当节点上所有的输入都有值的时侯节点开始运行Node executes when data is available to ALL input terminals
节点运行后输出到各个端点Nodes supply data to all output terminals when done数据流编程Dataflow Programming调试技术Debugging Techniques调试技术Debugging Techniques查找错误Finding Errors
Click on broken Run button. A window showing the error appears
高亮运行Execution Highlighting
Click on Execution Highlighting button; data flow is animated using bubbles. Values are displayed on wires.错误连线错误连线调试技术Debugging Techniques调试技术Debugging TechniquesProbe
Right-click on wire and select probe and it shows data as it flows through the wire segment
Breakpoints
Right-click on wire and select Set Breakpoint; pause execution at the breakpoint.
Conditional Probe
Combination of a breakpoint and a probe. Right-click on wire and select custom probe.调试技术Debugging Techniques调试技术Debugging TechniquesStep Into, Over, and Out buttons for Single SteppingClick on Step Into button to enable single stepping
Once Single Stepping has begun, the button steps into nodes
Click on Step Over button to enable single stepping
or to step over nodes
Click on Step Out button to step out of nodes对象的基本功能信息帮助 Context Help对象的基本功能信息帮助 Context HelpTo display the Context Help window, select Help»Show Context Help, press the
keys, or press the Show Context Help Window button in the toolbar
Move cursor over object to display help
Connections: Required – bold Recommended – normal Optional - dimmed
Simple/Detailed Context Help Lock Help More HelpLabVIEW HelpLabVIEW HelpClick the More Help button in the Context Help window
Select Help»VI, Function, & How-To Help
Click the sentence Click here for more help in the Context Help window.
LabVIEW帮助资源丰富NI Example FinderNI Example FinderTo find an example, select Help»Find Examples
查找范例
Web-integrated
Search by keyword, example type, hardware type, etc.
通过关键词、例子类型、硬件类型来查找例子小结小结1个VI包括三部分 — 前面板, 框图程序, 图标/连接端口
前面板:用户界面
框图程序:可执行的代码
框图程序包括:节点nodes(实现程序功能), 端口terminals(可理解为传统仪器面板的每个元件的接线端), 连线wires(数据流向)
浮动模板Floating Palettes: 工具Tools Palette, 控件Controls Palette (only when Front Panel Window is active), 功能Functions Palette (only when Block Diagram Window is active)
帮助 including the Context Help Window and LabVIEW Help小结小结前面板包含控件Place controls (inputs) and indicators (outputs) in the front panel window
操作工具对对象操作Use the Operating tool to manipulate panel objects. Use the Positioning tool to select, move, and resize panel objects. Use the Wiring tool to connect diagram objects
控制比指示的边界粗Control terminals have thicker borders than indicator terminals
前面板对象有属性页和快捷菜单All front panel objects have property pages and shortcut menus
连线控制数据流 Wiring is the mechanism to control dataflow and produce LabVIEW programs
中断的箭头表明程序不可执行Broken Run arrow means a nonexecutable VI
其他调试工具:设置断点、高亮、单步执行Various debugging tools and options available such as setting probes and breakpoints, execution highlighting, and single stepping提示 Tips提示 Tips• 快捷键 Common keyboard shortcuts
工具模板Access Tools Palette with -right-click
工具属性 Tools»Options selection — set preferences in LabVIEW
VI属性 VI Properties (File menu)
Windows Sun Linux MacOS
<¨-R> Run a VI
<¨-F> Find object
<¨-H> Activate Context Help window
<¨-B> Remove all broken wires
<¨-W> Close the active window
<¨-E> Toggle btwn Diagram/Panel Window3.2
模块化编程Modular Programming3.2
模块化编程Modular ProgrammingTOPICS
什么是模块化? 子VI SubVIs
图标和连接端口 Icon and Connector Pane
如何调用子VI Using SubVIs
如何创建子VI Creating a SubVI from sections of a VI层次 LabVIEW Hierarchy层次 LabVIEW HierarchySubVIA.什么是模块化?*A.什么是模块化?模块化定义了一个程序所能包含的不同模块的范围,从而将一个模块的改变对其它模块造成的影响控制在最小范围之内
LabVIEW中的模块称为子VIA.什么是模块化?- 子VI*A.什么是模块化?- 子VI当一个VI应用在其它VI中,则称为子VI
子VI相当于文本编程语言中的子程序
在前面板窗口和程序框图窗口的右上角都可以看到该VI的图标
该图标与将VI放置在程序框图中时所显示的图标相同A.什么是模块化?- 子VI*A.什么是模块化?- 子VIA.什么是模块化?- 子VI*A.什么是模块化?- 子VIA.什么是模块化?- 子VI*A.什么是模块化?- 子VIB.图标和连线板*B.图标和连线板创建VI后,请设置图标和连线板,以便该VI作为子VI在其它VI中调用
图标和连线板相当于文本编程语言中的函数原型
每个VI前面板和程序框图窗口的右上角都有一个图标
图标是VI的图形化表示
如将VI当作子VI调用,程序框图上将显示该子VI的图标B.图标和连线板-创建图标*B.图标和连线板-创建图标右键单击前面板窗口或程序框图窗口右上角的图标并选择编辑图标,或双击图标可创建自定义图标
也可以从文件系统的任何地方拖动一个图形并放置在图标上
关于 图表图形集VI图标 所使用的标准图形 见ni.comB.图标和连线板-设置连线板*B.图标和连线板-设置连线板右键单击前面板右上角 的图标并选择显示连线板
连线板上的每个单元格代表一个接线端
使用各个接线端分配输入和输出
右键单击连线板并从快捷菜单中选择模式可为VI选择不同的接线端模式 最多不超过28个B.图标和连线板-标准*B.图标和连线板-标准以这种连线板布局作为一个标准
顶部接线端通常为引用保留,如文件引用
底部接线端通常为错误簇保留例子:计算斜率
SubVI Example – Calculating Slope例子:计算斜率
SubVI Example – Calculating SlopeA VI within another VI is called a subVI
To use a VI as a subVI, create an icon and a connector pane after building the front panel and block diagram创建图标Creating the Icon创建图标Creating the IconIcon: graphical representation of a VI
Right-click in the icon pane (Panel or Diagram)
Always create a black and white icon创建单色图标Default IconCreate a custom icon创建连接端口Creating the Connector创建连接端口Creating the ConnectorRight-click the icon
(Front Panel only)创建连接端口Creating the Connector - continued创建连接端口Creating the Connector - continuedClick with wiring tool连接端口 方框 The Connector Pane连接端口 方框 The Connector PaneTerminal colors match the data types to which they are connected
Click the terminal to see its associated front panel objectC.使用子VI*C.使用子VI如需将子VI放置在程序框图中
单击函数选板上的选择VI按钮
找到需要作为子VI使用的VI
双击该VI将它放置在程序框图中
将一个打开的VI放置在另一打开的VI的程序框图上
单击要用作子VI的VI图标
将这个图标拖到另一个VI的程序框图中C.使用子VI-接线端设置*C.使用子VI-接线端设置粗体 :必需的接线端
无格式:推荐的接线端
灰体:可选的接线端C.使用子VI-部分VI转换成子VI*C.使用子VI-部分VI转换成子VI将VI的一部分转换成子VI:
用定位工具在程序框图上框选出需要使用的部分
选择编辑»创建子VI调用子程 Using a VI as a SubVI调用子程 Using a VI as a SubVIAll Functions » Select a VI…
Drag icon onto target diagramHelp and Classifying TerminalsHelp and Classifying TerminalsClassify inputs and outputs:
Required — Error if no connection
Recommended — Warning if no connection
Optional — No effect if no connection小结Summary小结SummaryVis用作子VI必须具备两部分 VIs can be used as subVIs after you make the icon and connector
图标Icon created using Icon Editor
连接端口 Connector defined by choosing number of terminals
如何调用 Load subVIs using the Select a VI option in the All Functions palette or dragging the icon onto a new diagram
如何创建 Use Create SubVI feature to easily modularize the block diagram3.3 控制程序运行的结构3.3 控制程序运行的结构TOPICS
A. While 循环
B. For 循环
访问上一次的循环的数据
C. 顺序结构
D. 选择结构
A. While 循环A. While 循环LabVIEW While循环 流程图 伪码重复(代码);
直到满足某个条件;
End;
A. While 循环A. While 循环1. Select While Loop2. Enclose code to be repeated3. Drop or drag additional nodes and then wireA. While循环--选择循环条件A. While循环--选择循环条件计数接线端:返回已经执行循环的次数;从0开始计数
条件接线端:定义循环结束的条件计数接线端条件接线端A. While循环-隧道 A. While循环-隧道 隧道用于接收和输出结构中的数据
隧道会根据连入隧道的数据类型改变颜色
循环终止后,数据才会从循环中传出
数据从隧道输入循环时,只有在数据到达隧道之后循环才开始执行B. For循环For LoopsB. For循环For LoopsLabVIEW For Loop Flow Chart Pseudo CodeFor i=0 to N-1;
Excute (code; i=i+1);
End;B. For 循环 For LoopsB. For 循环 For Loops在结构子模板中
执行指定次数的框图内代码
计数端口
Count terminal
(Numerical input)Wait Until Next ms Multiple function循环端口
Iteration terminalB.For循环/While循环的比较B.For循环/While循环的比较For循环
按照设定的次数执行
可执行0次
隧道自动输出一组数据While循环
只有条件接线端接收到某一特定的值时才停止执行
至少执行一次
隧道自动输出最后一次执行的值B.For循环-数值转换B.For循环-数值转换如果将一个双精度浮点数连接到总数接线端,LabVIEW将更长位数的数值转换为32位有符号整数
For循环只能执行整数次循环B.For循环-数值转换Numeric ConversionB.For循环-数值转换Numeric Conversion数据缺省是 double-precision (8 bytes) 或 long integer (4 bytes)
LabVIEW 自动转换不同的数据类型
计数端口总是强制转换成长整数
端口上的灰点表示数据转换数据转换Numeric Conversion数据转换Numeric ConversionLabVIEW转换数据为 数据位数多的数据类型
位数相同,转换为无符号数.
改变数据类型,可以右击
控件选择
转换浮点数到整数时,转换为最接近的整形数,对正好在两个数之间的数,转换为接近的偶数。
For example, LabVIEW rounds 2.5 to 2 and 3.5 to 4.等待功能Wait Functions等待功能Wait FunctionsWait Until Next ms Multiple
Functions»Time & Dialog palette
等待功能Wait Functions等待功能Wait FunctionsWait (ms)
Functions»Time & Dialog palette
Time Delay
Functions»Time & Dialog palette
访问上一次循环数据-移位寄存器
Accessing Previous Loop Data – Shift Register访问上一次循环数据-移位寄存器
Accessing Previous Loop Data – Shift Register• 循环结构的左边界或右边界上
• 右击边界,选择添加移位寄存器
• 右边界端口储存执行完后的结果
• 左边界端口储存循环前的数据增加移位寄存器元素
Additional Shift Register Elements增加移位寄存器元素
Additional Shift Register ElementsLatest value
is passed to
right terminalRight-click the left terminal to add new elementsPrevious values are available at the left terminalsRight-click the border for a new shift register1 loop ago
2 loops ago
3 loops ago左边三个元素可以获得前三次循环的数据
增加移位寄存器,可以获得几个数据的前一次循环数据反馈节点Feedback Nodes反馈节点Feedback Nodes当For循环或While循环中将把一个节点的输出连接到它的输入时,连线中会自动出现反馈节点,同时自动创建了一个初始化端口
反馈节点的箭头方向表示数据流的方向。反馈节点有两个端口,输入端口在每次循环结束时将当前值存入,输出端口在每次循环开始时把上一次循环存入的结果输出。
反馈节点与移位寄存器可以互换,优点在于循环框较大时,避免较长的连线
左端口多于一个时,移位寄存器不能用反馈节点代替反馈节点Feedback Node反馈节点Feedback NodeWire from output to input to automatically create a feedback node
Place a feedback node from the Functions»Structures palette初始化移位寄存器和反馈节点
Initialized Shift Registers & Feedback Nodes初始化移位寄存器和反馈节点
Initialized Shift Registers & Feedback Nodes Run Once VI stops execution Run AgainOutput = 5Output = 5Output = 5Output = 5不初始化移位寄存器和反馈节点
Uninitialized Shift Registers & Feedback Nodes不初始化移位寄存器和反馈节点
Uninitialized Shift Registers & Feedback Nodes Run Once VI stops execution Run AgainOutput = 8Output = 4Output = 4Output = 8C. 顺序结构SequenceC. 顺序结构Sequence
框图标识符顺序框架单帧顺序结构多帧顺序结构递增按钮递减按钮D. Case结构D. Case结构
Case结构选择器端子If(条件)
{}
Else
{} 选择
器标签增量
按钮减量
按钮Switch(条件)
{case 式1:
case 式2:
Default:
}总结Summary总结SummaryWhile Loop and For Loop
时间控制 Wait Until Next ms Multiple function, the Wait (ms) function, or the Time Delay Express VI.
数据类型转换
移位寄存器和反馈节点可以传递数据
移位寄存器可以获得前几次循环的数据
顺序结构
CASE结构3.4 数组 Arrays3.4 数组 ArraysTOPICS
数组介绍 Introduction to Arrays
数组自动索引 Auto Indexing Arrays
数组函数 Array Functions
多态性 Polymorphism数组 Arrays• 相同类型数据的集合
• 一维或多维, 每一维可达2 元素
• 通过数组索引访问; 第一个元素的索引值为 031index
10-element array2D arrayFive row by seven column array of 35 elements0 1 2 3 4 5 60 1 2 34数组 Arrays数组控件 Array Controls and IndicatorsAdd Dimension for 2D arrays1. Select the Array shell from the Controls palette2. Place data object inside shell数组控件 Array Controls and Indicators创建数组常数Creating Array Constants1. Select Array Constant shell from the Array subpalette2. Place the data object in the array shell创建数组常数Creating Array Constants自动索引Auto-Indexing自动索引可以使数据累加成一个数组,或者使数组成员逐个进入循环框内
For 循环默认自动索引
While 循环默认为不能自动索引,输出最后一个数据
数据通道上右击,可选择自动索引或禁止自动索引自动索引Auto-IndexingWire becomes thickerWire remains the same sizeAuto-Indexing DisabledAuto-Indexing EnabledOnly one value (last iteration) is passed out of the loop1D Array0 1 2 3 4 5创建二维数组Creating 2D Arrays 内循环创建列
外循环创建行创建二维数组Creating 2D Arrays1D Array0 1 2 3 4 52D Array自动索引输入Auto-Index Input自动索引输入Auto-Index Input数组可以用来
设置For循环的计数
端口
循环次数等于
数组个数常用数组函数Common Array FunctionsArray SizeInitialize Array常用数组函数Common Array Functions常用数组函数Common Array FunctionsArray Subset常用数组函数Common Array Functions创建数组函数The Build Array Function创建数组函数The Build Array FunctionBuilding a higher dimension arrayConcatenate Inputs Appending an elementdefault 数组索引The Index Array Function数组索引The Index Array FunctionExtracting an ElementExtracting an Element of a RowExtracting a Row多态性Polymorphism函数输入可以是不同数据
所有的LabVIEW算术函数都是多态的Scalar + ScalarArray + ScalarCombinationResultScalarArrayArrayArray + Array
等长数组Array + Array
不等长数组Array多态性Polymorphism小结 Summary相同数据类型的集合为数组. 数组元素可以是 numeric, Boolean, path, string, waveform, and cluster data types.
数组索引从0开始, 0 to n – 1
前面板创建数组.
自动索引
For循环默认自动索引,While循环缺省禁止自动索引
多态是指函数具有不同程度的数据类型兼容能力小结 Summary3.5 簇 Clusters3.5 簇 ClustersTOPICS
簇的简介 Introduction to Clusters
簇函数 Cluster Functions
错误信息簇 Error Clusters簇Clusters簇Clusters不同数据组成的集合体
数据可以是不同类型
类似于 struct in C or a record in Pascal
元素必须都是控制或指示
可以想象成一束通讯电缆簇控件 Cluster Controls and Indicators簇控件 Cluster Controls and Indicators1. Select a Cluster shell from the Array & Cluster subpalette2. Place objects inside the shell创建簇常数 Creating Cluster Constants创建簇常数 Creating Cluster Constants1. Select Cluster Constant shell from the Cluste