LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

running C system exec in executable

I built a Labview program that calls a C code using system exec (connectivity->Libraries and executables->system exec.vi).
I uses Labview 8.0.When I run this program I can see the C window (console) when it runs. Now I have created an exe file to this Labview program to run it on computers wich do not have Labview installed on them. But when I run the program on such computer, I don't see the C window and I do not know whether the C program executes or not. How can I see the console?
0 Kudos
Message 1 of 5
(3,313 Views)
Hi Dror!

  I think that C program doesn't run....

   I think it's a problem of the installer you created (if you created one, of course...).   I use LV 7.1, but I hope it will be good also for 8.0.  When you launch "build application",  (tools-> build application), you go to "source files" tab, and you add the .exe file you need ("add support file..." button, then you just search for it). 

   There're further settings about this, that is where do you want to install this file.  When you decide where to install it, it'll be a matter of "System exec.vi" to call it from the right path, that you can wire to "System exec.vi".

   Maybe, another solutions is to set path environment variable to windows to point at your executable, but I think it's not the best solutions....

   Maybe I'm missing something, please let me know if this helps!

graziano
Message 2 of 5
(3,309 Views)

Hi Graziano, thanks for your help.

The problem is there is no such button as "add support file..." button. So I figured that in Labview 8 maybe all you have to do is put the exe file in the same directory as the Labview exe and it will work automatically, if I use the right path (I get the path using "current VI path.vi"). unfortunately, this doesn't work.

0 Kudos
Message 3 of 5
(3,301 Views)
Your problem is probably in how you are using current VI path. Before you build an exectuable, you will get something like 'c:\folder\example.vi'. When it's built, the path is 'c:\folder\app.exe\example.vi'. You need to do an extra strip path in the executable. What you can do to make both work is to use the Application property App.Kind and wire it to a case statement. In the Run Time System case, put the extra strip path.
Message 4 of 5
(3,298 Views)

Greetings!

        To further explain Dennis' statement, you can refer to the following links for the strip path.

http://digital.ni.com/public.nsf/websearch/686119C33C2C30C186256CA70081AC25?OpenDocument

http://digital.ni.com/public.nsf/websearch/FD7DE8BC8FFC256C862565F4006BE363?OpenDocument


Please let us know if this helps
Thanks much
Avi Harjani



0 Kudos
Message 5 of 5
(3,259 Views)