From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Why this matlab script not working

Hi ,

 

Attached please see the vi. I am using a matlab script and it gives error 1048 when using the edge function of matlab. The script could not generate "wx" to graph and gives empty array in the Labview. The code runs fine when run in matlab standalone. I am confused as why the error is generating when calling matlab node in LV 2011.

 

The log file is also attached.

 

 

0 Kudos
Message 1 of 5
(2,731 Views)

attached file

Download All
0 Kudos
Message 2 of 5
(2,728 Views)

The edge function belongs to the Matlab Image Processing Toolbox (see the link at the beginning of the sentence). I do not think Mathscript can reach out for that. You may try copying the edge.m function and its dependencies from the install directory of Matlab to your directory with the example.vi.

 

I was wrong. After reading some other thread http://208.74.204.114/t5/LabVIEW/Mathscript-all-matlab-functions-are-not-working/td-p/2264666 IMHO, you are doing a good thing using the MATLAB script node. I do not know, why the edge.m is not loaded.

 

Cheers,

0 Kudos
Message 3 of 5
(2,687 Views)

Its not somethihng silly is it:

(Context Help: )

Calls the MATLAB® software to execute scripts. You must have a licensed copy of the MATLAB software version 6.5 or later installed on your computer to use MATLAB script nodes because the script nodes invoke the MATLAB software script server to execute scripts written in the MATLAB language syntax. Because LabVIEW uses ActiveX technology to implement MATLAB script nodes, they are available only on Windows.

 

i.e.

1) you do have a licensed copy of MATLAB 6.5 or later on the PC

2) your OS is Windows

3) you don't have some sort of firewall/Virus protection preventing ActiveX calls between LabVIEW and MATLAB

4) You do have the correct Datatype for the Array?

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 4 of 5
(2,668 Views)

Hey Alpine,

 

The function needs to be supported in the Matlab Run-Time Engine. The Matlab Script calls into the RTE to execute your functions so there is some limitations to what functions you can call the next best thing would be to write the script to pass data via file transfers binary or ascii is the easiest or a TCP connections.

 

When I run your script I receive error 1050 so I don't have the toolkit installed for edge function (doesn't run in Matlab either). Is the function supported in the Matlab RTE?

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 5 of 5
(2,645 Views)