From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MATLAB script in executable

I made an exe out of a VI that uses a Matlab script. When I run the exe, I get a 1047 error (failed to send variable to script server) even though that error does not appear when I run the VI. I looked at the knowledge base document 1JNEPGU0 and did what it suggested, even though I shouldn't have to since I am on LabVIEW 6.1. I also am using the updated matscript.dll, per knowledge base document 300A6NDT (the VI did not run until I updated this.)

My software is Windows XP, LabVIEW 6.1, Matlab 7.0.4 (R14)

Thanks!
0 Kudos
Message 1 of 4
(2,883 Views)
Hi Nick,

I seems that Matlab 7.0 (R14) does not work with LabVIEW at this point. Try it wtih matlab 6.5.1 ! You will see that it works fine!

Additionally, to run a script node, LabVIEW uses ActiveX technology to communicate with the script server engine that is installed with MATLAB. However, the ActiveX components of MATLAB, including the script server, are not registered with the operating system when MATLAB is first installed. They are registered the first time MATLAB is launched. Therefore, when using a MATLAB script node in LabVIEW make sure that MATLAB has been launched on that particular machine and its ActiveX components have been registered with the operating system. After following this procedure, LabVIEW should be able to run the MATLAB script nodes without error, regardless of what directory MATLAB has been installed into.

I hope it helps.

Regards
TN
0 Kudos
Message 2 of 4
(2,867 Views)
Do you have any information on whether the problem with LabVIEW and MATLAB 7.0 (R14) will be resolved? If not in the current version(s) is there a hint whether they're looking into it in 8? It would be very hard for me to get my current customer to revert and support earlier versions of MATLAB on the case by case basis needed to use it on our LabVIEW projects. They are heavily invested in MATLAB and are just now starting to explore using LabVIEW. I haven't run into the compatibility problem yet, but there are things being done in MATLAB that they have talked to me about partially migrating to LabVIEW for its UI and DAQ advantages.


Putnam Monroe
Senior Engineer
North Shore Technology, Inc. a National Instruments Alliance company
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 4
(2,864 Views)
Hi Nick,

I think you are well aware that you indeed CAN interface with MATLAB 7.0 (R14) from LabVIEW 6.1 - that is part of what the KnowledgeBase
300A6NDT covers. Since you already got that working in the Development System, the issue must be caused by the fact that you are using an executable in stead of a VI. Did you follow the instructions specific for executables:

"
If using the MATLAB or Xmath Script Nodes in built applications you will need to also replace the appropriate DLLs located in the National Instruments\Shared\LabVIEW Run-Time\VERSION\script directory."

If you already did that, we must look elsewhere for a solution. The following KnowledgeBase also covers an issue with executables and MATLAB:

Why Does My Executable Hang When It Is Opened When I Use A MATLAB Script Node?

If this doesn't work, please let me know the following:

Are you running the executable on the computer that has the Development System installed?
Is MATLAB open when the executable is called?
What instructions  are you using to build the executable?

Hope this helps!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 4 of 4
(2,845 Views)