LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get Matlab figures to come to front

When I open and plot a Matlab figure from a Labview vi using the Labview Matlab script, I'd like this figure to come to the front (in front of the vi w/ the matlab script).  I'm using Labview 8.2 and Matlab R14.  I got this to work on my laptop but not on my data acquisition PC.  Both are running Windows XP.  I looked at all the Matlab, Labview and Windows setups and they seem to be the same on both PCs.  Attached is a quick example.  If you run this vi and hit plot, on my laptop the matlab plot always comes to the front but on my data acquis. PC the figures are always behind the vi.
 
-Brad
0 Kudos
Message 1 of 4
(3,975 Views)

Hello Brad,

The Matlab node in LabVIEW just uses ActiveX calls to send commands to Matlab.  Since the figure window isn't a LabVIEW window, a LabVIEW setting will not force the window to the front.  Why it works on some machines and not others is quite odd behavior - there must be something different between them on a lower level.  You may want to look for ActiveX commands that can force a window to the front or a Matlab command that will do the same.

Best of luck and happy programming!

Janell R | Applications Engineer

0 Kudos
Message 2 of 4
(3,960 Views)
This is probably one of those things where trying to figure out why something is happening may not get you anywhere. I would suggest trying the lvwutil32 library. That library uses Windows API calls that you can use to force the Matlab windows to the front. There's a "Move Window to Top" VI that just might work. Worth a shot at least.
0 Kudos
Message 3 of 4
(3,955 Views)
Great idea!  I actually didn't think about that but I bet that is going to work beautifully.  Smercurio - thanks for being an awesome customer!
 
Let us know how it goes,
 
Janell R | Applications Engineer
0 Kudos
Message 4 of 4
(3,941 Views)