For LabVIEW versions except LabVIEW 2012:
This error occurs because the ActiveX script server did not start properly. Consider the following possible solutions:
- 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.
- 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:
- Navigate to the MATLAB\(version)\bin directory (e.g. MATLAB\R2008b\bin).
- Enter matlab -regserver at the prompt and hit Enter.
- Quit the instance of the MATLAB® software that appears.
- The MATLAB script node should now be functional. (You may need to restart LabVIEW).
- 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.
- Right-click on My Computer and select Properties.
- Go to the Advanced System Settings tab.
- Click the Environment Variables button. The Environment Variables dialog opens.
- 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.
- In the Variable Name field, enter MATLAB_RESERVE_LO for the name of the environment variable you want to set.
- In the Variable Value field, enter 0 for the value for the variable.
- Click OK.
- 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.
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