Вы находитесь на странице: 1из 29

Points

Programming languages are developed by human

beings thats why every thing has its purpose. Knowing the problem and the tech developed to overcome is more important than knowing the syntax of a particular programming language. Programming language like any spoken language need practicing to meet perfection.

Introduction to LabVIEW programming


LabVIEW (Laboratory Virtual Instrument Engineering

Workbench) is a graphically-based programming language.


Its graphical nature makes it ideal for test and

measurement automation, instrument control, data acquisition, and data analysis applications.
Its a graphical programming that means Programmers use

a graphical approach to develop their apps and it isnt necessary that the final product works on a graphical operated machine target

C++, LabVIEW analogy


In C++ [cin] and [cout], In labview [controller] and

[indecator]. In C++ [function] to perform a specific operation, In labview [block] or custom block [subVI] more like Sub system in Matlab. In C++ you make think in your code at your early times as mathematical statements, but in labview its more helpful that you think of it as electrical wiring and signals.

VIs contain two main components the front panel, the block diagram

You build the front panel with controls and indicators, which are the interactive input and output terminals of the VI.

Block diagram is the place where you connect your indicators and controllers To its proper functional block(s) to manipulate data and perform any needed Operation(s). * Each indicator and controller has its terminal representation in the block Diagram but not any of the functional block has.

Controls Palette Use the Controls palette to place controls and indicators on the front panel. The Controls palette is available only on the front panel. Select WindowShow Controls Palette or right-click the front panel workspace to display the Controls palette.

Functions Palette
Use the Functions palette to build the block diagram. The Functions palette is available only on the block diagram. Select WindowShow Functions Palette or right-click the block diagram workspace to display the Functions palette

Front Panel Toolbar


Use the toolbar buttons to run and edit a VI. The following toolbar appears on the front panel.

Click the Run button to run the VI. While the VI runs, the button changes to the following if the VI is a high-level VI. The Run button often appears broken, shown at left, when you create or edit a VI. This button indicates that the VI is broken and cannot run. Click this button to display the Error list window, which lists all errors. Click the Run Continuously button to run the VI until you abort or pause it. You also can click the button again to disable continuous running. While the VI runs, the Abort Execution button appears. Click this button to stop the VI immediately.

Click the Pause button to pause a running VI. When you click the Pause button, LabVIEW highlights on the block diagram the location where you paused execution. Click the button again to continue running the VI. Select the Text Settings pull-down menu to change the font settings for the VI, including size, style, and color. Select The Align Objects pull-down menu to align objects along axes, including vertical, top edge, left, and so on. Select the Distribute Objects pull-down menu to space objects evenly, including gaps, compression, and so on. Select the Reorder pull-down menu when you have objects that overlap each other and you want to define which one is in front or back of another. Select one of the objects with the Positioning tool and then select from Move Forward, Move Backward, Move To Front, and Move To Back.

Block Diagram Toolbar


When you run a VI, buttons appear on the block diagram toolbar that you can use to debug the VI. The following toolbar appears on the block diagram.

Click the Highlight Execution button to see the flow of data through the block diagram. Click the button again to disable execution highlighting. Click the Step Into button to single-step into a loop, subVI, and so on. Single-stepping through a VI steps through the VI node to node. Each node blinks to denote when it is ready to execute. By stepping into the node, you are ready to single-step inside the node. Click the Step Over button to step over a loop, subVI, and so on. By stepping over the node, you execute the node without singlestepping through the node. Click the Step Out button to step out of a loop, subVI, and so on. By stepping out of a node, you complete single-stepping through the node and go to the next node. The Warning button appears when there is a potential problem with the block diagram, but it does not stop the VI from running. You can enable the Warning button by selecting ToolsOptions and selecting Debugging from the top pull-down menu.

LabVIEW DATA TYPES

Numeric control and indicator


Any Numeric control or indicator can Be represented as: Int 8 16 32 64 bits Float or double Real or complex

If any operation on two operand with Different data size the result will be represented by the longer one.

Boolean
LabVIEW stores Boolean data as 8-bit values. If the 8-bit value is zero, the Boolean value is FALSE.

Any nonzero value represents TRUE.


Boolean values also have a mechanical action associated with them.

The two major actions are latch and switch. Latch action is similar to a doorbell, whereas switch action is similar to a light switch. You can also define when the switch or latch occurs: when pressed, when released, or until released.

String
A string is a sequence of displayable or non displayable ASCII characters

Вам также может понравиться