08-23-2021 01:53 AM
I was keen to try the new Call MATLAB Function node in LabVIEW 2021 and learned that if you make changes to the m-file, you must kill the MATLAB process before running the VI again.
For example, put the attached VI and M-file in the same directory and run the VI. We can see that B = 1 - A.
Change line 3 of the M-file to B = 1 + A, and we still get
But if we kill the MATLAB process
and re-run the VI, we now have the expected behavior of B = 1 + A.
Is this the intended behavior? Either way I'm posting here so others know what to expect.
Solved! Go to Solution.
08-23-2021 01:57 AM
Did you restart the VI after the change was made or went straight for the kill?
08-23-2021 02:07 AM
I just checked - closing the VI doesn't change this behavior.
Quitting LabVIEW, however, has the same effect as killing the MATLAB process.
08-23-2021 02:15 AM
It's a known issue, see https://www.ni.com/en-gb/support/documentation/bugs/21/labview-2021-known-issues.html
It claims it's resolved in LabVIEW 2022. Not sure what to make of that...
09-20-2022 10:17 AM - edited 09-20-2022 10:20 AM
I have built an executable in LV2022Q3 calling an m file. But after closing the reference, the matlab process remains active. Only when I terminate the app, the matlab process terminates as well.
I ended up calling a second m file that kills the matlab process! Obviously an error is returned in Labview, but that can be simply ignored.
I also learned that if you get an error when calling a matlab function, chances are that you cannot rerun the routine without getting the same error over and over again. You will need to kill the matlab process first.
09-20-2022 11:44 AM
kill script:
09-20-2022 11:50 AM - edited 09-20-2022 11:51 AM
Shame btw that the call matlab function won't also accept string input.