LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore Missing DLL in OOP Abstraction Layer

I've built an abstraction layer for communicating with a CAN bus using OOP in LabVIEW.  I have a parent class as my interface layer with two children for the implemenation layer.  One of the children uses TCP/IP to communicate with an application (a virtual CAN bus) and the other communicates directly with hardware via the supplier's DLL.

 

The problem I'm having is that when I run my application on a machine that does not have the hardware installed, I get a "file not found" error (for the DLL) even though I'm never using the hardware implementation; I'm only using TCP/IP in this particular application.  When I have the source code on a computer that does not have the hardware installed, it shows that all my class VI's are broken because it's missing the DLL in one of the child classes.

 

I found this thread that implies that I'm out of luck with it being able to simply ignore the missing DLL.  This defeats the purpose of an abstraction layer sinceit requires the hardware drivers to be installed even though I'm not using it.

 

Any ideas about how I can get this to work without requiring the hardware drivers?

0 Kudos
Message 1 of 3
(2,974 Views)

This depends a lot on how you built the abstraction and, crucially, how you deploy it (package). If the package includes both the simulated and actual hardware children then you effectively are dependent on the hardware drivers as well. Ideally you want the package for the interface (your abstract parent) to be seperate from the implementations so that your callers are no dependant on the actual implenentation to avoid accidentally depending on all the children implementations. 

 

Some code would help me be more specific.

0 Kudos
Message 2 of 3
(2,966 Views)

You need to load your class using Get LV Class Default Value VI  otherwise it will load at the beginning.

0 Kudos
Message 3 of 3
(2,949 Views)