Presentation is loading. Please wait.

Presentation is loading. Please wait.

National Instruments Leadership Seminar

Similar presentations


Presentation on theme: "National Instruments Leadership Seminar"— Presentation transcript:

1 National Instruments Leadership Seminar
April, 2002 The Art of Creating Dynamic, Flexible LabVIEW Applications Norman Kirchner CLD, CPI – Texas Instruments Gerald Albertini CLD – Texas Instruments August 10, 2006 As LabVIEW has grown into a much more dynamic programming language, so have the demands from the end-users for more dynamic programs and displays. This session will cover those techniques necessary to take those creative concepts to their implementation in the code you create. By understanding the tools available within the LabVIEW API, such as: Dynamic Events, VITs and their use during runtime, Sub-Panels and Plug-in Architectures; Programmers basic and advanced can create code that will result in dynamic displays and code abstraction. Examples and demonstrations will show how little code is needed to accomplish some eye-opening and dynamic tasks. National Instruments CONFIDENTIAL

2 ‘Dynamic’ in LabVIEW – Going N+1
National Instruments Leadership Seminar April, 2002 ‘Dynamic’ in LabVIEW – Going N+1 What does ‘Dynamic’ mean to us? Ability to have software change and grow based upon customizable configurations and user inputs Ability to transfer data and control, without the need of additional wiring Why use it? How do We Accomplish it? How does it differ from traditional meaning in SW High level advantages ‘saves time later’ National Instruments CONFIDENTIAL

3 Measurement Library – Adding Instrument
National Instruments Leadership Seminar April, 2002 Measurement Library – Adding Instrument Done Once National Instruments CONFIDENTIAL

4 National Instruments Leadership Seminar
April, 2002 The Art at Work Test Module Universal Instrument Configuration & Control Drop-In “Brat Code” Daemon – Background Engine Calling into Other VIs VIt Usage Plug-in Architecture Sub-panel Callback Sub-Panel Config.vit Data Instrument Configuration Instrument Configuration Instrument Driver Instrument Driver Instrument Configuration Instrument Driver National Instruments CONFIDENTIAL

5 Advanced VI Server Techniques
National Instruments Leadership Seminar April, 2002 Advanced VI Server Techniques Drop-In ‘Brat Code’ & Extrapolation What Happens When Children Control the Parent Calling VI’s From Anywhere Reach Out and Run Someone Utilizing the VIt These ain’t your fathers templates Extrapolation From Self: Smart code, allows your program to grow and change w/out needing to re-work your code Extrapolation from Predecessors: Allows independence from caller Self Operation A VI operates on its own properties and/or objects Example: Customize appearance based on information saved in an .ini file (size, color, logo, visible objects,…) Operation on other VIs Open a reference to a LabVIEW instance Open a reference to a VI Operate on properties/methods Close references after use National Instruments CONFIDENTIAL

6 Drop-In ‘Brat Code’ & Extrapolation – The What
National Instruments Leadership Seminar April, 2002 Drop-In ‘Brat Code’ & Extrapolation – The What Code that can “look up to” and operate on the code it’s placed inside Stupid about the code around it Smart enough to function w/ little to NO input National Instruments CONFIDENTIAL

7 Drop-In ‘Brat Code’ & Extrapolation – The Why
National Instruments Leadership Seminar April, 2002 Drop-In ‘Brat Code’ & Extrapolation – The Why Achieve Complex Operations w/ Little to No Wiring Very Modularized Fosters Re-use Enables Plug & Play Code (or Drop & Run) “The scope of the code does not depend on pre-defined limitations. It adapts to the code it’s in.” DO DEMO after this slide then show how “The scope of the code does not depend on pre-defined limitations, rather, it changes depending on the code it’s in.” National Instruments CONFIDENTIAL

8 Drop-In ‘Brat Code’ & Extrapolation – The How
National Instruments Leadership Seminar April, 2002 Drop-In ‘Brat Code’ & Extrapolation – The How Get a reference to the high level object of interest Front Panel Ref Application Ref Path Scan results to get items Utilize unused/hidden fields to flag items Perform extraction or operation No Passing of Data Needed Traverse Ref – Find all references of specific ClassName vi.lib\Utility\traverseref.llb\TRef Traverse for References.vi (8.0) Call Chain Find where current VI resides in hierarchy VI.Callees Find everyone who is using specific VI Panel Properties – Filter array for item of interest National Instruments CONFIDENTIAL

9 Daemons – Drop-in Engines
National Instruments Leadership Seminar April, 2002 Daemons – Drop-in Engines Adds Complex Functionality by the Addition of 1 VI Self Managed or ‘Lite’ Interaction Similar to Windows Services Utilizes Multi-Processing CPU Does not come free – Debugging difficulty Encapsulate Complexity Within Engine Clean Code = Happy Code National Instruments CONFIDENTIAL

10 Invoking VI’s from others – The What
National Instruments Leadership Seminar April, 2002 Invoking VI’s from others – The What Running Code Not Placed as SubVI “Dynamically” call a VI Load VI | Pass parameters | Run VI | Read Result | Close In LV, EXE, Across PC, Around World National Instruments CONFIDENTIAL

11 Invoking VI’s from others – The Why
National Instruments Leadership Seminar April, 2002 Invoking VI’s from others – The Why Improve performance (memory usage) Make design more modular Ability to share work among team members Increase scalability of the application Create distributed applications Enable recursion in G Also…very useful for “release tools” builder VI analyzer is a good example Your Programs are No Longer Limited by Software and Physical Boundaries National Instruments CONFIDENTIAL

