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: 

Keeping matlab engine open

Hello, I am rather new in the labview world, and have a question regarding matlab nodes. It seems that when each node is executed, a new matlab engine is opened. Granted this is good for variable scope, but lousy for speed. Is there any way for all the scripts can be executed in the same instance of engine? Unfortunately I can not combine any more nodes either. Thanks for your time.
0 Kudos
Message 1 of 2
(2,168 Views)

That's not quite right. Matlab nodes in different VIs share the same Matlab space. You'd get a new Matlab "space" if you closed all the VIs that had a Matlab script. If you run one VI and set some variables, and have another VI with another Matlab node, then this other VI's Matlab node will be able to "see" the variables created in the first VI.

 

You can prove this to yourself by using the attached VI.

  • Open "Matlab A". Run it. Keep the VI open.
  • Open "Matlab B". Run it.
  • You will see that the VI "Matlab B" is able to "see" the variables that were created in the Matlab script from the "Matlab A" VI.
Download All
0 Kudos
Message 2 of 2
(2,137 Views)