1 / 17

Inside LabVIEW

Inside LabVIEW. Steve Rogers LabVIEW Software Engineer Wed, 10:15a, 12:45p, and 3:30p Mulberry (10B). Inside LabVIEW – Topics. Virtual instrument organization How VIs are compiled LabVIEWs Execution system Single-threaded LabVIEW Multithreaded LabVIEW LabVIEW RTs remote execution system

Download Presentation

Inside LabVIEW

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Inside LabVIEW Steve Rogers LabVIEW Software Engineer Wed, 10:15a, 12:45p, and 3:30p Mulberry (10B)

  2. Inside LabVIEW – Topics • Virtual instrument organization • How VIs are compiled • LabVIEWs Execution system • Single-threaded LabVIEW • Multithreaded LabVIEW • LabVIEW RTs remote execution system • What happens when indicators display • What happens when a subVI is called

  3. The Parts of a VI Always present in memory Loaded when used VI Front Panel Block Diagram Data Space Compiled Code

  4. VIs are compiled An Example Diagram

  5. VIs are compiled – “Clumps” • Top for loop • Update indicator • Schedule Clump 0 • Sleep... Clump 1 Clump 0 Clump 2 • Bottom for loop • Updated indicator • Schedule Clump 0 • Sleep... • Start of diagram • Read controls • Read constants • Schedule Clumps 1 & 2 (for loops) • Sleep... • Completion of diagram • Execute divide nodes • Display indicators • Exit VI

  6. The Execution System QElement DS PC QElement DS PC QElement DS PC QElement DS PC QElement DSPC “curElem” “RunQ” head tail prioritized ebp (ds register) VI Code VI Data Space instruction instruction instruction

  7. Exec() is a Loop Sleeps on runQ when multithreaded curElem = Dequeue(runQ) ebp = curElem DS res = call curElem PC if(res) curElem PC = res Enqueue(runQ, curElem) curElem = NULL “Rotates” the runQ cooperative multitasking Cooperatively returns when in UI thread

  8. Single-Threaded LabVIEW Computer Thread Co-Routines User Interface Loop Exec( )

  9. Multithreaded LabVIEW Thread Thread Thread Thread Exec( ) Exec( ) Exec( ) Exec( ) Computer Messages Thread UI Loop co-routines Exec()

  10. LabVIEW RT – Target System Thread Thread Thread Thread Exec( ) Exec( ) Exec( ) Exec( ) RT Computer Messages Thread Communication Loop Co-routines Exec() TCP/IP

  11. LabVIEW RT – Development System Thread Thread Thread Thread Exec() Exec() Exec() Exec() Host LabVIEW RT Computer LabVIEW RT Target Computer TCP/IP Thread Thread User Interface Loop Communication to target possibly Exec() -shared memory -Ethernet -other Communication to host or client Exec()

  12. LabVIEW RT – Deployed System Thread Thread Thread Thread Thread Thread Thread Thread Exec() Exec() Exec() Exec() Exec() Exec() Exec() Exec() Client LabVIEW Computer LabVIEW RT Target Computer TCP/IP -Shared memory -Ethernet -Other Thread Thread UI Loop and Comm- unications Exec() Communication to host or client Exec()

  13. Display to an Indicator (Single Thread) Execution Data Operate/ Display Data Running code copies execution data to the operate/display, and calls the display function for the indicator.

  14. Display to an Indicator (Multithread) Execution Thread UI Thread Execution Data Operate/ Display 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 “dirty flag” “update flag” Message queue

  15. SubVI Calls (SubVI Not Busy) “top level” QElement DS PC QElement DS PC paramPtr Params param0 param1 Caller Data Space Callee Data Space Mutex curElem: NULL waitQ: empty Execution System – curElem

  16. SubVI Calls (SubVI Running Caller) “top level” QElement DS PC QElement DS PC paramPtr Params param0 param1 Caller data space Callee data space Mutex curElem waitQ: empty Execution System – curElem

  17. SubVI Calls (SubVI is Busy) “top level” QElement DS PC QElement DS PC paramPtr Params param0 param1 Caller data space Callee data space other caller Mutex curElem waitQ Execution System – curElem

More Related