System exec+ problem

I'm using the system exec+ file to read in a msdos executable into labview, and to have it stay open until the user exits. Whats happening now is that when its reading in my program (awc.exe), it pops up an error message (in dos) that says "cannot find fonts." The font files are in the directory (c:\awc) with the executable. Do I need to link the font files somehow to awc.exe, or is this being caused by some other problem?

jdaltonnal wrote:
> I'm using the system exec+ file to read in a msdos executable into
> labview, and to have it stay open until the user exits. Whats
> happening now is that when its reading in my program (awc.exe), it
> pops up an error message (in dos) that says "cannot find fonts." The
> font files are in the directory (c:\awc) with the executable. Do I
> need to link the font files somehow to awc.exe, or is this being
> caused by some other problem?
Not sure about your awc.exe prog but I have had similar problems with
other exe progs.
The awc program is probably expecting c:\awc is set as the dos current
directory; I don't think exec+ does this.
Try this:
Open a dos session manually in Windows.
Don't change directory; keep the default one dos gives you.
Type in the
command you are passing to exec+; maybe c:\awc\awc.exe (or
just awc.exe if c:\awc has been set in your path?) What happens?. Same
problem? So now try running awc.exe again but first change to c:\awc
directory. Does it now work ok. If so you need to set c:\awc as the
working directory from within exec+. To complicate things you must set
this current directory in the same dos session as awc.exe is called so
you can't do this by running two exec+ commands.
I use the following technique. Write a .bat (just a text file saved with
the file extension .bat). You could call this awc.bat
In this file put something like:
c:
cd \awc
awc.exe
then call exec+ to execute awc.bat instead of awc.exe
You will need to tell exec+ to wait for execution to finish but I guess
you already know that.
Hope this works for you.
Dave.

