12-22-2023 10:30 AM
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?
Solved! Go to Solution.
12-24-2023 06:48 AM - edited 12-24-2023 06:49 AM
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.
01-02-2024 09:39 AM
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.)