LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call two MATLAB dlls built with different MATLAB Runtime versions (or how to avoid Error 1172)

Solved!
Go to solution

I have two MATLAB dlls.  One is built with MATLAB Runtime v9.12 and the other is with MATLAB Runtime v9.13.  

 

The documentation for the first MATLAB function states "Note: This assembly is only compatible with version 9.12 of the MATLAB Runtime.", while the second states "Note: This assembly is only compatible with version 9.13 of the MATLAB Runtime."

 

Each dll works fine on its own.  When a call to a DotNET constructor node is placed in the same VI (or subVIs) the result is a general Error 1172.  

 

Certainly a fix is to ask the MATLAB developer to recompile the dll with a common MATLAB Runtime.  Yet, that is not always possible.  

 

1) Is there a way around this issue?  that is, force LabVIEW to use the correct MATLAB Runtime for each dll.  

2) Is there a way to easily check upon starting my LabVIEW app what the MATLAB Runtime is needed for each dll so that appropriate error handling can occur (that is, tell the operator there is a MATLAB Runtime version issue) prior to getting to the place in the code where the constructor nodes are called?

 

 

Mark | CLA
0 Kudos
Message 1 of 3
(730 Views)
Solution
Accepted by topic author Mark_L

Unless your DLLs support SxS (Side by Side) loading of their dependencies then that’s not an option. SxS is an aberration to avoid the DLL hell that you experience by a very different kind of hell.  It’s definitely not a solution.

It’s pretty special that Matlab does not even support upwards version compatibility across minor runtime versions. Most systems would allow to first load the component with the higher version and then let the older DLL link to that but that seems not an option here.

That leaves only two options: One you already found, make sure all DLLs are created with the same build tool version. The other is to separate one into a different process (exe) and use Interprocess communication to talk to it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(676 Views)

I will go forward with making sure the Runtime versions of MATLAB are kept the same and up-to-date. 

 

(I wonder what level Dante would have placed this issue in his Inferno.)

Mark | CLA
0 Kudos
Message 3 of 3
(590 Views)