Labview 5.0's system exec vi

Anyone know of a better VI than "exec" to run a dos program.
The problem is, that the exec vi does NOT wait for it to complete.
I can see that its being called but it doesnt allow it to finish.
The use of a wait VI did not do anything, since the dos window
is already closed at that point.
Eric
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

The following has been tested on NT5.0 only:
When executing something from the command line use:
C:\>cmd.exe
Using the system exec VI feed in "cmd.exe".
Then follow it with the command you want to perform. Some notes:
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/? Get help on this command
Use the "|more" command to page the information.
THANK YOU
Michael Aivaliotis
Senior Test System Design Engineer
Microsys Technologies Inc.
Tel: 905-761-5250 Ext.22
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: August 4, 1999 5:44 PM
To: [email protected]
Subject: Labview 5.0's system exec vi
Message f
rom the Deja.com forum:
comp.lang.labview
Your subscription is set to individual email delivery
Anyone know of a better VI than "exec" to run a dos program.
The problem is, that the exec vi does NOT wait for it to complete.
I can see that its being called but it doesnt allow it to finish.
The use of a wait VI did not do anything, since the dos window
is already closed at that point.
Eric
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Deja.com: Share what you know. Learn what you don't.
http://www.deja.com/
* To modify or remove your subscription, go to
http://www.deja.com/edit_sub.xp?group=comp.lang.la​bview
* Read this thread at
http://www.deja.com/thread/%3C7oac6b%242j6%241%40n​nrp1.deja.com%3E
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Similar Messages

  • System exec and virtual key

    Hola,estoy tratando de usar el teclado virtual del windows con labview, he usado el system exec.vi para abrir el teclado virtual pero mi problema es como lo cierro, alguien me podria dar alguna sugerencia.

    Does this help?
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
    Attachments:
    osk.vi ‏14 KB

  • Calling a VI which uses "system exec.vi" with LabVIEW run-time engine as adapter

    Hi,
    My TestStand sequence calls a VI which includes a call to "system exec.vi". When I try to load it in TestStand and if LabVIEW adapter is set to run-time engine, I get an error message "Unable to load Vi...". If I switch the adapter to "Development system", then it works fine.
    Is there any way to use "system exec.vi" in a VI which is called in TestStand with LabVIEW run-time ?
    Thanks,
    Alex
    Solved!
    Go to Solution.

    Hi Alex,
    In you case, you are getting a -18002 error.
    The reason is explained in the following link:
    -18002 Errors in TestStand
    http://digital.ni.com/public.nsf/allkb/D82FEAF0B4BA293A862575710053E252?OpenDocument
    Please have a look at the 2nd reason. This is your case.
    Hope it helps,
    Regrads
    Julien De Freitas / Applications Engineer / Certified LabVIEW Developer (CLD)
    National Instruments Switzerland

  • Using Labview's System Exec.vi, is there any way to send multiple standard inputs to the same executeable console? Or is there a way using Labview to target the window for the executeable and send commands to it at will?

    thanks

    One suggestion is to write a batch (.bat) file that will call your executable. The batch file can contain all the standard inputs necessary to run the executable. Then, in LabVIEW, you can call the .bat file using the System Exec.vi.
    As far as your second question, there is no slick way to do this LabVIEW. You would probably have to call Window API functions using the Call Library Function utility. There is a set of VI's that call some of the standard API functions but I don't think they have what you want.
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&74DDE683A1AFF6988625683A000C0D73&cat=034E59A8530E09DF862568900018707A
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • Close a notepad window in labview after opening it with system exec

    Is there a way to close a notepad window within Labview after opening the window using the System Exec function?
    Also can Labview send characters to Notepad so they show up in its window?

    You can send a quit message to another window by using one of the VIs in a collection of windows interaction VIs called winutil32 (or something similar), but you will have to know the window name. Try searching for it on this site.
    You could probably also use the windows PostMessage function to send characters to another window, but that would require learning how to work with DLLs in LV, reading up on the function at the MSDN site and implementing it. Another, more simple but less secure, way is to use the windows Keybd_Event function to simulate keyboard clicks. If the notepad window has the focus, it will receive those clicks. Try searching this site or google for things like "Keybd_Event LabVIEW" or "simulate keyboard".
    Try to take over the world!

  • Open a *.exe applicatio​n in LABVIEW with system exec function.

    Greetings,
    I would like to be able to lauch a *.exe application and open a specific file within my labview vi. The trick is to avoid using active X control at all cost. I would like to use the system exec function but I couldn't quite get it to work.
    Let's assume that I would like to lauch wordpad.exe from my local drive. What are the params I need to pass? Thanks.

    You have to type in the command line of the System exec vi the name of the executable and eventually its path.
    Look at the attached vi that launches Wordpad as you asked.
    Attachments:
    wordpad_exec.vi ‏72 KB

  • How to Launch a "setup.exe" with LabVIEW app? No luck with System Exec.vi

    I've got an application that I'm trying to update with a separate LabVIEW application (the "Updater"). It's the "Check for Updates" capability you see on other major apps.
    Here's the glitch: When the Updater tries to launch "setup.exe" using "System Exec.vi", The installer seems to catch the attempt and pops a dialog titled "Windws XP Setup" saying "Please go to the Control Panel to install and configure system components".  The install does not begin and the installer closes (if it was ever open!).
    Running the same installer by double-clicking the "setup.exe" file from windows runs just fine.
    Here's the question: "How can a LabView app launch an installer?" 

    Could you show the code.
    Look at the path where you want to run the code.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Labview system exec slow on launching octave

    Hi everyone,i am using a v.i which makes more than one call to  octave through system Exec.vi,however the actual launching of octave seems to take some time and therefore increasing the total time it takes to execute this v.i,,,does anyone know of anyways of making the launching of octave when called by labview faster?

    Hi,
    first of all, you are talking about GNU Octave programm, right? Of course, the easier way is the System Exec.vi:
    http://digital.ni.com/public.nsf/websearch/8E19CA8​1874FFDD786256BE40066C151?OpenDocument
    Using this VI is like using command line and of course it's possible to have some delay before the programm is launched. Another way i through activex, but i don't know if it's possibile for Octave Programm. Here some extra info:
    https://decibel.ni.com/content/docs/DOC-9073
    I hope it is useful
    Mario

  • Labview system exec matlab

    Hi, I am trying to implement  a v.i where i call matlab  from labview to run a script using system exec.vi of labview. When i call the script using octave as the .exe to be called it works fine..however with matlab as the .exe it doesn't seem to work properly,,,.i have attached my v.i...please help  me figure what i could be doing wrong..thank you
    Attachments:
    PartialDebug.vi ‏14 KB

    yes it was just supposed to open matlab..i hadn't tried running it without any script..anyway i have figured it out..i was passing wrong commands to system exec..i used this link to figure it out http://www.mathworks.it/it/help/matlab/ref/matlabu​nix.html...thanks

  • Incomplete behaviour of System Exec VI when part of a LabVIEW web service

    Background
    I would like to execute arbitrary command line commands via a LabVIEW web service.
    Problem
    I have a LabVIEW project (attached) with a VI boot.vi that takes a string as an argument, which is handed over to the System Exec VI.
    This boot.vi works nicely: when I execute it with a string "test", it nicely executes my Ruby program "test.rb" because (i) I put the path of my the directory inside which test.rb resides into my PATH system variable and (ii) ".rb" endings are associated with Ruby programs on my PC. Similary, I can hand over the string "PATH", and it displays my PATH system variable.
    However, if I build and deplay boot.vi as a LabVIEW webservice, the situation looks differently:
    - the URL "http://localhost:8080/serviceManager/boot/PATH" works fine: the content of my PATH system variable is correctly displayed in the browser window as expected.
    - However, the URL "http://localhost:8080/serviceManager/boot/test" does not work as expected. The following error message (coming Standard Error output of the System Exec VI) is displayed: 'test' is not recognized as an internal or external command, operable program or batch file.
    My conclusion
    System Exec VI does make correct use of the search paths in the PATH system variable only when NOT executed as part of a web service. This is the case although even in a web service, the content the PATH system variable is KNOWN to the System Exec VI. Strange!
    Question
    Am I doing something wrong? Or is there a work-around?
    Attachments:
    serviceManager.zip ‏7 KB

    I just wanted to add my experiences to this thread.  We have a similar web application, and in fact it seems like we followed many of the same trials with the Internet Toolkit and G Web Server.
    As of today, I have migrated our GWS/cgi based application to use web services and the LabVIEW 2009 built-in web server.  It was a fairly straightforward move, though I did run into difficulties bridging the gap between our "normal" application instance and that of the web server that holds the web service VI's.
    Now I'm looking to move to LabVIEW 2010 and right away running into some problems.  While our web application has individual pages served depending on the web service called, it also uses a common pool of static web pages.  Typically these would install to the traditional "web root" folder and would be served from there.
    LabVIEW 2010 has the "Application Web Server" set up as a service that starts with the system.  That seems to work fine.  It also hosts its own configuration page through the "System Web Server" on port 3580.  This too seems to work, but has very few configuration options available.
    I have also spotted this article that discusses serving static pages from the Application Web Server:
    http://digital.ni.com/public.nsf/allkb/2D926638796FB20E8625778F00572966
    I believe I can drill down into the web server configuration (.conf) files and set things appropriately, but I think there should be more documentation available from NI describing the configuration options and how to support these in a deployed web application.
    James

  • Creating a delay in labview until a c program completes in system exec.vi without using "wait until completeion"

    I want to run two related C programs. The second one reads a text file that the first created. So I need to wait until the first is completed.
    I use "system exec.vi" and I know I can set "wait until completeion" to true, but this way I won't see the screen and the C program announcments. Someone has an idea?

    Hi Dror,
    my idea: just wait for the text file created by the first C program. Check for the presence of this file (maybe using 'list directory') or check for the size of this file...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Launching an app via system exec behaves differently to launching it outside LabVIEW

    Hi,
    My problem is as follows:
    I am trying to write some code to communicate with an Anritsu unit (MT1810A chassis with MU181020A plug-ins) via ethernet.  Anritsu supply a standalone app to control this instrument (MX180000A.exe) which gives comprehensive control over the setup & config of the instrument.
    I want to control this unit via LV however without recourse to their program.
    The only time that either MAX or LV seem to be able to successfully communicate with the unit is when the supplied Anritsu app is running.  Not only that, the app must be opened manually, ie by clicking on the exe (or selecting it from the Start --> Programs etc menu) or using cmd prompt with exe path.  Once the app has been started this way, MAX can talk to the unit and any LV code executes without error.
    If however I use the system exec vi within LV to launch the Anritsu app, the app opens as normal, is able to control the unit however MAX now has an exclamation mark on the VISA resource - status shown as:
    VISA returned this static device when finding resources, and MAX could use VISA to parse the resource name. MAX could not succesfully open a VISA session to the device.
    and it can no longer talk to the unit.  In addition any LV code now generates the following error when trying to open a VISA connection to the unit:
    Error -1073807343 occurred at VISA Open in BER Initialize.vi
    Possible reason(s):
    VISA:  (Hex 0xBFFF0011) Insufficient location information or the device or resource is not present in the system.
    So, getting to the point -
    - Why the difference in behaviour depending on how the app has been opened?
    (oh and of course, how do I fix it? )
    Regards
    Andy
    System is running XP, LV version 8.5, VISA 4.2
    Unit needs to be added to MAX using manual entry of raw socket, ie
    TCPIP0::192.168.1.21::5001:OCKET
    There are 2 network cards in the PC.  The unit is connected to card 2 which has been specified as the default in the network control panel.

    Hi,
    Here is a KnowledgeBase article that might help concerning the error you're receiving. Do you see this behavior on multiple PCs as well?
    Amanda Howard
    Americas Services and Support Recruiting Manager
    National Instruments

  • System exec, How I say to open one file and make operation in external program?

    Hi,
    I got called an external program with the system exec.vi, but i would like the program open the file saved in the other window, i can get the file path, but how Can I put the file path in the external program and the program open the file and I tell (in this case compile), since i open one file code c and only i must to open and say to the program 'compile' and then close external program.
    Any help?. Thanks.
    Attachments:
    system_exec.GIF ‏8 KB

    Hi Fonsi,
    System Exec.vi will allow you to run commands like launching a program easily but it is difficult and many times not possible to execute commands within an application.
    A better way maybe to approach this though ActiveX. Please look at the following example that uses ActiveX to communicate with Excel.
    Writing Rows to Excel 97 and Excel 2000 Using ActiveX
    If you are not familiar to ActiveX and LabVIEW, please read the document below:
    ActiveX and LabVIEW
    I hope this
    helps.
    Sincerely,
    Feroz
    National Instruments

  • System Exec error message help

    I have a piece of code as shown in the attached jpg.  And I have it deployed just as shown, without the error cluster being wired.  I use this piece of code to ping a server to see if it's there, meaning to see if it responds with a correct ping response.  If so, I then move forward with writing a data file to that server that I write every half hour for days or weeks at a time.  If the ping response is not correct, I simply go on and return one half hour later with even a larger (appended) data file to write.  My main intent is to not have my code sit and wait, trying to write a file to a server that might not be there...  
    I've used this same code and technique for years without fail.  Until recently.  When it did finally fail, I got the worst of all possible outcomes where the ping command itself caused my code to hang with error messages I will provide shortly.  And I'm hoping someone can tell me what would even cause a message like those below in the first place...  The entire goal of using this ping of the server was to avoid having the "write file" command get held hostage by the server not being there...  But if the ping command itself causes the code to put up error messages (and no one is there to monitor this typically) then that constitutes a situation where my cure became my problem.  
    See in the jpg where I use
    ping -w 200 -n 1
    followed by the name or IP address of the server.  (that's what comes out of the "ping" control you see in the jpg).
    The -w 200 modifier is a 200 ms timeout to wait.
    The -n 1 is the number (1) of echo requests to send.
    When this code fails, it puts up, in sequence, four messages like the one below.  Note that this code is running from an executable that would be found on this Windows XP machine at
    C:\Documents and Settings\xxxxuser\My Documents\my_executables\
    The first of the four messages, each of which you have to click OK to to see the next one, is as follows.
    The file C:\Documents and Settings\xxxxuser\My Documents\my_executables\-w could not be opened.  No application was found to open that type of file
    The second message is identical to the above except the "-w" is replaced by "200" (without the quotes).
    Same with the third message except the "200" is now replaced by "1" (without the quotes).
    Same again with the fourth message except the "1" is now replaced by the full name of the server, eg., "myserver.abc.com" (without the quotes).
    Clearly the System Exec.vi (see that in jpg) is parsing up the ping command, but skipping over the "-n" component(???), and it thinks it's supposed to try to open some non-existent file at the same file location as the executable that is executing my code.  
    I get this result rarely so it's hard to figure out what's going on.  Anyone have any ideas what might cause such an error and any hints on how to prevent this show stopping error from occurring???  Do I perhaps just need to practice better programming and wire the error cluster on System Exec.vi???  
    Any thoughts or help would be much appreciated...  thanks.. bob.. 
    Attachments:
    ping pic.jpg ‏19 KB

    It appears to me that your ping command is getting mangled on its way to the command shell, like something is interrupting it or trying to run at the same time.
    When it says the executable cannot be opened, I believe that is because it's trying to process that character or string as its own separate command, instead of as a flag of your ping command.
    I don't know why that would happen or what outside program could be interfering with your call to the command shell.
    I do think that Wart's suggestion is a good one: the cmd /c part should send the command through a slightly different channel that may preven this interference.
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • How do I determine expected output size for System Exec vi

    I am running a DOS exe from a Batch file using the System Exec vi. My exe is programming software for a microcontroller and passes data to the programmer via the serial port. When I run the batch file externaly to LabView it works fine. When I run the same batch file using the System Exec vi I get an error from the programmer app (DOS app). Not every time but usually within 20 attempts. I reduced the execution priority of my vi's to give more time to the DOS window. This seems to have helped but hasn't solved the problem completely. I read in the help file that LabView will run more efficiently if you specifiy the expected output size in the System Exec vi, but how do I determine it? Is the expected output
    size the size of the bat file I call?

    > I am running a DOS exe from a Batch file using the System Exec vi. My
    > exe is programming software for a microcontroller and passes data to
    > the programmer via the serial port. When I run the batch file
    > externaly to LabView it works fine. When I run the same batch file
    > using the System Exec vi I get an error from the programmer app (DOS
    > app). Not every time but usually within 20 attempts. I reduced the
    > execution priority of my vi's to give more time to the DOS window.
    > This seems to have helped but hasn't solved the problem completely. I
    > read in the help file that LabView will run more efficiently if you
    > specifiy the expected output size in the System Exec vi, but how do I
    > determine it? Is the expected output size the size of the bat fi
    le I
    > call?
    If you think it is due to timing, and you wish to yield to the DOS app,
    don't just lower the priority of LV, but use Wait ms to put overeager
    diagram elements to sleep and limit their loop rate. Use the task
    manager or performance monitor of the computer to determint if this is
    the issue.
    Greg McKaskle

Maybe you are looking for