12 Invoking VI’s from others – The How
National Instruments Leadership Seminar April, 2002 Invoking VI’s from others – The How VI server Method “Run VI” Passing parameters through “Set” and “Get” methods (Invoke Nodes) Ability to run asynchronously : “Wait Until Done” VI server Method “Call by Reference” Passing parameters is direct Runs synchronously – like a subVI would Pay Attention to Error Handling National Instruments CONFIDENTIAL

13 Utilizing the VIt – The What
National Instruments Leadership Seminar April, 2002 Utilizing the VIt – The What Running Multiple Instances of a Same VI…asynchronously Dynamic calls to a VIt Example: an application controlling N similar devices Pseudo “MDI” Applications National Instruments CONFIDENTIAL

14 National Instruments Leadership Seminar
April, 2002 Utilizing VIt – The Why Write once, reuse over and over and over … Maintenance and growth made simple Easily expandable to “N+1” Maximizes Code Reuse MDI Easy and elegant…No need to duplicate VIs National Instruments CONFIDENTIAL

15 National Instruments Leadership Seminar
April, 2002 Utilizing VIt – The How It’s just VI Server… “VI Path” Points to a VIt Keeping Track of Instances References New instances dynamically created are named “<VITNAme>1, <VITNAme>2, …<VITNAme>n ” so that the calling VI needs a way to keep track of running instances references for subsequent operations on a specific instance Windowing operations could be embedded in the VIT itself or operated at the calling VI level. National Instruments CONFIDENTIAL

16 Plug-in Architecture – The What
National Instruments Leadership Seminar April, 2002 Plug-in Architecture – The What Connector Pane Directory structure Naming Conventions Software Calls Into Dynamic Framework Plug-ins Must Match Rules of Framework Automatically recognized by the software Drop new “Plug-In” in a specific directory to make it available to the application Program Extension Add new features without rebuilding program Enum b4 Enum aftr Dirs b4 Dirs aftr Going N+1 – Transparently adding one more to <whatever> Signal processing Algorithms Adding functionality New Camera – Imagine MAX needing to be re-written for a new camera New SourceCodeControl Provider (%LV%\vi.lib\SourceControl\Providers) National Instruments CONFIDENTIAL

17 Plug-in Architecture – The Why
National Instruments Leadership Seminar April, 2002 Plug-in Architecture – The Why SCALABILITY ! Easily deploy new features Make Code More Modular Examples: Adding signal processing algorithms to an analysis SW Adding support for a new instrument in the “Universal Capture” module presented earlier ShowCase LV SCC providers National Instruments CONFIDENTIAL

18 Plug-in Architecture – The How
National Instruments Leadership Seminar April, 2002 Plug-in Architecture – The How Call By reference Node + Strictly typed refnums Connector assignment MUST be clearly specified (all plug-ins use the same!) “Plug-in” directory(ies) so that the SW can automatically scan available modules National Instruments CONFIDENTIAL

19 Event Registration & Encapsulation – The What
National Instruments Leadership Seminar April, 2002 Event Registration & Encapsulation – The What Defining Events External to Event Structure Handling Events Inside of SubVIs Change What is Registered During Run-Time Concept of Registration Encapsulation in Sub-VI’s Why – So you don’t have to add to your event structure every time you do <whatever> Utilizing User Events Initialization Great for fully event driven software Bad for replacing queues National Instruments CONFIDENTIAL

20 Event Registration & Encapsulation – The Why
National Instruments Leadership Seminar April, 2002 Event Registration & Encapsulation – The Why More reactive code Prevents “Bloated” Case Selectors Promotes Re-use Reduces need for wiring Re-use event action w/out needing to code it into your event structure every time! Your Code Event Event handler National Instruments CONFIDENTIAL

21 Event Registration & Encapsulation – The How
National Instruments Leadership Seminar April, 2002 Event Registration & Encapsulation – The How Define objects of interest Get reference to object(s) & wire to registration node Handle events in same VI or pass registration node ref to sub-VI SideNote: Sub-VI may grab object ref from caller MAKE EXAMPLE THAT SIMPLY HAS THE CASE STRUCTURE WITHIN THE EVENT STRUCTURE National Instruments CONFIDENTIAL

22 National Instruments Leadership Seminar
April, 2002 Utilizing Sub-panel Everyday unseen Example : LV Options window Multiple views of same information (Tabular / Pie / Chart) Reduction of code space & data space Single window / Multiple Displays When switching between multiple windows just won’t do National Instruments CONFIDENTIAL

23 National Instruments Leadership Seminar
April, 2002 Caveats and Pitfalls Complexity Up Front Harder to Troubleshoot Document Paradigm, Not Just Code Need Clear Vision of the Future (no crystal ball, just binoculars) National Instruments CONFIDENTIAL

24 National Instruments Leadership Seminar
April, 2002 Conclusion Spend Time Now and Save a Lot of Time Later Saves Room on BD and Time Spent Coding Saves Memory Lets You Create Dynamic / Flexible Displays SMRS ( scaleable, modular, reusable, simple) Always Think “What If I Need to Add 1 More” National Instruments CONFIDENTIAL

25 Questions? Maybe answers…
National Instruments Leadership Seminar April, 2002 Questions? Maybe answers… National Instruments CONFIDENTIAL


Download ppt "National Instruments Leadership Seminar"

Similar presentations


Ads by Google