Bring LabVIEW built exe to front on subsequent launch attempts

I'm using LV 2012 on Windows 7.  I have a LV built executable whose window is commonly minimized by users.  Since there can only be one instance of the exe, if a user attempts to click the shortcut while the exe is already running, nothing happens.  I'd prefer that my app window instead open and move to the front.   I'd swear that LV executables used to do this all on their own, though I don't know if that is due to a change in LV or to Windows.  I'm willing to do it programmatically, but no event seems to get triggerend when you "re-launch" the exe.  Anybody know a trick for doing this?  

There may be an easier way, but...
You could modify your INI file to allow multiple instances of the program. Then in the program you can set it so it does NOT show the front panel at startup and add a check at startup using "Find Window" from the windows API to determine if the window already exists. If it does (i.e. you get a valid handle) you can use that handle to move the already running window to the front (also using the windows API as was suggested above) and quit the program, because another instance is already running. If it does not exist, then use a property node to show the front panel.
The only possible issue here is, you will always get a valid handle to the window since yoru program will be running because you just opened it, whether it is the first or second instance. I am not a windows API wiz by any means, but you may be able to determine if you get multiple handles vs. if you just get one valid handle for a window name, and use that logic to your advantage. This is just a stab in the dark.
CLA, LabVIEW Versions 2010-2013

