Sunteți pe pagina 1din 18

LabVIEW programming, part II

LabVIEW data type: numeric, Boolean,


string and waveform
WHILE and FOR loops, CASE structures,
SEQUENCE structures, formula nodes
Express VI

BME313 Virtual Bioinstrumentation

Instructor: Wei

LabVIEW Data Type


Numeric data type:
Integer
Floating point number

String
Boolean
Waveform type

BME313 Virtual Bioinstrumentation

Instructor: Wei

Numeric Data Type


Integer

Signed Integer
32-bit (I32): from -2147483648 to 2147483647
16-bit (I16): from -32768 to 32767
8-bit (I8): from -128 to 127

Unsigned Integer
32-bit (U32): from 0 to 4,294,967,295
16-bit (U16): from 0 to 65536
8-bit (U8): from 0 to 256
BME313 Virtual Bioinstrumentation

Instructor: Wei

Numeric Data Type


Floating-pointing Number

Floating-point number:
Extended precision [EXT]: 1.19e+4932 to 1.19e+4932
Double precision [DBL]: 1.79e+308 to 1.79e+308
Single precision [SGL]: 3.40e+38 to 3.40e+38

Complex floating-point number:


Complex floating-point number has the equivalent precision
representation as floating-point number. The only difference is
that complex number has real and imaginary parts.

BME313 Virtual Bioinstrumentation

Instructor: Wei

Demo of the Numeric Data Type

Numerical control
Numerical indicator
Numerical representation
Numerical range
Numerical format and precision
Numerical functions

BME313 Virtual Bioinstrumentation

Instructor: Wei

Strings Data Type


A string is a sequence of displayable or
nondisplayable characters (ASCII)
Many uses displaying messages, instrument
control, file I/O
LabVIEW has large collection of functions that
deal with strings

BME313 Virtual Bioinstrumentation

Instructor: Wei

Demo of the String Data Type

String control
String indicator
String display
String functions

BME313 Virtual Bioinstrumentation

Instructor: Wei

Boolean Data Type


Boolean data has two values: TRUE and
FALSE.
Button on front panel is a Boolean control.
LED on front panel is a Boolean indicator.
Boolean has many operation modes.

BME313 Virtual Bioinstrumentation

Instructor: Wei

Demo of the Boolean Data Type

Button control
LED indicator
Operation modes of button
Boolean function

BME313 Virtual Bioinstrumentation

Instructor: Wei

Waveform Data Type


The waveform data are the values that
represent the waveform. An array of any
numeric data type can represent analog
waveform data.
It also contains the start time of the
waveform and the time interval of data
points in the waveform.
There are functions for waveform
manipulation.
BME313 Virtual Bioinstrumentation

Instructor: Wei

Demo of the Waveform Data Type


The major components of waveform
Waveform functions

BME313 Virtual Bioinstrumentation

Instructor: Wei

WHILE Loop
While Loop:
Have Iteration Terminal
Always Run at least Once
Run According to
Conditional Terminal

BME313 Virtual Bioinstrumentation

Instructor: Wei

FOR Loop
For Loop:
Have Iteration Terminal
Run According to input N of
count
Terminal Shift registers

BME313 Virtual Bioinstrumentation

Instructor: Wei

CASE Structure
CASE structure has two or more subdiagrams.
Only one subdiagram to execute at a time based
on the value of the selector.
Each subdiagran must provide output value for
the CASE structure.

BME313 Virtual Bioinstrumentation

Instructor: Wei

Sequence Structure
A sequence structure contains one or more subdiagrams,
or frames, that execute in sequential order.
Flat Sequence structure and stacked sequence structure

BME313 Virtual Bioinstrumentation

Instructor: Wei

Formula Nodes
Implement complicated equations
Variables created at border
Variable names are case sensitive
Each statement must terminate with a semicolon (;)
Context Help Window shows available functions
Note semicolon

BME313 Virtual Bioinstrumentation

Instructor: Wei

Express VI
Express VIs are function nodes that
require minimal wiring because you
configure them with dialog boxes.
Express VIs appear on the block diagram
as expandable nodes with icons
surrounded by a blue field.

BME313 Virtual Bioinstrumentation

Instructor: Wei

Homework Assignment
Write a LabVIEW program that can calculate the
sum of numbers from 1 to N where N is an input
integer.
n

i
i 1

1. Use FOR loop structure.


2. Use WHILE loop structure.
Due on Wednesday 9/29/2004. Submitted through email.
Use your name as part of the filenames for identification.
BME313 Virtual Bioinstrumentation

Instructor: Wei

S-ar putea să vă placă și