LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MatLab script

Hi,

I experience some problems, when I try to use a MatLab script. The
script does indeed execute, as I am able to plot the data within the
MatLab script, and the variables are available in the MatLab prompt.

However, the MatLab script is not able to return the data to my VI.
I get this error:
Code: 1048
Source: Failed to get variable ">OUTPUT VARIABLE<" from script server.
in >VI<.vi

I use to following software:
Windows NT 4.0, service pack 3
LabVIEW 5.1
MatLab 5.2 - network license (does it matter?)

I have a single VI, which does not return an error, but if I change the
MatLab script, it will. Even the examples, which is destributed with
LabVIEW returns an error.

Can anybody tell me what is wrong??

Thanks,
Rasmus Christiansen


Sent
via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 1 of 4
(3,624 Views)
Hey

I also have this problem. My Matlab Script is in a loop, and only occasionally the output variable is retrieved from the script. Most of the time I get the error described in your post. It would be nice if someone answered this question.

Petter
0 Kudos
Message 2 of 4
(3,624 Views)
Yo,
I too, have had this very same problem...
NI this question has been asked repeatly by many different users, can you please answer it?
-Don

ps. Rasmus, if nothing else works, I saved my output from my script code to a file and then read the file using labview
0 Kudos
Message 3 of 4
(3,624 Views)
I too had this problem but realized that the Matlab variable I was trying to return (uint8) was of the wrong type - it should be a double.
For example, if you want to read an image from Matlab ('picture.jpg') and return the matrix ('P') to LabView, you have to cast the matrix to double before returning it to LabView, i.e your Matlab script should be:

P = imread('picture','jpg'); %read image from file
P = double(P); %cast variable to double


Hope this helps,
David
0 Kudos
Message 4 of 4
(3,623 Views)