Error 1047 with MATLAB® Script Node in LabVIEW

Updated Mar 11, 2019

Reported In


  • LabVIEW

Operating System

  • Windows


  • The MathWorks, Inc. MATLAB® software

Issue Details

I get the following error in LabVIEW when I try to use the script node to interact with The MathWorks, Inc. MATLAB® software.

Error 1047
Possible reason(s): LabVIEW: (Hex 0x417) LabVIEW failed to send variable to the script server.

I have properly installed versions of LabVIEW and the MATLAB® software and have run them both in the past, but I cannot get them to communicate with each other. How do I resolve this error?


For LabVIEW versions except LabVIEW 2012:

This error occurs because the ActiveX script server did not start properly. Consider the following possible solutions:
  1. If you have installed the MATLAB® software and have run it at least once before, then all of the ActiveX components should be registered with the operating system. In order to use the script server, close out all programs (the MATLAB® software and LabVIEW). Open the MATLAB® software and then open LabVIEW after the MATLAB® software fully loads. The script server should now respond and the error should no longer appear.
  2. In order to reregister the ActiveX components, open the Command Prompt (Click Start»Run, type cmd in the Open field and click OK) and do the following:
    1. Navigate to the MATLAB\(version)\bin directory (e.g. MATLAB\R2008b\bin).
    2. Enter matlab -regserver at the prompt and hit Enter.
    3. Quit the instance of the MATLAB® software that appears.
    4. The MATLAB script node should now be functional. (You may need to restart LabVIEW).
  3. If this does not work try installing the MATLAB® software locally (make sure it's not on a networked location) and setting environment variable MATLAB_RESERVE_LO=0.
    1. Right-click on My Computer and select Properties.
    2. Go to the Advanced System Settings tab.
    3. Click the Environment Variables button. The Environment Variables dialog opens.
    4. Click the New button under either User Variables or System Variables, depending on whether you want to set the variable for the current user or all users. To set environment variables for all users, you need to have administrator privileges. It's recommended to set it for the current user first.
    5. In the Variable Name field, enter MATLAB_RESERVE_LO for the name of the environment variable you want to set.
    6. In the Variable Value field, enter 0 for the value for the variable.
    7. Click OK.
  4. If you still get the same error, the problem might be with reading inputs to the script written in The MathWorks, Inc. MATLAB® language syntax. If this is the case, running the shipping example program Lorenz throws the same error, since it has inputs to the script. However, MathScript Fractal executes without errors, as it only uses outputs. Changing the Data Type of inputs and outputs to Complex will provide an easy fix to the problem. To solve the problem permanently, you should install the patch provided in the following article: Resolve MATLAB® Script Node and Xmath Script Node Issues in LabVIEW

For LabVIEW 2012:

This is a known issue in LabVIEW 2012. It's related to the way string and array data is passed into the MATLAB® script node from a control which is connected to the connector pane. It's recommended that you upgrade your software to a newer version of LabVIEW to fix this error. Another workaround is to perform some operation which forces LabVIEW to make a copy of the data before passing it into the MATLAB® script node. The following are suggestions for null operations which will fulfill this operation:
  • String data: Trim Whitespace function
  • Array of numeric data: Add 0
  • Array of boolean data: AND with True Constant

Additional Information

MATLAB® is a registered trademark of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.


Not Helpful