Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
2 ratings:
 4 out of 5     Rate this Document

Why Does the MEX-File I Created with the Math Interface Toolkit Appear to Hang The MathWorks, Inc. MATLAB® Software?

Primary Software: LabVIEW Development Systems>>Full Development System
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I created a MEX-file using the LabVIEW Math Interface Toolkit. When I call the MEX-file from The MathWorks, Inc. MATLAB® software, it appears to execute but the MATLAB software hangs. Why is this happening and how can I correct it?

Solution:
You must enable the Show front panel when called option for the VI before you use the Math Interface Toolkit to convert the VI into a MEX-file. You also can create the VI so the VI dynamically calls the front panel.

When you call the MEX-file in the MATLAB software, the MEX-file references the .dll the Math Interface Toolkit creates. If you do not enable the Show front panel when called option for the VI you use to create the .dll, the .dll runs in the background, but there is no way to access it. If the VI contains a loop that requires user input to exit, the MATLAB software appears to hang.

Complete the following steps to enable the Show front panel when called option.
  1. Select File»VI Properties in LabVIEW to open the VI Properties dialog box.

  2. Select Window Appearance from the Category pull-down menu.

  3. Click the Customize button to open the Customize Window Appearance dialog box..

  4. Place checkmarks in the Show Front Panel when called and Close afterwards if originally closed checkboxes.

  5. Click the OK button.
Refer to the block diagram below for an example of dynamically calling a front panel. The Open VI Reference function returns a reference to a VI, custom control, or global variable specified by a name string or path to the VI's location on disk. The Close Reference function closes the reference. The two Invoke Node functions open and close the front panel of the VI. Refer to the LabVIEW Help for more information about these functions.



MATLAB® is a registered trademark of The MathWorks, Inc.

Related Links:

Attachments:


fpopenmethod.GIF


Report Date: 01/20/2004
Last Updated: 09/05/2007
Document ID: 35JGPQ2P

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit