LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when running matlab mfile in labview 8.2

Dear Sir, I am facing some same problem here. But when i run my matlab in labview, it shows Error as attach below. I have follow all the instruction but still cannot run properly. Can anyone guide me in this?

 

matlab & labview.jpg

0 Kudos
Message 1 of 13
(4,249 Views)

I don't quite understand how this is a LabVIEW question. Your VI consists of only a Matlab script node that contains a bunch of Matlab code. Are you asking us to debug your Matlab code?

0 Kudos
Message 2 of 13
(4,241 Views)

Sorry for posting two message in the forum as i im still new to the forum... For the problem the above i have solve already... Thanks for the reply. I have another question to ask... I am using matlab script to read the program from matlab and it take about 1 minute to get the output... while waiting for the matlab script to process, can i perform another task (multitasking with matlab script) which happen at the same time? Thank you!

0 Kudos
Message 3 of 13
(4,231 Views)

You can run other LabVIEW code at the same time, but I don't believe you will be able to run another Matlab script at the same time, since the Matlab ActiveX server (which is how LabVIEW communicates with Matlab) is not mutlithreaded, as far as I know.

0 Kudos
Message 4 of 13
(4,228 Views)

I see. But if i am running one matlab script with another matlab code (not another matlab script), it is possible right? i am trying to use while loop for both, but i am fail to get the output... Thanks for the concern anyway. Thank you!

0 Kudos
Message 5 of 13
(4,226 Views)

Here is my matlab code.... and the data attached... 

Download All
0 Kudos
Message 6 of 13
(4,222 Views)

Dear sir/madam, how to execute a matlab script with another function at the same time as the vi attached above? I am hoping for some guide. Thank you!

0 Kudos
Message 7 of 13
(4,201 Views)

It is not clear what you are trying to do in the VI. Are the outputs from the Matlab script node supposed to be used in the loop? If so, how?

0 Kudos
Message 8 of 13
(4,173 Views)

The matlab script's output will be proceeded to the 2nd sequence (i didn't show the following sequence), the data1.xlsx that i upload is the raw data to be used for matlab script to process.... and the program beside the matlab script is a "traffic light system". Because the process of waiting the matlab script to produce the output take about 40s... so while waiting for the process got get the output, i wan the traffic light system to run as a sign of "in progress"... tis is for my graduate project... thanks for you concern ya.. 🙂 

 

u get me?

0 Kudos
Message 9 of 13
(4,165 Views)

I don't quite understand why it takes 40 seconds to run that script - it's not that complicated. Unless it has to do with the file reading/writing. As it stands, the code in the script is a good candidate for conversion to LabVIEW. Most of what you do in the script is looping, and this can be handled in LabVIEW using the polymorphic nature of functions - i.e., without loops.

 

That said, I don't see any code that sorrounds this. You mention a sequence structure, but it's not clear where that's supposed to go. I don't see an overall loop, so only the loop you show will run continously. As it stands, the Matlab script will only run once. If that's what it's supposed to do (i.e., run the script and then go into the loop), then you can just wire the outputs of the script node into the while loop. But, as I said, I really think you should convert that Matlab script to LabVIEW code.

0 Kudos
Message 10 of 13
(4,155 Views)