EEN-625 Virtual Instrumentation: Dr. P. Sumathi Associate Professor Department of Electrical Engineering IIT Roorkee
EEN-625 Virtual Instrumentation: Dr. P. Sumathi Associate Professor Department of Electrical Engineering IIT Roorkee
EEN-625
Virtual Instrumentation
Dr. P. Sumathi
Associate Professor
Department of Electrical Engineering
IIT Roorkee
Synchronization
2
State machines in LabVIEW
States describe the status of a piece of programming and are subject to change
over time.
states are “waiting for command,” “processing command,” and “generating report.”
The “waiting for command” state indicates that the application is idle until the
remote control issues a command to take action.
Events are occurrences in time that have significant meaning to the piece of code
controlled by the state machine.
Events that may occur when the code is executing are “command received,” “abort
received,” “error occurred,” and “status requested.”
Actions are responses to events, which may or may not impact external code to the
state machine.
The state machine determines which actions need to be taken when a given event
occurs.
3
A state machine, in simple terms, is a case structure inside a While loop.
The enumerated type control is basically a list of text values associated with a
numeric value.
4
Formula block
Matrix operations
The MathScript Node implements similar functions but with the additional
functionality of a full .m file compiler .
5
Variables
6
1. Loop 1 reads the variable
2. Loop 2 reads the variable
3. Loop 1 changes the value it read
4. Loop 2 changes the value it read
5. Loop 1 writes result to the variable
6. Loop 2 writes result to the variable
Race condition
7
More on structures
For loop
While loop
Case structure
8
The Flat Sequence structure, shown as follows, displays all the frames at once and
executes the frames from left to right and when all data values wired to a frame are
available, until the last frame executes. The data values leave each frame as the frame
finishes executing.
Use the Flat Sequence structure to avoid using sequence locals and to better document
the block diagram. When you add or delete frames in a Flat Sequence structure, the
structure resizes automatically.
9
The Stacked Sequence structure, shown as follows, stacks each frame so you see
only one frame at a time and executes frame 0, then frame 1, and so on until the
last frame executes.
The Stacked Sequence structure returns data only after the last frame executes.
10
Barnsley’s Fern “fractals everywhere”
Barnsley, M. Fractals Everywhere, 2nd ed., Boston, MA, Academic Press, 1993, pp. 86,
90, 102 and Plate 2,193.
As reported by Weisstein, Eric W., “Barnsley’s Fern.” From MathWorld—A Wolfram
Web Resource,
http://mathworld.wolfram.com/BarnsleysFern.html, accessed October 15, 2009.
12
Digital Filters
An exponential filter uses the current signal value and the previous signal
value to reduce signal noise.
The equation is
xfiltered = (1 – a) xprevious + a xcurrent
13
Moving average filter
LUT
14
15