Discusiones sobre Productos NI

cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

Matlab Script Node

Hello,

 

 

I'm working with Labview v8.6 and Matlab R2007b and i have a question about how operates Matlab Script Node.

 

Firstly, when i open or call the sub vi containing the sript node,  inmediately command window appears on the taskbar without having execute the structure that holds the sript.

--> Is there any way in that doesn't appear that window until you run the corresponding structure? 

 

If I close this window (for example writing in the sript: "quit" matlab command), when you call back the sub vi, won't work because that window won't reopen automatically.

 

On the other side, when this window is opened, running orders are not displayed so i can't interact with the Matlab file,

 

For example:

 

if I have in the Matlab script node:

 

path(path, 'c:\tests');% append search path

test; %this will execute test.m

 

Test.m is as follows:

 

num=input('Enter number:  ');

path='C:\tests';

m=[1,2,3,4,num]

save matriz.txt matriz -ascii;  %this will save a text file containing the matriz "m"

 

I think the reason is because the matlab runtime is transparent for users and only is used as a tool for calculating (i don't know).... however , won't be a problem because I could introduce unwanted variables through labview and then incorporate them in the script.

 

For finish and concluding:

 

Could i close the mencionated window for open it later if necessary without affecting the proper functioning???

 

Rewards 

 

 

 

 

 

 

0 kudos
Mensaje 1 de 4
3.681 Vistas

Hi Datglez, when you work with th Matlab Script node it basically uses Active X to comunicate with  Matlab®   , for active X to works both programs must be running. If you close it you should launch it again for it to work.

If you dont want to have this you could try the Mathscript node, it accept most of the .m code and works inside LabVIEW without any Active X communication, or interaction with other programs.

Best Regards

Benjamin C
Principal Systems Engineer // CLA // CLED
0 kudos
Mensaje 2 de 4
3.673 Vistas

Thank you for the answer..

 

But I have other question:

 

How Could I interrupt a matlab script node (like a break command) for stop the process?  

 

I've a stacked structure with a matlab node in one of the sequences

 

 

0 kudos
Mensaje 3 de 4
3.615 Vistas

Veo que también contestas a los temas en español así que lo explicaré mejor así jejej...

 

Como explicaba en el mensaje anterior, tengo un script de matlab dentro de una estructura secuencial y me gustaría saber si existe alguna forma de pararlo (a modo de interrupción) sin tener que esperar a que finalice la ejecución de todo el código existente en dicho script. He intentado incluir en tal código una variable que se compruebe cada cierto tiempo para finalizar el programa que describe el script, pero el valor de esa variable proviene del exterior, es decir, de un botón o interruptor que se establezca para cancelar el proceso que realiza el script.

 

El problema que existe es que esa variable proveniente de fuera del script no se actualiza (se lee) mientras labview está ejecutando dicho script por lo que durante este tiempo de nada sirve que se pulse el botón de cancelar o parar.

 

Según he leído en el foro, creo que no existe ningún bloque (algo similar a un break en otros lenguajes de programación) que pueda finalizar o cancelar el bucle donde se ejecute. 

 

¿Alguna idea? 

 

1 saludo y muchas gracias ..

0 kudos
Mensaje 4 de 4
3.601 Vistas