5
votes

I'm trying to open a .exe to program a PLC from LabVIEW. I have the .exe included in the project files, it's also included as a source file, so it gets installed within the install directory when installing this tool. The issue is sometimes when opening (and all the time when closing) I get the Error 2: Memory Full error.

enter image description here

Here is a snippet of the what I'm currently doing using the SystemExec.vi included with LabView:

enter image description here

And you can see here that I have the files included in the dependancies (sorry for lines, don't want to show certain .vis and certain file names for client sake):

enter image description here

Let me know if I'm doing something wrong or if there's a better way to launch an external .exe from LabView.

Thanks in advance!

1
Aside from fixing the cause of this error message, how is this code supposed to exit? If you're stopping it with the 'abort' toolbar button you may be leaving things in an indeterminate state. Have an event or condition that passes a True to your loop's stop terminal. - nekomatic
There are multiple event structures within the while loop that open sub vis. There is also an event of a panel close that will exit the program when the windows x is clicked. - biggi_
I hope you mean multiple event cases not multiple event structures. Are you then using the Quit LabVIEW function to exit? The clean way to do this would be to trap the Panel Close? event (note the question mark), perform any cleanup such as closing files and references, exit from all loops, and only then Quit LabVIEW, and for easier development, only do that if your program is running as a built application. The Panel Close event case may not execute properly unless you add code to stop LabVIEW exiting first: zone.ni.com/reference/en-XX/help/371361K-01/lvprop/… - nekomatic
Yes cases, not structures. And yes I'm using the question mark one. - biggi_

1 Answers

5
votes

Try changing your input string to "cmd /c fploader.exe"

Using the System Exec VI is not the same as typing a command into a command prompt; instead, it is like typing a command into the "Run..." window.

See here: http://digital.ni.com/public.nsf/allkb/EA1600EBA422E97286256AA20073C616

Edit: Here is how you could create the string command with the complete path of your exe: enter image description here