labview and g graphical programming language by: ramtin raji kermani

17
LabVIEW and “G” Graphical Programming Language By: Ramtin Raji Kermani

Upload: kiersten-milner

Post on 31-Mar-2015

240 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

LabVIEWand “G” Graphical Programming Language

By: Ramtin Raji Kermani

Page 2: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

What is LabVIEW?

LabVIEW (Laboratory of Virtual Instrument Engineering Workbench) is a development environment based on graphical programming.

Page 3: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

What is LabVIEW?

LabVIEW relies on graphical symbols rather than textual language to describe programming actions

The principle of dataflow, in which functions execute only after receiving the necessary data, governs execution in a straightforward manner.

Page 4: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

LabVIEW features

• Product of National Instruments (NI)

• Software for Virtual Instrumentation

• Data Acquisition (DAQ)

• Graphical Programming

• Data Storage and Analysis for wide Range of applications

Page 5: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

LabVIEW features

LabVIEW programs are called:Virtual Instruments (VIs) because their appearence and operation imitate actual instruments.

However, they are analogous to main programs, functions and subroutines from popular language like C, Fortran, Pascal, …

Page 6: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Virtual Instruments

1- The front panel:

an interactive user interface of a VI, so named because it can simulates the front panel of a physical instrument.

2- The block (or wiring) diagram:It is the VI’s source code, constructed in LabVIEW’s graphical programming language, G. It is the actualexecutable program.

Subroutine in the block diagram of VI.

3- Icon/connector

Page 7: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

VIs

Front Panel User Interface (UI)

Controls = Inputs Indicators = Outputs

Block Diagram Graphical Code

Data travels on wires from

controls through functions to indicators Blocks execute by Dataflow

Page 8: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Front Panel

Page 9: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Front Panel

a

A combination of controls and indicators.

Controls = Inputs from the user = Source Terminals

Indicators = Outputs to the user = Destinations

Page 10: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Block Diagram

Page 11: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Terminals

When you place a control

(or indicator) on the

FRONT PANEL

LabVIEW automatically creates a correspondingcontrol (or indicator) terminal on the BLOCKDIAGRAM

Page 12: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Control or Indicator Terminal?

Control terminals have

thick borders

Indicator terminals have

thin borders

Page 13: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Nodes

Node is just a fancy word for a program execution element –

Nodes are analogous to statements, operators, functions and

subroutines in standard programming language:

•The add and subtract functions represent one type of node.

•A structure is an other type of node. Structures can execute code repeatedly or conditionally, similar to loops and case statements in traditional programming languages.

•LabVIEW also has special nodes, called formula nodes, which are useful for evaluating mathematical formulas or expressions.

Page 14: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Control or Indicator Terminal?

Page 15: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Data Types

Each wire has different style or color, depending on the data

type that flows through the wire:

Scalar1D array2D arrayColor

Floating-point number

orange

Integer number

blue

Booleangreen

Stringpink

Page 16: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

Type Checking

If you connect more than

one source or no source

at all to a wire,

LabVIEW DISAGREES with what you’re doing, and thewire will appear broken

Page 17: LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani

ACTION !

Let get into Action…