Jump to content

Doug Harper

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Doug Harper

  1. Hello:

     

    I am working on an application where a main User Interface will need to open a subVI for a motion control system asynchronously using a menu selection.  The motion control subVI should run independently in its own window separately from the main application that initiated it.  I have the code working using the following ...

     

     

    post-5394-0-27990100-1454949935.png
     
    This works fine up to a point... the subVI opens in its own window and runs independently in its own window.  I use VI server within the subVI to open its front panel on startup.  
     
    The problem occurs if the subVI hasn't been closed/stopped yet and the user selects the menu item again from the main UI.  An additional instance of the subVI is queued up serially.  If the user then stops the subVI then the other instance starts right up again.  
     
    What I thought would work to avoid this problem is to check to see if the subVI is already running when my menu event triggers and if so just bring its window to the front using some code like...
     
    post-5394-0-84848900-1454949935.png
     
    and then if it is Idle I would call the subVI asynchronously using
     
    post-5394-0-38504400-1454949936.png
     
    However, the VI server call for the execution state never returns idle.  It always returns Running even though the subVI hasn't been started yet.  I was surprised by this, expecting it to return Idle when the subVI hadn't been called yet.
     
    Does anyone have suggestions for starting this subVI and if then if it has already been started to just bring its front panel to the front?
     
    Thanks,
     
    Doug Harper
     
    PS.  Please ignore the incorrectly labeled global variable that is passed to my subVI.  I had this in there temporarily and forgot to change it before taking screenshots.  It doesn't have any bearing on my question.
     
     
  2. Yair:

    Thanks very much for the advice on the Winutil library. I had heard of it before but never had a need to use it until now. I was able to obtain the functionality that I wanted by making my application "Topmost" and then setting it back to "Not Topmost". If I just set it at Topmost then I couldn't get any other windows to stay on top of it anymore, which I guess makes sense.

    I'm still interested in knowing how to do this on a built Mac application, but honestly I have a few other problems to figure out on the Mac platform regarding associating my datafiles with the application before this will be an issue for me.

  3. Hello:

    I have written a LabVIEW application that I build and distribute to students for use in one of my classes. The application uses a custom data file and I have been successful in following suggestions in both of the following threads to be able to assocate these data files with the application so that if the user double-clicks a data file then the built application will start if necessary and will load the data file.

    How to assisgn a file extension to an EXE? and

    Associating my EXE with a specific file extension type

    I basically used a second, small file loader applicaiton that is associated with the data files (via registry settings on Windows) that captures command line arguments and passes them to my main application. My application presently works on both Windows and Mac platforms so I used a TCP/IP based approach to pass the file path to open rather than DDE as was discussed (along with an example) in one of the threads.

    With the advice found in various parts of the above threads I was successful in getting the file association to work on my applicaiton (at least in Windows so far, I'll work on the Mac side soon) with one small issue that I'd like to fix. If my appilcation is already running then when the new file to open is passed by the file loader I'd like to bring my application to the front so that the result of the request to load the new data can be seen.

    This is especially a problem when the appliation has a modified data set that hasn't been saved yet. In this case I prompt the user with a dialog asking if he/she would like to save the existing data before loading the new data file that was requested via the launch attempt from the OS. If any window is above the center of the screen (such as an explorer window where the user was browing the data files) then the dialog ends up being hidden behind this window and the user has no indication that he needs to move something out of the way to get to the dialog.

    I tried using the "Bring To Front" method on a VI Server application class node but it didn't do anything. Could I be using this wrong or is there a better way to have the window assocaited with a built application be brought to the top most. I'd really prefer an approach that would work on both Windows and Mac platforms as the rest of my application is platform independent.

    Thanks in advance for any assistance offered.

    Doug

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.