WUELUG - Würzburg LabVIEW User Group (DE)

cancel
Showing results for 
Search instead for 
Did you mean: 

Factory Pattern Pahts

Hi,

 

we are having some troubles on factory pattern projects, I hope you had the same issue and you have already found a solution 😄

 

The application LV project uses several external PPLs, they all reside on the C:\ drive. These lvlibps remain always the same, we just build an application which invokes them. 

 

Problem: if the application - which is also just a LabVIEW project - is opened and built on the D:\ drive, we launch the resulting exe, works everything fine. But if we build the application from the C:\ drive, launching the compiled application searches for the invoked lvlibps, and it can't find them. In this case, the path for the lvlibps look to be relative. Building it from D:\ uses absolute paths. 

As I don't have a D:\ drive due to IT restrictions, I an not able to build a working application 😞

Does anyone know more about it? Can I command LabVIEW at build to use absolute paths for invoked lvlibp?

0 Kudos
Message 1 of 5
(157 Views)

It's correct that LabVIEW will treat a path to a dependency on a different drive letter as absolute (see our wiki).

 

Sadly, I am not aware of any static (i.e. not programmatic) way of doing what you're asking for. Maybe others have more ideas?




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )


0 Kudos
Message 2 of 5
(110 Views)

@Madottati wrote:


As I don't have a D:\ drive due to IT restrictions, I an not able to build a working application 😞


Since you don't write anything further about the restrictions: Have you tried subst? You can create a virtuell drive D:\ with the following command in Powershell:

> subst D_: c:\foo\baa

 

Maybe that's enough to make LabVIEW think it's opened from D. 😉

Edit: you have to remove the _ in the command, but without it the forum insert a smiley.

Message 3 of 5
(95 Views)

I haven't tried any virtual drive, because we have a network drive G:\ --> so I set the build target folder to G, the resulting lvlibp references now as absolute path to the resource libraries. 

 

But it's just a workaround, I am curious what NI answers. We prepare a support ticket for it. 

0 Kudos
Message 4 of 5
(86 Views)

If your startup.vi has the same relative path to the .lvlibp as the built executable, you should be able to solve the problem by changing your folder structure:

 

  • in repoA set build destination for PPL to <repoAroot>\PPL
  • copy the built ppl to repoB <repoBroot>\PPL
  • repoB.lvproj sits at <repoBroot>\Source\repoB.lvproj
  • inside lvproj a relative path is being used: ..\PPL\pplA.lvlibp
  • this relative path works independent of the place you check out the repository, or place with exe
  • the buildspec of repoB is set to <repoBroot>\built

You won't have a central place for all ppls with this approach, but you can use different versions of your ppls in different applications.

 

 


Proud developer at Hampel Software Engineering where we turn '404 not found' into '200 OK'. Join us on Discord
0 Kudos
Message 5 of 5
(64 Views)