LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows, RT, and packed libraries

I'm trying to generate a common codebase for use across many test systems. These systems run both Windows and NI Linux RT. There are many code modules and low level libraries that do literally the same thing whether on a PC or an RT target. We started to use packed libraries recently but these are posing challenges when designing code to be cross target. Since PPL's are compiled code, they have to be compiled for specific target type. In one case, I've made two PPL's, one for Windows and the other for RT. I've added conditional disable structures in the main vi so the proper PPL is called depending on what target the vi runs on. However, LabVIEW tells me every time I open the vi that it can't load compiled code for a target other than what the vi is running on. Is there a way around this? The intention of the PPL's was to keep code modular (plug in style) and protect from inadvertent changes.

 

Likewise, if I want to build another layer of PPL but within the library there exists these conditional disable structs, am I asking for trouble? 

 

Any suggestions for developing common code across targets with the goal of modular and protected code? 

 

LV2017, PC's and cRIO-903x's

0 Kudos
Message 1 of 4
(3,333 Views)

Why do you need the conditional disables in the code? Simply build your PPLs with the same name for each platform and load it from a specific folder. If they are the same name on each platform you do not need to use the conditional disable. If you do want to differentiate them then store them in a common folder with a subfolder for each platform type. Then build the path to the PPLs at runtime using the platform name for the folder. Your root folder code be PPL and then you have the subfolders Windows and Linux under that. Build the path based on the platform type and then load the PPL from the appropriate folder. An alternative is to have two file names such as MyPlugin_Windows and MyPLugin_Linux and add the appropriate file name suffix at runtime. No need for the conditional disable structure.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 4
(3,319 Views)

Loading from a specific folder would work for the plug-ins, but my lower level of PPL use doesn't really support that. For instance, I have a library of custom STM vi's that are used in many places. I want that library to be a PPL. They are used to create STM clients and STM servers of various flavors (this level is the plug in level). These lower level STM vi's are not built like plug-ins but I would still like to protect that code in a PPL. Hence the attempt with diagram disable structures.

0 Kudos
Message 3 of 4
(3,313 Views)

I think if you are going to support multiple platforms you will need to load the PPLs dynamically. Are you using classes? I understand that you have common base libraries you want to use but the strange thing about the diagram disable structure is that the code actually still exists and simply does not run. It is not like commenting out the code in C++ where the code simply does not exist when it is commented out. If you create pure virtual base classes that your code uses and then during program initialization dynamically load the platform specific versions of these classes it should work for you. The other option is to force your base PPLs to have the same name and folder location on all platforms and have your code reference them from there.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 4
(3,309 Views)