Similar Messages

  • Problem: Using "msg" command with "System Exec.vi"

    I'm attempting to write some LabView code that takes advantage of the "System Exec.vi". At the moment, I've tried using it to ping machines, return the ipconfig and run through the example code that NI provides.
    I would like to use the "msg" command used on Windows operating systems to send out a message to multiple machines on our network at once. Warning them we're about to update a program and they should log-off, things like that.
    I tried using the "msg" command in LabView keeps returning errors. I also wrote a quick batch file as follows:
    @echo on
    cd c:\Windows\System32\
    msg.exe /server:localhost * test
    When I launch the batch from windows, it executes. When I launch it from LabView (using the System Exec.vi) it fails.
    Potential Quirks:
    I discovered in a different location that in order for a machine to receive these messages they need to have a registry entry in:
    "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" and have a DWord called "AllowRemoteRPC" = 1.
    Note that "/server:localhost" could be "/server:anycomputer" and the " * " is used as a wildcard which sends a message to anyone who is logged onto that machine. Also note that "test" is the message to be sent.
    Any ideas why I'm having a problem?
    tl;dr: "System Exec.vi" won't run the "msg" command. Why is this?
    - Mike
    ~~~~~~~~~~~~~~
    Current Setup:
    LabView 2010
    Windows 7
    Solved!
    Go to Solution.

    -> What versions of labview and windows are you on?
    LabView 2010 and Windows 7.
    -> Have you ever sent any commands out, or is msg the only one you've tried so far?
    I've successfully used the 'ping' command and also returned a standard 'help' command to LabView.
    -> Finally, in tools>>options, you may need to change your access settings under VIserver and Webserver.
    My VI server settings are allowing everything except "Show VI Scripting Functions, properties and methods"
    I have nothing configured for a web server, since I didn't plan on using it for this. Unless it has some sort of connection that I am missing.
    I'm attempting a work-around where LabView will generate a batch file to run from the desktop instead, since it seems that something is getting lost in translation between LabView and the command-prompt.
    - Mike
    ~~~~~~~~~~~~~~
    Current Setup:
    LabView 2010
    Windows 7

  • System Exec and Call Library Function problems

    I have working c code. The code connects to a server; makes a request; and gets a return.  It works from the command line. In LV there are problems.  If I try running it using the System Exec vi, I get the response I expect but not until the connection with the server is broken. This is unacceptible and not the way it works from the command line.
    If I try to use the Call Library Function Node, the response is even stranger.  I just call the routine that is supposed to connect to the server. It fails.
    I attached the vi's. As you will see, they are very simple.
    Attachments:
    AO call.vi ‏9 KB
    AO connect.vi ‏9 KB

    exo,
    Here is the example Mike was referring to.  Let me know if it helps at all.
    Brian T
    Applications Engineer
    Attachments:
    Calling System Exec.vi ‏31 KB

  • Call an external executable through system exec.vi. Problems:

    I have a executable (Fortran i think). I am using System exec.vi to call it and execute. I write a .bat file to configure the execution. It executes fine, but the executable pops up whenever labview calls it. I want to suppress the executable pop-up. Any suggestions ? Do i need to change this in the .bat file or is there any utility in Labview ? Let me know.
    Kudos always welcome for helpful posts

    Thanks for your reply. I guess I've not explained the problem properly. I run like 10 iterations, for each iteration a window pops up, some calculation takes place and it closes. This happens for 10 iterations. What I want to do is suppress that window from appearing to the front end user. I want all processes taken place in the background.
    Kudos always welcome for helpful posts

  • System exec cmd window

    Hello, first time posting a question!
    I have spent a good while trying to find an already posted answer to this, and looking on the wider web, hope i have not just missed it.
    I am using XP Pro SP3, LV 8.6.
    I am not very familiar with Windows command lines and structures etc. 
    I am using the System Exec VI to start a third party piece of software. I have wired the path in to the path input, and if i wire cmd /c start xxx to the command line terminal the VI will run and start the software application (xxx.exe). As the VI executes the cmd window clunks open and closed. If i run the VI without the cmd /c part of the command then an Error 2 is returned (as widely reported by others).
    Is it possible to open an application without the cmd window opening and closing?
    Using the System Exec VI it is possible to open NotePad just by wiring 'NotePad' to the comand line terminal. Is it possible to place the third party software somewhere, or register it with the OS somehow so it could be started in the same way as NotePad (i.e. without the cmd window flashing up)?
    Thanks...
    Blue 
    Message Edited by BlueTwo on 09-25-2008 09:22 AM

    Hi Thoric, thanks for the suggestions, Success!
    I tried the True boolean to the Run Minimized, but it did not help.
    Changing the Environment Path string to include the path to the directory containing the application did work (once i had worked out the syntax).
    On to the next problem....
    Cheers,
    Blue 

  • 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 you change the directory of system exec after it has ran once in the current vi

    Hi all,
    Attached is the sub vi that i am running in my main application.  I run it twice and change the directory of the file to run.  It appears that after i run this vi that i cant change the directory and it tries to run a file from the incorrect directory.  Does anyone have any advice on how to fix this issue?
    Attachments:
    system execute command.vi ‏41 KB

    matt198717 wrote:
    Hi all,
    Attached is the sub vi that i am running in my main application.  I run it twice and change the directory of the file to run.  It appears that after i run this vi that i cant change the directory and it tries to run a file from the incorrect directory.  Does anyone have any advice on how to fix this issue?
    I am not sure, if I understand exactly the problem, but do you really need the cmd /c start some_executable.exe. This executes a command prompt window, which executes another command prompt window, where your executable runs.
    You can just use cmd /c some_executable.exe some_parameters_if_needed, and you don't need any quotation marks, even if the executable has command line parameters. I you want that the executable runs in particular directory, wire this path to the 'working directory' of System Exec.vi

  • 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

  • How can I run different commands in the same system exec window?

    I want to open a window (cygwin) on my Xp machine and sent commands within that window. I then have to monitor what the responses are coming back into the window that was launched. Any ideas on how to do this? I have been playing with the system exec VI but can't seem to get it to do what I want. Any help would be appreciated. Thanks - Troy

    Hello,
    Have you tried setting the wait until completion to true on the System Exec VI?  If so, the LabVIEW documentation claims that the parameter "standard output returns information from the program you called if wait until completion is TRUE. If wait until completion is FALSE, System Exec returns an empty string."
    Could this be the answer to the problem of getting the data returned?
    I hope this helps!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Question about calling batch file by using the System Exec+.vi?

    Hi
    I have a problem about calling batch file. I know that the system exec is equivalent to "run" in Windows. I called the batch file c:\rtxdos\bs\ch0.bat successfully in the "run" but it didn't work in the LabVIEW program. The dos prompt had an error message "Bad command or file name" and it just happen when I call this batch file in LabVIEW. Why?
    Bill.

    Hi,
    Try to set the "working directory" parameter of System exec.vi to the directory where the batch file is located. It may help.
    Good luck.
    Oleg Chutko.

  • System Exec Hang

    Hi.
    Im programming a application for a analyser. I sample data and stores them via a system exec call to a databaseclient. The thing is that every time I get to the system exec the whole gui stops working until system exec is finnished. This is what I would expect. However when I then moved the system exec to another while loop and sent the data over to the new while loop even this caused the whole gui to hand.
    I then did some research here in the forum and found out that others had the same problem as I. It was in thouse threads suggested that a solution would be to create a second program that would take care of the system exec vi and then communicate with that program thru TCP-vi:s.
    Said and done. I made another program just for the system exec vi and set up a tcp between the two. To my dissmay I found that program #1 still hanged when program #2 executed system exec vi.
    How is this possible? Is there a way around this problem? Im getting desperate.
    (The application is running on a linux system)
    Best regards
    Andreas Beckman

    Hi.
    Zou: I must have some confirmation that the data has been sent. If I wire it false the standard error and standard output will be lost. I have however tried this and it does work if you have a very very smal command line input. But it seemed unstable and sometimes crashed the whole gui.
    Mike: Im using postgresql:s client called psql. If you know anything you can use for linux to hook up to a database let me know. Im quite satisfied with the psql & system exec vi combination just now. Reading data is ok because the user will anticipates a smal load time. But when I sample data in the background of the GUI and it hangs the user thinks the code is crap or the computer running it is too slow. And neither is the case.
    I have looked at the cpu consumption of booth the main GUI and the second program I wrote as well as the system exec vi and they dont use up more than maybe 1.3 % of the total cpu usage.
    All help apprciated.
    Best regards
    Andreas Beckman

  • System Exec output

    The example below ilustrates the problem I'm having.
    What I want to do is run an Executable, Wait until done.
    But the issue I have is when I run the wait until done with the flag to True the output is blank until it completes.
    When I runn it with the flag off I can see that my process is putting output to the console.
    Anyone knows how to Wait Until Done True and still see the progress of the process while it's still working?
    Thanks,
    Maciej
    Attachments:
    CommandLine.zip ‏13 KB

    Hi Smercurio,
    Thanks for that ... I did stumble upon that post and I appreciate you puttning down an example there on how to use the WinAPI.
    I've seen your example too which does seem to work to some extent but for example I've notided that you cant move or resize the command windonw now using your method ... and I simply got annoyed so I gave up.
    I think I'm just going to go for launching the the CMD silently and reading the console out either with WIN API or by reading an output file and I'll mimic the console in a LV textbox.
    I just wanted to knock up something up for a meeting I have in a few hours to present this ... and I didn't want to use a workaround which might have an issue it.
    Havent tried out the Open G yet ..but I'm low on time so I'll inspect all avenues when I get to implement the CMD line feature properly.
    I posted here in the hopes of getting an answer on how to get this to work without workarounds but it seems that it is just how the System Exec Feature is designed.
    Thank you,
    Maciej 

  • System exec in LV 5.0

    I'm trying to run a MSDOS based program in labview. Will I have to move to a certain directory where the executable is located? For example, to open labview.exe. I created a sequence which first inputs "cd\labview\" into system exec and then in another sequence frame have another system exec file with "labview.exe". But both system exec give me an error 42 when I try to use it in my application.
    In addition, after I open my executable, I want it to stay open until the user goes to file and quit within the program. There is no "wait until completion" option in lv 5.0. Any other suggestions?
    If you do have suggestions, some source code would be nice to see so I can follow along with what you are saying.
    Thanks a lot.

    Ok, I actually got that working. I found the system exec+ file and that has the wait function on it. Whats happening now is that when its reading in my program (awc.exe), it pops up an error message (in dos) that says "cannot find fonts." The font files are in the directory (c:\awc) with the executable. Do I need to link the font files somehow to awc.exe, or is this being caused by some other problem?

  • System Exec use all resources system if "wait until completion" is true !

    Hello,
    I use the function "System Exe" since a long time to launch various executables since Labview.
    The " waint until completion " boolean is true, because I have to wait the end of the external executable to continue.
    Big problem: the function " System Exec " use all resources system, by waiting for the end of the external program.
    Is it a bug of this function ?
    In my example, "System Exec" launches only the notepad (LV 8.2 on XP)
    Thank you for your suggestions.
    AC
    AC
    Attachments:
    Process.jpg ‏86 KB
    Bug system exec.vi ‏17 KB

    Thanks to both for your speed.
    In fact I had simplified my vi to target the problem.
    I use System Exec to launch another executable, made possibly with labview, but with passage of parameter. (Ex: - " / string:init ").
    In the literature Labview it was made with the method cmd / x / c start by putting twice the path of the executable.
    In this method a waiting time in the recent system exec function was effectively missing.
    But effectively, today, it is enough: "c:\myexe.exe" - " / string.init " to launch and to pass a parameter.
    You have both reason and I thank you sincérement.
    Very cordially.
    Sorry for my English....
    AC
    AC

  • -14001 error occurs from system exec.vi only on one machine

    I have a LV application that calls an executable that is bundled with the application using the System Exec command.
    I have tested it on our computers both pre-compiled and executable with no problems.  It has also worked fine on
    a variety of customer computers.
    But ONE computer from one customer returns a -14001 error.  It is a chinese language XP machine.
    Any info on this error?  Any idea how I might debug it?
    Thanks...
    -Umar.

    Error 14001 LabVIEW: Invalid refnum.
    Is the customer
    doing anything with DDE server, client, or functions? In every case
    that we have seen this error at National Instruments it was when a
    customer is using DDE. What is the operating system? In more than one
    case it was suggested that it was a problem with the operating system.
    In one case the customer said that it ended up beiong a Microsoft issue. You could also try contacting Microsoft and ask them if they can tell you how to set the NetDDE permissions differently.
    Vince M
    Applications Engineer

