LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview executable immediately quits on WIndows XP

 Greetings,

 

Short description of the problem: I build an executable of my Labview 2010 (32-bit) project on my Windows 7 (64-bit) development machine and it runs fine. When I attempt to run the .exe on a different Windows 7 (32-bit) machine it runs fine. When I try to run it on any Windows XP machine, the executable starts and then quits immediately. No error message is reported and it appears that the VI doesn't ever start executing. My installer includes the LV2010 run-time engine and NI-VISA run-time. The application window opens just for a split second, just long enough to see the front panel briefly, before disappearing.

 

Background: This problem showed up early in the project but it went away when I installed Service Pack 1 for Labview 2010. I assumed it was some obscure bug. I went through several revisions of the project over the next couple of months. Most of the target machines run Windows 7 so I never spent a lot of time testing the executables on WinXP but all of the early versions worked fine. At some point in the development the executables stopped working on Windows XP. I haven't made any changes to the build specifications or installer that I can find.

 

I've found the latest revision of my code that produces an executable that works on WinXP. There are a lot of small changes between that version of the code and the earliest non-working version I have but none of them seem like they should cause such a fundamental failure.

 

I cannot even use the debugger on the XP target machine. The window will appear and wait for me to start the debugger. As soon as I start execution (either locally or via the debugger) the application quits immediately and closes the connection with the debugger. I cannot probe any signals or set any breakpoints. Nothing in the VI code executes prior to quitting.

 

No errors are generated, no crash message, nothing in the Windows event log. Just...poof.

 

Any suggestions?

 

Thanks,

 

Dave

 

0 Kudos
Message 1 of 12
(5,025 Views)

More info:

 

I just downloaded the 30 day evaluation version of Labview 2010 and installed it on my Windows XP test machine. The code for my project runs fine in the development system but when I build the executable it still fails with the same symptoms.

 

At least this rules out any kind of Window 7->Windows XP issues. I still don't have any idea what is causing the built executable to quit before it even starts running.

 

Dave

 

0 Kudos
Message 2 of 12
(5,002 Views)

Under the build settings for Source File Settings, did you uncheck the "Use Default Save Settings" and uncheck the "Remove Front Panel" and "Remove block diagram" check boxes for all the VI's that show their front panel at runtime? If you don't do this, the exe will exit without displaying. This is a known compile and EXE runtime issue.

0 Kudos
Message 3 of 12
(4,986 Views)

Those problems automatically get me thinking of race conditions. If a recompile can make it work/break it for a machine it feels like some compiler reordering is the reason, thus some race in the source.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 12
(4,969 Views)

In addition to race conditions, bad (or non existant) error handling is also known to create such issues. Please note that executables do not have "automatic error handling" so maybe errors are simply not reported, but the code exits execution.

Sources of errors like this are often:

- File IO and plugins (relative paths may change in exe!)

- Trying to load components which require recompile (which is done in the development system without notifying you, but the RTE cannot do this). Refers to plugins mainly.

- Using DLLs which are either not found or have invalid parameter settings in exe (unhandled exception of either the DLL itself or the LV RTE when accessing return values).

 

Are you sure that you have all components installed on each machine (please remember that there are modules requiring dedicated RTEs)?

Can you try building the exe on a XP machine? Does it behave differently?

 

thanks,

Norbert

 

PS: I am not aware that there is a general issue. If this issue is persistent on your machines, i would take a look into user rights on each system. Does the behavior change if you meddle with the user rights?

 

[EDIT] PPS: Another source for the issue might be virus scanner and/or firewall.....

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 12
(4,960 Views)

I was able to find the problem by selectively disabling parts of the code but I still don't understand why it's not working. It turns out that the offender is the "IP to String" sub-vi. I've used this dozens of times without any problems. If I remove this sub-vi everything works fine. If I put it back in I'm back to a non-working executable. The code always runs fine in the development system.

 

I don't think it's any kind of race condition. I moved the sub-vi out of its usual place and put it outside of all of the while loops and wired the output of the sub-vi to my main while loop so that it executes before anything else. This still causes the built executable to quit immediately. If this sub-vi is present anywhere in my code I get the failure. And I still don't understand why it wasn't a problem in earlier versions of the project.

 

I tried making a new VI that does nothing but run this sub-vi and display the output on the front panel. This application works fine even when I build it into an application.

 

I built my own replacement for "IP to String" and now my program runs fine. I'd still like to know what's going on though because this is such a random failure. Very unsettling to have such a minor sub-vi cause a complete failure, and one that's platform dependent as well.

 

Thanks for everyone's input.

 

Dave

 

Message 6 of 12
(4,936 Views)

After searching through the forum, this seems like the thread that most resembles the problem I'm having.

I'm a beginner to using the LV application builder so it's possible that my problem is a newbie one.

 

I wrote a very simple VI that takes in text from a data file and then parses it to extract header info and XY data. I also display the XY data as a graph and have the option of exporting the extracted XY data to a simple spreadsheet file. The VI works fine on my development machine, the VI build works fine and the installer build works fine. However, when a colleague tries to use the executable (after using the installer I created for him) on his Win XP machine (no LV installed) then I run into an issue. The exe opens and displays the front panel for about 12 seconds before quitting, with no error messages. During those 12 seconds, the exe works fine. I can open a data file to parse and it correctly parses it and displays the data as an XY graph. 

 

My VI uses an event case inside a While loop. I do not think that the problem comes from my code since the exe closes after 12 seconds even if I stop the VI running using the red stop button. 

 

Thanks in advance for any input.

 

Garrett

0 Kudos
Message 7 of 12
(4,793 Views)

most likely this is a path problem!  XP and 7 have different default directory structures.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 12
(4,791 Views)

Thanks for the reply. I also use a Win XP machine for developing my VI, so paths shouldn't be an issue. Although my project files are on an external (USB) hard disk so maybe there's some strange effect coming from that.

 

Seeing as this problem is occuring with my first attempts to make an executable, I will try to make another simpler, "Hello, World" type exe to see if I still have the same problem.

0 Kudos
Message 9 of 12
(4,781 Views)

OK, I made the simplest VI possible: just some plain text on the front panel, no code on the block diagram.

I created a project with just that VI, compiled an executable, compiled an installer, and sent the installation files to my colleague. I use a Win XP machine and so does he. He does not have LV installed.

 

The installation goes fine, the VI starts up and then spontaneously quits after 12 seconds with no error message. Nada.

 

My debugging ideas going forward are:

 - try to play with the "Source File Settings --> Use default save settings" checkboxes, as suggested by another user in a previous comment.

 - ask another colleague with WinXP and no LV to test the VI's, to see if the problem is somehow linked with my first colleague's machine.

 - am pretty stuck for ideas after that.

0 Kudos
Message 10 of 12
(4,774 Views)