Similar Messages

  • Can a LabVIEW-built Dll have front end ?!

    Hi All,
    Can a Dll built using a VI be popped-up as usual as a SubVI, when called from a Main VI ?
    I m trying to do this in LV 7.1 & getting the attached error message.
    All the connector pane IOs are correctly configured in the Dll, inside the Main VI code, when it is invoked in its corresponding button value change.
    Please clarify & guide me.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Fatal Error due to LV-built Dll.JPG ‏17 KB

    I agree with Wiebe, I am running DLLs on my production test system.  Windows appear.  The only two issues that I have had is:
    does not always come to the front, even with the attribute set.  But this may be an issue with a modal window in the caller.  The easiest thing for me to do was place the window where I know it will always be seen.
    can not change the icon in the upper left corner.
    As to your error, I typically see that when I have called the DLL wrong.  Passed a value instead of a pointer or something else dippy. 
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • NI-Profibus Comsoft Driver not working in built exe

    I've been using Profibus in ETS for a long time.  I just starting having a problems when I upgraded to 2011 SP1 f1.  The problem only occurs in built exe's.  I made a simple project (see attached) with the Comsoft example VI (DFP2_DP-SlaveExample.vi).  Everything works fine in development mode by clicking the run arrow.  If I build the VI into and exe and deploy, it reports the following error in right after DFP2_Initialisation.vi:
    Error 1055 occurred at Property Node in DFP2_DP-SlaveExample.vi
    Possible reasons:
    LabVIEW: The object reference is invalid
    Here my setup:
    Windows 7 Ultimate SP1 32-bit
    Labview (32-bit) 11.0.1f1 (2011 SP1 f1)  (patch from here)
    Labview Real-Time ETS (11.0.1)
    DF_PROFI_II_LV_1.36.2
    NI Part# 780160-01 (Profi-2-PCI)
    This seem to be a new problem since I patched Labview 2011 SP1 with f1.  Is it possible the patch is not compatible with Labview Real-Time and the Comsoft VISA driver?  Can I roll back the f1 patch?  If so, how?
    Attachments:
    ProfibusSlaveETS.zip ‏39 KB

    Hello David,
    I was able to reproduce this issue in LabVIEW 2011 SP1 (without the f1 patch) using a very simple program that does nothing besides produce a heartbeat and access a property node of a front panel indicator. As you said, it does not occur in LabVIEW 2010 SP1, and it does not occur unless the front panel is closed. The error didn't even happen when I was using remote debugging on the executable. 
    I will be looking into this further, and I'll keep you posted. For now it sounds like you were able to just modify the code to not use those property nodes. 
    Colden

  • Installing NI-DAQmx Base using a LabVIEW built installer

    I am using a PDA, LabVIEW Mobile Module and the CF-6004 to perform instrument control and data acquistion for a handheld instrument I am developing. Because this instrument is going to be used by another party outside my organization, I am also supplying support software for a companion PC. The support software includes ActiveSync to connect the PC and the PDA, a LabVIEW built application for viewing the data collected by the handheld instrument, a LabVIEW built application for installing/updating the LabVIEW (Mobile Module) built PDA applications and NI-DAQmx Base to install the drivers on the PDA. Ni-DAQmx Base needs to be included because if the PDA battery runs down completely, programs/drivers I installed are lost and the other party needs to have the ability to reinstall the necessary files on the PDA.
    The problem is that I cannot find a way to include NI-DAQmx Base in the installer I build to install my LabVIEW built applications onto the PC. It is not listed under the Additional Installers catagory of the installer properties. I cannot run the NI-DAQmx Base Setup.exe with the "Run executable at end of installation" option because I cannot have two LabVIEW installers running simultaneously.
    Right now my work around is to use a batch file to install each component sequentially.
    Is there anyway to include my my LabVIEW built executables, the Run-Time Engine and NI-DAQmx Base in the same installer package?
    Thanks,
    DAJone

    Hello, It is necessary to install Daqmx Base on the machine connected to the PDA and then use the Utility to install it on the PDA. See page 4 of the Mobile Module Manual:
    http://www.ni.com/pdf/manuals/371296e.pdf
    National Instruments

  • LabVIEW built-in file I/O VIs have poor performanc​e on network file I/O operation?

    Hi,
    I use LabVIEW built-in VIs to save a big 2-D array data into a ascii file (with the "write character to file" vi). When I write it on the local hard drive, it takes about 5 seconds to complete the task. But when I write the file on the network, it takes more than 5 minutes. A typical output file is 5MB big.
    If I write the file on the hard drive, and use the built-in File MOVE vi, it takes about 30 seconds to complete the MOVE operation. But if I use Windows File Explorer to move the same file, it takes less than 1 second.
    Both the PC and server are connected on a full-duplex 100BaseT network. I tried different file I/O operations (including MOVE, create new file and LIST)
    with LabVIEW VIs and compared the speed with windows file explorer. It turned out LabVIEW VIs performance is always A LOT slower than Windows File Explorer. I tried the same test on many different PCs, with windows 98, NT, 2000, and the results are the same.
    Is there anyway to improve the file IO performance or is there any other workaround on this issue, such as calling Windows File Explorer to perform the same task via ActiveX maybe?
    Your imputs will be very much appreciated. Thanks!
    Dan

    Hi,
    Do the ASCII files have a .txt extention? I've noticed the same behaviour
    once, with .txt files. Renaming them (to e.g. .txq) fixed the problem.
    I'm clueless why this happend. If you extentions are not .txt, I don't have
    a clue...
    What if you copy the file, and then delete the original?
    Regards,
    Wiebe.
    "dikrn" wrote in message
    news:506500000008000000EA7C0000-1042324653000@exch​ange.ni.com...
    > Hi,
    >
    > I use LabVIEW built-in VIs to save a big 2-D array data into a ascii
    > file (with the "write character to file" vi). When I write it on the
    > local hard drive, it takes about 5 seconds to complete the task. But
    > when I write the file on the network, it takes more than 5 minutes. A
    > typical output file is 5MB big.
    >
    > If I write the file
    on the hard drive, and use the built-in File MOVE
    > vi, it takes about 30 seconds to complete the MOVE operation. But if I
    > use Windows File Explorer to move the same file, it takes less than 1
    > second.
    >
    > Both the PC and server are connected on a full-duplex 100BaseT
    > network. I tried different file I/O operations (including MOVE,
    > create new file and LIST) with LabVIEW VIs and compared the speed with
    > windows file explorer. It turned out LabVIEW VIs performance is
    > always A LOT slower than Windows File Explorer. I tried the same test
    > on many different PCs, with windows 98, NT, 2000, and the results are
    > the same.
    >
    > Is there anyway to improve the file IO performance or is there any
    > other workaround on this issue, such as calling Windows File Explorer
    > to perform the same task via ActiveX maybe?
    >
    > Your imputs will be very much appreciated. Thanks!
    >
    > Dan

  • Share data between built exe:s.

    Hello.
    How do I share data between two built exe:s ? I now use a global variable between two VI:s and it works exactly as I want. However, when I build the application
    the communication between the two exe:s is lost.
    All help appreciated. Real examples are really appreciated to.
    Regards
    Andreas

    Hi Andreas
    If you have an application, it allocates memory. All global variables are located in this memory. The same happens for the second application.
    So that's why it doesn't work. If you have to vis and start them with LV, they both are running in the memory range of LV.
    One way to solve your problem is some kind of client-server architecture. You could have a third application which acts as a data-server and the other two apps act as data-clients.
    Hope this helps.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How do I bring form fields to the front or back?

    I have a document with many form fields/push-buttons in order to create pup-up effects in an info graphic.
    So I use fields to create a mouse-over hot spot, and others that pop up. Now, of course, the hot spot must be in front (or on top), otherwise it gets distracted in it's mouse-over function by the popped-up object (image) that lays over it. (The result would look like a flashing effect, as you roll over the hot spot.)
    Now how do I arrange the fields?? Ich can arrange images and texts to come to the front or hide behind other objects. But in the form field editing mode there is no such option. Also it doesn't work to just cut and paste them, they re-appear in their former position, often behind the other fields.
    Please, help! Thanks, Peder

    Thanks, I will give it a try. To "recieve the focus" means being activated / hovered?
    Am 22.04.2015 um 18:49 schrieb George_Johnson:
    How do I bring form fields to the front or back?
    created by George_Johnson in PDF Forms - View the full discussion
    The tab order effectively sets the z-order, but if a field is not read-only it will be set to the front if it receives the focus.
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7465780#7465780 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7465780#7465780
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in PDF Forms by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.
    ···)····•  Blixen
    werbliche Kommunikation
    Peder Iblher  .  Wichertstraße 16/17  .  10439 Berlin
    Telefon 030 - 250 400 401  .  Fax -409  .  Mobil 0160 - 93 81 58 60
    [email protected]  .  www.blixen.eu  .  www.facebook.com/blixen.eu

  • Recommendation for protection of a LabVIEW built application

    Hi all
    I was hoping that someone out there could give me some advice on protecting a LabVIEW built application (the application runs on an operator interface for TestStand and call LabVIEW written modules).
    Any advice on what products work best with TestStand and LabVIEW written applications?
    Would you recommend a hardware or software implementation? (the application is a specialized application and realistically will be sold to a reasonably small number of vendors, should this influence our chose of SW v HW protection implementation.?)
    Do NI provide any software protection products or will we need to work with a 3rd party’s implementation?
    This area is somewhere I have very little experience in so any advice that you could provide would be much appreciated.
    Looking forward to hearing from you.
    T.I.A
    Declan

    Hi Alberto
    Thanks a lot for you response. It looks like we will go for the Sentinel Superpro keys option for protection. I have added another post outlining in more detail my specific application, if you have a chance could you have a quick look (its under labVIEW general titled "software pretection"). In you experiance do you think the Sentinel Superpro keys would work well in our case. Any futher input will help our confidence in forking out the cash for the Sentinel Superpro development kit.
    Thanks again for you input
    Dec

  • Can a Labview application EXE run on a PC with 128MB RAM

    Hi,
      What is the minimum requirement of the LabVIEW application exe  to run on  a PC. Is it necessary to have 256 MB RAM PC.
    Regards,
    Sowmya

    See Release notes. They can be found in the support section of the website or on the install CD/DVD.
    Message Edited by andre.buurman@carya on 10-30-2007 10:42 AM
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • LabVIEW built DLL's in a multi-threaded C++ app, Help Needed!

    I'm working on a software application that is being developed
    primarily in C++. There is a component of this larger application,
    however, that is being developed in LabVIEW (for several reasons that
    I won't dive into here). This LabVIEW code is therefore executed
    within a C++ wrapper class that calls a LabVIEW built DLL.
    All this was fine and dandy, untill we decided to multi-thread our C++
    application. As a result, the LabVIEW DLL now gets called from
    multiple threads simultaneously. From all of my testing, it appears
    that resource locking is occuring such that only one thread has access
    to the .dll at a time. If I make the .vi used to define the dll
    function prototype as non-reentrant then this is what we see. As an
    example, say we have 3 threads all calling the same .dll method call.
    Thread 1, 2, and 3 all call the .dll within a few milliseconds of each
    other. Thread 1 completes the .dll call after X milliseconds. Thread 2
    completes the .dll call after 2X milliseconds, and thread 3 completes
    after 3x milliseconds.
    Now, changing the vi to reentrant, and running the same test, we see
    Thread 1, 2, and 3 all complete the .dll call in 3x milliseconds.
    While the fact that they now take the same amount of time to complete
    would lead you to believe they are happening in parallel, the fact
    that it takes 3x milliseconds as opposed to X milliseconds means they
    are not.
    Has anyone ever dealt with these issues before? Is it possible that
    messing with the "execution system" for the vi will have an affect?
    What if different .dll methods but still attached to the same .dll are
    called from different threads? Same behavior? Is it a lost cause? Is
    there no way to make code within a single LabVIEW built .dll run in
    two different threads at the same? From what I understand this is
    easily doable with a normal (non-LV built) .dll.
    Please, if anyone has any advice in this area, let me know!!!
    Much appreciated,
    Jesse Hurdus

    Duplicate post.

  • Is there a way to bring the object to the front of the layer (via as3)?

    So, I have a line of buttons that pop up when moused over. Unfortunately, due to their proximity to one another, I have a lot of overlap occurring. Is there a way to bring the activated button in front of the others via as?

    Yep!
    Just like:
    var button1:Sprite = new Sprite();
    with( button1 )
    graphics.beginFill(0xcc0000, 1);
    graphics.drawRect(0, 0, 40, 23);
    x = 30;
    y = 30;
    var button2:Sprite = new Sprite();
    with( button2 )
    graphics.beginFill(0x000000, 1);
    graphics.drawRect(0, 0, 40, 23);
    x = 60;
    y = 40;
    addChild( button2 );
    addChild( button1 );
    button1.addEventListener( MouseEvent.MOUSE_OVER, emerge );
    button2.addEventListener( MouseEvent.MOUSE_OVER, emerge );
    function emerge( event:MouseEvent ):void
    addChild(event.target as DisplayObject);
    CaioToOn!

  • My imac 10.6.8 hangs on the spinning wheel after installing Samsung Kies (KiesMac_2-0-0-13023_10_1). I was able to restart ok after installation; I even moved some files from my Galaxy 3 to the imac. But on the next (and all subsequent) restart attempts,

    My imac 10.6.8 hangs on the spinning wheel after installing Samsung Kies (KiesMac_2-0-0-13023_10_1).
    I was able to restart ok after installation; I even moved some files from my
    Galaxy 3 to the imac.
    But on the next (and all subsequent) restart attempts, it hangs on the spinning wheel.
    How to fix? Thanx in advance.

    Mac OS X: Gray screen appears during startup 

  • Adobe Reader XI (11.0.08) doesn't create thumbnail (bitmap) using Microsoft Interface IExtractImage -- Extract on Windows Server 2008 R2, when exe to generate thumbnail is launched from Windows service.

    Adobe Reader XI (11.0.08) doesn't create thumbnail (bitmap) using Microsoft Interface IExtractImage --> Extract on Windows Server 2008 R2, when exe to generate thumbnail is launched from Windows service.
    But if exe is launched as standalone, then interface IExtractImage --> Extract, gives Bitmap to generate thumbnail of PDF document.
    Above problem occurs only for PDF documents, if we tried same with other software like CAD -CATIA it works without any problem.
    Is there any security concerns form PDF side, which doesn't allow to generate Bitmaps, if exe to generate it is launched form Windows service.

    It might be deliberate, Acrobat and Reader software is not intended to run in a service environment.

  • How do I embed bitmaps into a built (.exe) LabVIEW application?

    I am trying to embedd bitmap images (icons) into the exe file of a built LabVIEW application. I tried it, and got them in a "data" folder. I want everything in the .exe file, you know, just like C/C++ or just about any other programming language.
    If anyone has any tips, I would be grateful.
    I know about embedding the images in the controls, but that is not my goal. I need images as files to be embedded, somehow, into the .exe. The reason is I am using the picture control to read the images, but they are static once they are read. If it is possible for the picture controls to somehow retrieve the images from some other source, that would work also.
    Otherwise, if someone knows how to dynamicall
    y embed bitmap or other images into buttons in an array, that would be useful as well.
    Thanks

    > I am trying to embedd bitmap images (icons) into the exe file of a
    > built LabVIEW application. I tried it, and got them in a "data"
    > folder. I want everything in the .exe file, you know, just like C/C++
    > or just about any other programming language.
    >
    > If anyone has any tips, I would be grateful.
    >
    > I know about embedding the images in the controls, but that is not my
    > goal. I need images as files to be embedded, somehow, into the .exe.
    > The reason is I am using the picture control to read the images, but
    > they are static once they are read. If it is possible for the picture
    > controls to somehow retrieve the images from some other source, that
    > would work also.
    >
    > Otherwise, if someone knows how to dynamically embed bitmap or other
    > images i
    nto buttons in an array, that would be useful as well.
    >
    Actually, many C and C++ programs, like LV itself have folders of data
    that aren't linked into their code. But, if that is what you are
    looking for, one pretty easy way is to load the images into memory and
    place them into a 2D array of data, a string etc. Make an array of
    these and make the value default. At runtime, you can now skip the file
    I/O, or you can write the data to a temporary on launch and read them
    back whenever you like.
    Greg McKaskle

  • Bring Excel 2007 to the front when called from LabView v9 in Windows 7

    I am building a duplicate system using Windows 7, LabView v9 and Excel v2007.  The original system used WinXP, Excel 2007 and LabView v8.6.  The issue is that the original system was able to bring Excel to the front when called from Labview using the property node -application-> visible.  This new configuration runs Excel, loads the data, runs the macros but does not bring Excel to the front.  The icon blinks in the Win7 taskbar and when selected displays over LabView.  If I minimize the Labview window, Excel is there.  This leads me to conclude that Excel is visible, as requested but will not come to the front until selected from the taskbar.  The only differences, besides the versions, is the original system template files used the .xls extension in and was run in Excel in compatible mode.  At the customers request, the new system uses the .xlsm extension on the Excel template files.  I have tried using application.visible = True in the macro as well.  Could be a setting in Labview?  Could be a setting in Excel? Could be .xls vs. .xlsm? Or an issue with Windows 7 and the newer version of Labview. 
    HP workstation - Labview v9 - Windows 7 - Excel 2007 sp2
    Thank you in advance
    Stephen
    Solved!
    Go to Solution.

    I will try the windowstate change.  Were these done in succession? (i.e. property node -> property node -> property node) Or were they done along the way such as call the ActiveX open and a property node then in a worksheet modification area etc. so there was some time between calls? 
    I am not sure about the API since the discussion there is with regard to DDE.  (Taken from the link document:  If you want to call a DLL that contains ActiveX
    objects, use the Automation
    Open VI with the Property
    Node and the Invoke
    Node.).  I am calling Excel as an application not as a library call unless I am mistaken, which I could certainly be.  Are you thinking that once Excel is active through the Automation Open VI that a DLL call to set the application visible would work?  I may be trying this already but in Excel through the use of the macro I call from LabView.  It contains application.visible = True at the beginning before reading files and plotting data.  
    I may try sprinkling Property node with application->visible in various locations in the LabView diagram as I do update cells after the call to the plot macro.  The puzzle for me is the blinking Excel icon in the task bar.  This means active and running but not visible or something wrong as well.  There are a few #VALUE cells if not all test in the system are run.  Again not a problem in Excel 2007-WinXP-LV8.6
    Thank you again one and all.

Maybe you are looking for