LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display value in MATLAB For loop on LabView

Hi guys,

 

I have a MATLAB script in my VI. The MATLAB script runs a For Loop. For each iteration of the For Loop, a variable say, count is incremented by 1.

 

From what I am experiencing, the MATLAB script only outputs the final value of count when the script is done running.

 

Is it possible to capture the value of count as each iteration is performed?

 

 

PS : Using a LabView For loop is not possible for my case. Running the MATLAB code is mandatory.

 

Thank you in advance!

0 Kudos
Message 1 of 4
(4,080 Views)

You could build an array of all the values inside your Matlab For Loop and pass the array out of the node when you are done.

0 Kudos
Message 2 of 4
(4,066 Views)

That is a good suggestion but I would need the values as the loop is iterated.

I need it to show its progress on LabView.

0 Kudos
Message 3 of 4
(4,062 Views)

When the Matlab script gets called, it's actually passing control over to the Matlab ActiveX server. Thus, LabVIEW has to wait until that's done before it can proceed. What you're asking for is interprocess communication. That doesn't come provided "out of the box". You have to create it yourself. Some ideas were suggested here: http://forums.ni.com/t5/LabVIEW/Labview-Matlab-Exchange-Data/td-p/1408054

Message 4 of 4
(4,042 Views)