Effectively Using Packed Project Libraries SEPAD
Effectively Using Packed Project Libraries SEPAD
Yinhui Chen
CLA
Zebra Technologies
Effectively
Using Packed Project Libraries
Packed project libraries (PPLs) are not as difficult to use as some would think. There are certain facts
you will need to know and understand to use them effectively and fully realize their benefits.
Agenda
▪ Background
1. About us
1. One Container
2. Two Concepts to Define
3. Three Key Factors to Remember
▪ Tips and Best Practices
Let’s begin
ZEBRA TECHNOLOGIES
About us
❑ 3. Easy to maintain
❑ 4. Easy to expand
In our design
✓ 77 core libraries, 79 plugins, 7 application specific PPLs
✓ 2 large scaled applications utilizing PPLs and plugin architecture
✓ A dedicated source code control repository for PPL source code
✓ A dedicated source code control repository for compiled PPLs
✓ A general source code control repository for application source code
✓ The ability to extend functionalities of deployed applications without the need to rebuild
the applications themselves
✓ Continuous Integration using MGI Solution Explorer and Jenkins to manage the building
process on a dedicated build server
Our Design Achievements
Understanding Packed Project Libraries
One Container
What is a Packed Project Library?
Development Runtime
Debugging Enabled Debugging Disabled
Block diagram can be opened, code Block diagram cannot be opened,
can be debugged code cannot be debugged
Size is bigger Size is smaller
Three Key Factors to Remember
▪ The components of Paths (Internal Path)
▪ The file path in a PPL (Exported File Path)
▪ The limitation of the path length
▪ Loading paths of dependent PPLs (Relative Path)
▪ Exclude dependent packed libraries
The file path in a PPL
Why do we care about the internal path?
▪ Internal Paths are normally taken care by LabVIEW when building executables
▪ When working with PPLs, Internal Paths become exposed to users
Palette menu
>File I/O
>Adv File Funcs
>Packed Library
Understanding the Exported File Path
The file path in a PPL
Dependent
PPLs
Target PPL
Loading paths of dependent PPLs are relative
How do PPLs reference each other?
Loading paths of dependent PPLs are relative
How do all these paths relate to the file system?
▪ The loading paths of dependent PPLs are relative to the root directory.
▪ The whole PPL hierarchy can be relocated, but the directory structure has to remain the
same.
Relative Path:
..\..\String Handling\JSON Toolkit.lvlibp
How to configure build specs?
File System Hierarchy Specifications
To organize PPLs in a file system with multiple folders, all dependent PPLs need to be
specified in build specification.
Target PPL
Source Files
How to configure build specs when building PPLs Add Source Library
▪ To configure the build spec of a PPL and Executable, to Top-Level Library
1. Source Files
Executable Destination:
C:\Test Automation\LabVIEW Executables\ZCAT Plus
PPL Destination Root:
C:\ProgramData\Zebra Tools This design works
because the executable
Installer Destination:
C:\Program Files (x86)\Zebra Tools\ZCAT Plus
uses relative paths to
load and search its
PPL Destination Root: dependent PPLs!
C:\ProgramData\Zebra Tools
What is the build issue?
Distributing the application and Deploying the PPLs
When the Executable and Installer build specs are in the same project, the Installer will bring along all
PPLs included in the Executable.
Exclude dependent packed libraries
Three Key Factors to Remember
Disabled(Default) Enabled
Dependent PPLs will be Dependent PPLs will NOT
copied to destination be copied to destination
Tips and Best Practices
Employ SOLID principles
Tips and Best Practices
Do’s
▪ Separate shared functionalities into Library PPLs
1. APIs
2. Protocols
3. Abstraction Layers
4. Shared Utilities
▪ Use helper Library PPL to load Plugins
Don’ts
▪ Do NOT nest Plugins
▪ Do NOT have circular dependencies between PPLs
For example, ActorFramework.lvlib and AF_Debug.lvlib
A tool to manage the build process – MGI Solution Explorer
Tips and Best Practices
An open source and free software that helps to manage projects and build any build specs
Strategies to manage the build process
Effective Building Process
Some simple rules and hierarchies have been developed to help managing
1. Create individual Solution file for each PPL project
2. Create a layered hierarchy of Solutions for Library PPLs
3. Create a flattened hierarchy of Solutions for Plugin PPLs
Layered Hierarchy of Solutions for Library PPLs
Strategies to manage the build process
1. One top level Solution file containing Solution for all Plugins of the same kind