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 2022 Public Beta

cancel
Showing results for 
Search instead for 
Did you mean: 

New Features: MATLAB® Debugging Workflow Improvements

With the upcoming version of LabVIEW, we are continuing to improve the interoperability of LabVIEW and MATLAB®. In LabVIEW 2021, we introduced the “Call MATLAB Function” node. In this Beta, you can break execution on this node and open the MATLAB environment to debug your scripts, as well as choose a specific version of MATLAB if you have more than one installed. 

 

Please note that we encourage you to migrate any usage of MathScript to MATLAB because the MathScript node will be deprecated in a future version of LabVIEW. For migration assistance, please refer to https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000001E0TDCA0&l=en-US 

  

Step into MATLAB function from Call MATLAB Function node 

 

  1. Place a break point on the Call MATLAB Function node in the block diagram. 
  1. Run the VI. Execution pauses at the Call MATLAB Function node . 
  1. Select “Step Into” to start debugging the .m function in the MATLAB debugger. 
  1. Debugging starts at the first line of execution of the MATLAB function.   

Picture2.gif

 

Known Issues: 

  • Closing the MATLAB editor while LabVIEW has paused execution at the Call MATLAB Function node will cause LabVIEW to hang. 
  • Workaround: Open Task Manager and end the MATLAB process 
  • “Abort Execution” in LabVIEW will not work when VI execution is paused and waiting for debugging in the MATLAB editor to finish. 

 

Open Specific Version of MATLAB editor from Right-click menu 

 

  • Right-click on a Call MATLAB Function node to see the “Open in MATLAB(R)” submenu. It lists the installed MATLAB versions, sorted in descending order. (If only one version of MATLAB is installed, it will be a top-level menu item.) 
  • The menu will be disabled if a supported version of MATLAB is not installed/found on the machine  
  • On clicking the menu item, 
  • If the path to the script file can be obtained from a directly wired path control or constant, that file will be opened. 
  • If the path cannot be obtained, a file explorer will be shown for users to select the MATLAB script 

 

 Rohith_Grandhi_1-1652159477113.jpeg

Above is a sample visual of the right-click menu for the Call MATLAB Function node. 

 

MATLAB® is a registered trademark of The MathWorks, Inc. 

 


Rohith Grandhi

Product Owner, LabVIEW R&D

0 Kudos
Message 1 of 8
(2,168 Views)

What is the list of OS supported for this feature?

When deploying a LabVIEW built application using this feature - which license of MATLAB will be required (if any)?

What will occur if MATLAB is not installed? Will the rest of the app run fine and only the MATLAB function call will return a nicely formated error?

 

Please refresh my memory, does the MathScript Node require a MATALB license to run in a deployed application?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 8
(2,132 Views)

Well one of those I can answer because I don't have access to MATLAB.  In the development environment it returns error 0d1732, "LabVIEW: Failed to connect to MATLAB(R). Check that MATLAB is installed and activated."  I assume a built EXE will return the same error.

Message 3 of 8
(2,128 Views)

@TiTou wrote:

Please refresh my memory, does the MathScript Node require a MATALB license to run in a deployed application?


The MathScript had nothing to do with Matlab other than the fact that the syntax was nearly identical.  I think it required a runtime license to run in an application.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 8
(2,115 Views)

Note that the MATLAB workflow is only available on Windows AFAIK.  Deprecation of mathscript will leave other platforms out in the cold.

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 5 of 8
(1,963 Views)

What is the list of OS supported for this feature?

  • MATLAB Node is supported on only Windows OS

 When deploying a LabVIEW built application using this feature - which license of MATLAB will be required (if any)?

  • We do need MATLAB license and MATLAB installed on a machine where we deploy the built application

What will occur if MATLAB is not installed? Will the rest of the app run fine and only the MATLAB function call will return a nicely formatted error?

  • If MATLAB is not installed, LabVIEW MATLAB Node will error out with message that says MATLAB is not installed

Please refresh my memory, does the MathScript Node require a MATALB license to run in a deployed application?

  • MathScript node is NI's proprietary software and it doesn't depend on any MATLAB license.
Message 6 of 8
(1,953 Views)

Mathscript could run without MATLAB so the removal of it is a loss. 

 

We occasionally used mathscript nodes to include scripts that were developed by people most familiar with MATLAB, and we could just add it and build the application (if speed was an issue we might recreate it in G instead later on, but even then it got us running a prototype quickly). 

0 Kudos
Message 7 of 8
(1,941 Views)

@Rohith_Grandhi  a écrit :

What is the list of OS supported for this feature?

  • MATLAB Node is supported on only Windows OS

 When deploying a LabVIEW built application using this feature - which license of MATLAB will be required (if any)?

  • We do need MATLAB license and MATLAB installed on a machine where we deploy the built application

What will occur if MATLAB is not installed? Will the rest of the app run fine and only the MATLAB function call will return a nicely formatted error?

  • If MATLAB is not installed, LabVIEW MATLAB Node will error out with message that says MATLAB is not installed

Please refresh my memory, does the MathScript Node require a MATALB license to run in a deployed application?

  • MathScript node is NI's proprietary software and it doesn't depend on any MATLAB license.

Thank you for clarifying these points for me.

 

I very much agree with Mads, deprecating the mathscript node will be a loss.
And not small one for those who have deployed their application using it on dozen of customer systems.

What will be the alternative for them?
Adding a MATLAB licence to the price of their system? No way.

 

What is NI's intent? Reduce customer base?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 8 of 8
(1,934 Views)