3. Agenda
I. Would my application benefit from componentization?
II. How do I architect a componentized application?
III. How do I build a componentized application?
IV. How do I distribute a componentized application?
6. Monolithic Deployment
Create initial deployment workflow
1. Create EXE buildspec and build the monolithic EXE
2. Create Installer buildspec and build the Installer
3. Run the installer on the target machine
Update deployment workflow
1. Make modifications to source code
2. Rebuild the monolithic EXE
3. Rebuild the full installer
4. Run the full installer on the target machine
5. (Revalidate if necessary)
10. Componentized Deployment—How to Architect
▪ How do you plan to push out updates to your application?
▪ How does your end user want to update the application?
▪ Are any pieces of your application reusable in other deployed applications?
Example components
▪ Subpanels
▪ HAL plug-ins
▪ Algorithm plug-ins
▪ Configuration files
?
11. Componentized Deployment—How to Architect
Best practices
▪ Modularize your UI
▪ Modularize your code
▪ Use a plug-in architecture
12. Componentized Deployment—How to Architect
Best practices
▪ Modularize your UI
▪ Modularize your code
▪ Use a plug-in architecture
Analysis
Reporting
Measurements
13. Componentized Deployment—How to Architect
Best practices
▪ Modularize your UI
▪ Modularize your code
▪ Use a plug-in architecture
15. What components do I build?
▪ EXE
▪ Plugins
▪ Config files
COMPONENTS
EXE
Plugins
(Source distribution)
Plugins
(Packed project library)
Config files
16. Which method should I use to build my plug-in?
Source Distribution
▪ Simpler build process
▪ More files on disk
▪ Source code more exposed
Packed Project Library (.lvlibp)
▪ More complex build process
▪ Single file per plug-in
▪ No source code exposed
Refer to
APPENDIX Section
18. Follow-Up Content for Deploying Plug-Ins
▪ See Appendix section in this presentation
▪ Recommendations for Deploying LabVIEW Plug-Ins in the Run-Time Engine
https://labviewguru.com/2013/12/07/the-nuances-of-deploying-plugins-in-labview/
▪ Best Practices for Packaging Code in LabVIEW
http://www.ni.com/webcast/3798/en/
▪ Example Plug-in Framework Using Source Distributions
https://forums.ni.com/t5/LabVIEW-Development-Best/Measurement-Utility-Plugin-
Hardware-Abstraction-Layer-Using/ta-p/3531389
▪ Example Plug-In Framework Using PPLs
https://www.studiobods.com/en/niweek2018-ts1043/
https://forums.ni.com/t5/LabVIEW-Development-Best/Plug-in-Architecture-using-Packed-
Project-Libraries-lvlibp/ta-p/3514395
20. Introduction to NI Package Management
What is a package?
▪ Installation Files
▪ Metadata
▪ Dependencies
Program Files
Acme
support
Filter Test.exe
Config.ini
21. Introduction to NI Package Management
What is a package?
▪ Installation Files
▪ Metadata
▪ Dependencies
Display name Filter Test
Version 2.5.0.0
Description Runs sequence of
tests for Filter A12345
Maintainer Acme
Email support@acme.com
Category Application Software
Release notes Fixed bug 344322.
Updated analysis UI.
… …
22. Introduction to NI Package Management
What is a package?
▪ Installation Files
▪ Metadata
▪ Dependencies
2.5
2.0 2.2 1.5
4.0 4.5 2.6
Drivers and Runtimes
Your Dependencies
23. Main EXE
Config HW Run Sequence View Reports
LabVIEW RTENI-SCOPE RTENI-VISA RTE
Agilent 34401a PXIe-5185 Simulated DMM
HAL Plug-Ins
Demo Example—Package Dependencies
24. Main EXE
Config HW Run Sequence View Reports
LabVIEW RTENI-SCOPE RTENI-VISA RTE
Agilent 34401a PXIe-5185 Simulated DMM
HAL Plug-Ins
Demo Example—Package Dependencies
DUT A001Test Station 1
25. 1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
Overview of Workflow With
and
26. Demo
1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
Development Computer
27. Demo
1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
Development Computer
Feed
Hosted on local/network folder or web server
28. Demo
1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
Target Computer
29. Demo
1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
Target Computer
30. Demo
1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
Development Computer
31. Demo
1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
Target Computer
37. Track systems through
a central web interface
Search systems across all groups
Multi-select to perform functions
in parallel (e.g., install, restart)
Manage system configuration, health, and performance through a central web application.
Classify systems into groups
Introduction to
38. 1. Build packages
2. Distribute packages on SystemLink feed
3. (Optional) Create states
4. Push software to clients
5. Push updates to clients
Overview of Deployment Workflow With
and
39. Overview of Workflow
1. Build packages
2. Distribute packages on SystemLink feed
3. (Optional) Create states
4. Push software to clients
5. Push updates to clients
Development Computer
40. Overview of Workflow
1. Build packages
2. Distribute packages on SystemLink feed
3. (Optional) Create states
4. Push software to clients
5. Push updates to clients
41. Overview of Workflow
1. Build packages
2. Distribute packages on SystemLink feed
3. (Optional) Create states
4. Push software to clients
5. Push updates to clients
43. Recap
I. Would my application benefit from componentization?
II. How do I architect a componentized application?
III. How do I build a componentized application?
IV. How do I distribute a componentized application?
47. Getting Started
1. Install support for LabVIEW package build specification
▪ LabVIEW 2018 and later: already includes package build specification
▪ LabVIEW 2014–2017: must install LabVIEW Package Builder through NIPM
3
48. Getting Started
2. Install Feed Manager tool from VIPM or GitHub
▪ NIPM API in LabVIEW: https://github.com/allenh-ni/nipm-api-labview
▪ Feed Manager GUI: https://github.com/allenh-ni/nipm-feed-manager-gui-labview
4
49. NI Package Manager Workflow (Recap)
1. Build packages
2. Distribute packages on a feed
3. Register the feed
4. Browse and install packages
5. Build/distribute updates
6. Install updates
51. Additional Best Practices for Building and
Distributing LabVIEW Applications
▪ NIWeek 2017: 5 Tips to Develop, Deploy, and License a Memorable Application
https://www.studiobods.com/en/niweek2017-ad568/
▪ NIWeek 2017: LabVIEW Application Builder and Continuous Integration
https://www.studiobods.com/en/niweek2017-ts721/
53. What should I build from my components?
▪ EXE
▪ Plug-ins
▪ Source distributions
▪ Packed project libraries (PPLs)
▪ Configuration files
54. What should I build into the EXE?
▪ Top-level VI
▪ Common dependencies needed by other plug-ins
Examples
▪ Main GUI VI
▪ Main Launcher VI
▪ Parent classes
How
▪ Pull necessary dependencies into EXE by calling them
from the top-level VI
▪ Exclude plug-ins from the EXE by calling them dynamically
EXE
55. What should I build into a source distribution?
▪ Plug-ins with class relationships that span
across component boundaries
▪ Plug-ins load dynamically by a factory
pattern (OOP)
Examples
▪ HAL/MAL plug-ins
How
▪ Source distribution build specification
▪ Remove block diagrams
▪ Exclude code already included in the top-level EXE
SOURCE DISTRIBUTION
56. What should I build into a PPL?
▪ Static libraries that need to be updated
independently of the main EXE
Examples
▪ Subpanels
▪ Algorithms
How
▪ Packed project library build specification
PACKED PROJECT LIBRARY
LIBRARY
57. So which method should I use to build my plug-in?
Source Distribution
▪ Simpler build process
▪ More files on disk
▪ Source code more exposed
Packed Project Library (.lvlibp)
▪ More complex build process
▪ Single file per plug-in
▪ No source code exposed
58. Follow-Up Content for Deploying Plug-Ins
▪ Recommendations for Deploying LabVIEW Plug-Ins in the Run-Time Engine
https://labviewguru.com/2013/12/07/the-nuances-of-deploying-plugins-in-labview/
▪ Best Practices for Packaging Code in LabVIEW
http://www.ni.com/webcast/3798/en/
▪ Example Plug-In Framework Using Source Distributions
https://forums.ni.com/t5/LabVIEW-Development-Best/Measurement-Utility-
Plugin-Hardware-Abstraction-Layer-Using/ta-p/3531389
▪ Example Plug-In Framework Using PPLs
https://www.studiobods.com/en/niweek2018-ts1043/
https://forums.ni.com/t5/LabVIEW-Development-Best/Plug-in-Architecture-
using-Packed-Project-Libraries-lvlibp/ta-p/3514395