Inside LabVIEW - PowerPoint PPT Presentation

About This Presentation
Title:

Inside LabVIEW

Description:

How VIs Are Compiled 'Clumps' Start of diagram: Reads controls and. constants, then. schedules Clumps 1 and 2 (for loops). Then sleeps... Completion of diagram: ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 22
Provided by: scottk72
Category:
Tags: labview | clumps | inside

less

Transcript and Presenter's Notes

Title: Inside LabVIEW


1
Inside LabVIEW
  • Steve Rogers
  • Chief Architect, LabVIEW RD
  • Wed Aug 16
  • 1015-1130 a.m., 145-300 p.m.
  • Ash (10A)

2
Inside LabVIEW Topics
  • Virtual Instrument organization
  • How VIs are compiled
  • LabVIEW execution system
  • Single threaded LabVIEW
  • Multi-threaded LabVIEW
  • LabVIEW RT remote execution system
  • What happens when indicators display
  • What happens when you call a subVI

3
The Parts of a VI
Loaded when used
Always present in memory
VI
Front panel
Block diagram
Data space
Compiled code
4
How VIs Are Compiled
5
How VIs Are Compiled Clumps
Clump 1
Top For Loop Indicator is updated Clump 0
Scheduled Sleep...
Clump 0
Clump 2
Start of diagram Reads controls and constants,
then schedules Clumps 1 and 2 (for loops). Then
sleeps...
Bottom For Loop Indicator is updated Clump 0
Scheduled Sleep...
Completion of diagram Divide nodes, display of
indicators, then VI exit.
6
The Execution System
RunQ head tail
curElem
prioritized
ebp (ds register)
VI code
VI data space
instruction instruction instruction
7
Exec() is a Loop
Sleeps on runQ when multi-threaded or if in .dll
entry point if top VI not finished
curElem Dequeue(runQ) ebp curElem DS res
call curElem PC if(res) curElem PC
res Enqueue(runQ, curElem) curElem NULL
rotates the runQ cooperative multi-tasking
Cooperatively returns when in UI thread (at top
level)
8
Single Threaded LabVIEW
Computer
Thread
Co-routines
User interface loop
Exec( )
9
Multi-Threaded LabVIEW
Computer
Messages
Thread
UI Loop Co-routines Exec()
10
LabVIEW RT Target System
RT computer
Messages
Thread
Communication Loop Co-routines Exec()
TCP/IP
11
LabVIEW RT Development System
Host LabVIEW RT computer
LabVIEW RT Target computer
TCP/IP
Thread
Thread User Interface Loop Communication to
target possibly Exec()
-shared memory -Ethernet -other
Communi-cation to host or client Exec()
12
LabVIEW RT Deployed System
Client LabVIEW computer
LabVIEW RT Target computer
TCP/IP
Thread
Thread
Commun-ication to host or client Exec()
UI Loop and Commun-ications Exec()
-shared memory -Ethernet -other
13
LVRT.dll runs VIs as .dll procs
Computer
Messages
Client program
Vi()
LVRT.dll
Thread
Exec( )
LoadLibrary(vilibname.dll) vi
GetProcAddress(viname) (vi)(arg1,arg2,arg3)
UI Thread Exec()
14
Display to an indicator (single thread)
Operate/display data
Execution data
Running code copies execution data to the
operate/display, and calls the display function
for the indicator
15
Display to an Indicator (multi-thread)
UI thread
Execution thread
Operate/display data
Execution data
Running code acquires mutex, copies execution
data to transfer data, releases mutex and posts
message to UI thread.
UI thread receives message, acquires mutex,
copies transfer data to operate/display data,
releases mutex and displays indicator
Transfer data Mutex X dirty flag X update
flag
Message queue
16
SubVI Calls (SubVI Not Busy)
Caller data space
Callee data space
Mutex curCaller NULL waitQ empty
Execution system curElem
17
SubVI Calls (SubVI Running Caller)
Caller data space
Callee data space
Mutex curCaller waitQ empty
Execution system curElem
18
SubVI Calls (SubVI Is Busy)
Caller data space
Callee data space
other caller
Mutex curCaller waitQ
Execution system curElem
19
SubVI Runs
Caller data space
Callee data space
other caller(s)
Mutex curCaller waitQ
Execution system curElem
20
SubVI Returns (No Waiting Second Caller)
Caller data space
Callee data space
Mutex curCaller NULL waitQ empty
Execution system curElem
21
SubVI Returns (With Waiting Second Caller)
Caller data space
Callee data space
Mutex curCaller waitQ
next caller
Execution system curElem
Write a Comment
User Comments (0)
About PowerShow.com