FIGURE 1.2

to run. Elements can be primitive operators such as addition, or more complex such as a subVI. If LabVIEW successfully constructs all the wire tables, you are presented a solid arrow indicating that the VIs can be executed. If the wire table cannot be created, then a broken arrow is presented for the VIs with a problem, and also for each VI loaded in memory that requires that VI for execution. LabVIEW runs in several subsystems, which will be described throughout this book. All that we need to understand now is that the main execution subsystem compiles diagrams while you write them. This allows programmers to write code and test it without needing to wait for a compiling process, and programmers do not need to worry about execution speed because the language is not interpreted.

The wire diagrams that are constructed do not define an order in which elements are executed. This is an important concept for advanced programmers to understand. LabVIEW is a dataflow-based language, which means that elements will be executed in a somewhat arbitrary order. LabVIEW does not guarantee which order a series of elements is executed in if they are not dependent on each other. A process called arbitrary interleaving is used to determine the order elements are executed in. You may force an order of execution by requiring that elements require output from another element before execution. This is a fairly common practice, and most programmers do not recognize that they are forcing the order of execution. When programming, it will become obvious that some operations must take place before others can. It is the programmer’s responsibility to provide a mechanism to force the order of execution in the code design.

1.1.3 EXECUTING VIS

A LabVIEW program is executed by pressing the arrow or the Run button located in the palette along the top of the window. While the VI is executing, the Run button changes to a black color as depicted in Figure 1.3. Note that not all of the items in the palette are displayed during execution of a VI. As you proceed to the right along

 FIGURE 1.3

the palette, you will find the Continuous Run, Stop, and Pause buttons. If you compare Figures 1.1 and 1.3, the last three buttons in Figure 1.1 disappear in Figure 1.3. These buttons are used for alignment of objects on the panel or diagram, and are not available while a program is running. VIs are normally run from the front panel; however, they can also be executed from the block diagram. This allows the programmer to run the program and utilize some of the other tools that are available for debugging purposes.

If the Run button appears as a broken arrow, this indicates that the LabVIEW program or VI cannot compile because of programming errors. When all of the errors are fixed, the broken Run button will be substituted by the regular Run button. LabVIEW has successfully compiled the diagram. While editing or creating a VI, you may notice that the palette displays the broken Run button. If you continue to see this after editing is completed, press the button to determine the cause of the errors. An Error List window will appear displaying all of the errors that must be fixed before the VI can compile. Debugging techniques are discussed further in Chapter 6, which covers exception handling.

The palette contains four additional buttons on the block diagram that are not available from the front panel. These are typically used for debugging an application.

The button with the lightbulb is for Execution Highlighting and the three following it are used for stepping through the code. Figure 1.4 shows the code diagram with Execution Highlighting activated. You can see bubbles that represent the data flowing along the wire, from one block to the next. You can step through the code as needed when the Pause button is used in conjunction with Execution Highlighting. As stated earlier, debugging techniques will be covered in Chapter 6.

上一篇:ADAMS起落架系统英文文献和中文翻译
下一篇:LED前照灯的设计英文文献和中文翻译

开关电源水冷却系统英文文献和中文翻译

减数分裂和基因重组英文文献和中文翻译

太阳能最大功率点追踪和...

移动码头的泊位分配问题英文文献和中文翻译

虚拟船舶装配集成建模方...

中学生科学探究中对等论...

车辆路面相互作用动力学英文文献和中文翻译

淮安市老漂族心理与休闲体育现状的研究

组态王文献综述

小学《道德与法治》学习心得体会

林业机械作业中的安全性问题【2230字】

浅谈动画短片《天降好运》中的剧本创作

适合宝妈开的实体店,适...

大学生就业方向与专业关系的研究

人事管理系统开题报告

弹道修正弹实测弹道气象数据使用方法研究

紫陵阁