Maybe you are looking for

  • No internet in new home

    I can not get an internet connection through my Airport Extreme (.11g). I just stopped using an ADSL modem in my previous residence (in Australia) and now have a Motorola cable modem (SB5120) through Cox (in VA). I have turned off PPPoE on all my com

  • Why should I use Java

    HI, Someone asked me why are you using Java when you can use Visual Basic. Well, I ask this question in this forum ?? why ... please leave out the portablity part --j                                                                                    

  • ORA-01578 error

    Hi, I was trying to collect schema stats. The system occurred with ORA-01578 error. ORA-01110: data file 7: 'M:\ORADATA\PRODORCL\DATAMDM01.DBF' ORA-26040: Data block was loaded using the NOLOGGING option ORA-06512: at "SYS.DBMS_STATS", line 12887 ORA

  • .tld not generated for declarative component

    i have a declarative component. for quite some time i was racking my brain trying to figure out why my tag alternated between working fine and giving me the error: "Error: Encountered deferred syntax #{ ... ". i finally found out that when i generate

  • Check box in Grid for multiple selection

    Hi, Right now i am using dynamic code to generate grid for checkboxs(multiple selection) it is working fine but it is taking time to generate grid.Is there any method(MII 12.0 option) to display data along in the gird Thanks Ramesh