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 

Similar Messages

  • "System Exec" Output to same window that called it

    Hi,
    I have a complicated program, but let me break it down to what matters.
    My labVIEW application (exe) is called by the command prompt. Does some calculations based on arguments I passed to it.
    The thing I can't quite seem to figure out, is how to export those results to the very same command prompt that called it. (Not a new window) I'm hoping to run my program in the background, and so I'm hoping to avoid anything fancy, and just want the results in the same window that called it.
    Any help would be greatly appreciated.
    Regards,
    Nyne
    Solved!
    Go to Solution.

    There really isn't an easy way to do this. On Windows you can have several options:
    Try to use the Windows API Console commands (never really had that much luck with these).
    Use the .NET console class (I doubt this will work).
    Use a trick I had suggested in copying text from the console to just paste text directly into the console window. Attached is a VI that does this. Note that this is in 8.2 so I am unable to connect the error cluster due to a bug in 8.2.
    Attachments:
    Paste to Console.vi ‏18 KB

  • 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

  • System Exec FFMPEG

    Hello!
    I'm trying to merge audio and video previously adquired in labview, and I can do it with the FFmpeg tool by typing
    "ffmpeg -i video.wav -i video.avi -c copy output.avi" on the FFmpeg console.
    I would like to do it programatically, so I think I need to use the System Exec Utility. I have tried this:
    But it does nothing. I think I'm not setting the input line correctly. Do I have to set the command in the Standar Input as I do in the command line from the FFmpeg Console?
    I would be greatfull if anybody could help me.
    Thanks in advance for your time!
    Guille.
    Solved!
    Go to Solution.

    Hi,
    Perhaps you could try testing System Exec.vi using simple commands. 
    Read this link: http://digital.ni.com/public.nsf/allkb/8E19CA81874FFDD786256BE40066C151 , I believe there are 2 screenshots which shows 2 different methods of writing command using system exec. What I can see from your screenshot is that you're using both at the same time. Can you try using the method found in the link (1st screenshot) instead?
    Here's an example which you can refer to and play around with: https://decibel.ni.com/content/docs/DOC-1109
    Warmest regards,
    Lennard.C
    Learning new things everyday...

  • 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 - Not finding a file

    Hi,
    I am using the system exec vi to call a patch file that prints a .txt. or .prn file depending on the request of the user. I was ahving some issues with it not being able to find the batch file however I have solved that but now i get this error from the standard output string:
    Error: could not open print_test.txt for reading
    print_test.txt is the file it is trying to print. I am not sure what is causing this
    any ideas would be appreciated
    Thank you

    Hi Adam,
    Thanks for the post and I hope your well today.
    There are maximum limits, imposed by Windows , on how long you can have an ASCI file name and the full path as follows:
    MAX_FILE_NAME is 256
    MAX_PATH is 260
    I beleive this is correct ... however does seem to be some confusiong. You can make your own mind from a very resources...
    Forum
    Max length of VI file paths and file names
    http://forums.ni.com/ni/board/message?board.id=170&message.id=28207&requireLogin=False
    Hope this helps alittle,
    http://www.british-genealogy.com/forums/archive/index.php/t-8252.html
    msdn
    Naming a File or Directory
    http://msdn.microsoft.com/en-us/library/aa365247.aspx
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • System exec function

    could someone give me a hint as to what the 'expected output size'
    input on System Exec refers to? I'm using it to run another program
    which will download some data for me to work on with labview. I dont
    expect it has anything to do with the file size of that data?
    Also, is there a way I can tell when the program I have called has run
    to completion? Or can i just use the 'run to completion' boolean to
    prevent the next part of the VI executing before the data has finished
    downloading?
    Thanks, Paul.S

    "mechatron" wrote in message
    news:[email protected]..
    > could someone give me a hint as to what the 'expected output size'
    > input on System Exec refers to? I'm using it to run another program
    > which will download some data for me to work on with labview. I dont
    > expect it has anything to do with the file size of that data?
    A called program might pass some information, but when the application
    terminates, the memory with this information is released. So, the program
    passes a pointer to a string, but the memory it points to is removed.
    To prevent this, the caller passes a pointer to a buffer, and the program
    fills this buffer. Then it passes the same pointer back, and the caller can
    read the message in it's
    own memory. This buffer needs to be large enough.
    If the program don't pass anything (you don't expect anything), just put the
    "expected output size" on the default value. A buffer that is to big can't
    do any harm.
    > Also, is there a way I can tell when the program I have called has run
    > to completion? Or can i just use the 'run to completion' boolean to
    > prevent the next part of the VI executing before the data has finished
    > downloading?
    Yes, that's what is it for.
    > Thanks, Paul.S

  • How does System Exec VI identify Standard Error within cmd code?

    I am using the System Exec VI to control a USB to serial adaptor program header, I have sucessfully written a .BAT file to call the CMD commands (the .exe I am running uses "-option" commands and the help file reccomends to do so) and it functions perfectly. My only issue is identifing errors. The "Standard Error Out" on the System Exec VI never outputs anything. Yes the wait until completion is TRUE and my standard output functions fine. I am curious as to how the System Exec VI  identifies errors from the command prompt and  why my errors are not showing up. I am currently using multiple match pattern string functions to identify the possible errors from my standar output for the time being but I would like to simplfy my code a bit and clean it up if at all possible. Not to mention there are most likely several other errors that could occur that I may have not identified. Some examples of stanadrd output errors i can get include include:
    {C:\Documents and Settings\owner\Desktop\RACK LINK>C:\DCRABBIT_10.66\Utilities\clRFU.exe "" -s "0":115200 -v -vp+ -usb+
    .bin not found
    C:\Documents and Settings\owner\Desktop\RACK LINK>pause
    Press any key to continue . . . }
    or
    {C:\Documents and Settings\owner\Desktop\RACK LINK>C:\DCRABBIT_10.66\Utilities\clRFU.exe "C:\Documents and Settings\owner\Desktop\RACK LINK\Calibration_v030.bin" -s "4":115200 -v -vp+ -usb+
    Rabbit Field Utility v4.62
    Installing Calibration v0.3.0
    Sending Coldloader
    Error: No Rabbit Processor Detected.
    C:\Documents and Settings\owner\Desktop\RACK LINK>pause
    Press any key to continue . . . }

    I think you should use error handling in batch programming, see this link http://www.robvanderwoude.com/errorlevel.php
    CLA 2014
    CCVID 2014

  • System exec

    Hello,
    I have a problem with the system exec, in many cases i will not get the output from the command.
    I am executing many snmp commands and when i will execute them manually i will see the output but with the system exec the standard output will be empty.
    Is there a way to make sure to "pull" out all the exec output?

    Hello mike,
    The problem is that it will show me the output in some cases but there are many others when the output will be empty.
    I will attach the vi but you will have to have Alvarion's equipment for the snmp script to work.
    Attachments:
    SNMP script_exe.vi ‏30 KB
    SNMP script_excute.ctl ‏5 KB

  • System exec running C code

    I am running C code using the System Exec vi.   It executes some of the code and the stops.  The code executes from the terminal everytime without a hitch.  Could there be a conflict between system calls in C and the System Exec?  Other ideas and suggestions are appreciated.

    How do you determine that it stops? What does happen and what not? Do you have control of the source code of the command line tool, so you can add console output to debug what happens?
    The most likely reason is that your program expects certain conditions, such as process authorization, environment settings, etc, that are normally existent for a console style application started from the shell, but not as child process when started from a GUI application. The process started with SystemExec inherits all its environment, authorization and what else from the LabVIEW process and not from the unix shell, that you would normally use to start a consolde application. This has usually no consequences and in Windows it actually didn't make much of a difference until Vista was released. Under Unix/Linux things can be a bit more complicated as some of that security was built in from beginning.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Access system exec standard out before function returns

    Hello,
    It would be enormously helpful to me if I were able to parse the output from the system exec vi before the invoked command fully returns. Is it possible to do this?
    Thanks

    Just about any question you can think of has probably already been asked before.  So doing a search will get you the results without relying on someone repeating themselves 100 times.
    Unfortunately, the search engine on the forums is not that great.  If you search for a pluralized word, the singular form of the word doesn't show up.  And of course there can be misspellings which can keep you from find useful information.
    Also, if you used your exact title as your search phrase, then you probably used too many words.  Sometimes adding too much to the search restricts it to the point that you can't find anything.  So the best strategy is to start with just a couple, then if you find the search yields too many results, then narrowing that with another word or two based on some of the words you just saw in the results.
    Also, sometimes it is better to go to Google and search for your subject.  The discussion forums are all indexed by Google, and it does a much better job catalogging the search terms then the forum's search engine does.
    Please forgive us if we say "do a search!"  It just seems that so many times, people come on, ask a question where we know the answers exist and that if they just did a good search for 5-10 minutes they can find them, but a lot of people just go the lazy route, don't bother to search, and ask the question.

  • 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

  • How do I set upmy Imac to allow using both my computer speakers and a Bose SoundLink system as outputs at the same time.  I can use one or the other, but not both.

    how do I set up my Imac to allow using both my computer speakers and a Bose SoundLink system as outputs at the same time.  I can use one or the other, but not both.  From systems Preferences I must select one or the other.  I want both to work all the time.

    Hi,
    I would recommend you to use 0FI_AP_4 rather using both, particularly for many reasons -
    1. DS: 0FI_AP_4  replaces DataSource 0FI_AP_3 and still uses the same extraction structure. For more details refer to the OSS note 410797.
    2. You can run the 0FI_AP_4 independent of any other FI datasources like 0FI_AR_4 and 0FI_GL_4 or even 0FI_GL_14. For more details refer to the OSS note: 551044.
    3. Map the 0FI_AP_4 to DSO: 0FIAP_O03 (or create a Z one as per your requirement).
    4. Load the same to a InfoCube (0FIAP_C03).
    Hope this helps.
    Thanks.
    Nazeer

  • How to capture keyboard strokes while focus is on an external app. Opened with system exec

    Hi to the Forum,
    I have an application that runs an external app. Through system exec, while this application is open the user needs to input a 6 digit serial number using the keyboard, I need to capture in parallel that information on my main VI in order to perform some information validations, such as the six digits were entered, the serial number is not repeated etc. I have read other post about the same issue but did not found a practical way to achieve a solution, please help with an example of how to do that as I'm on the final stage of the project.
    Thanks in advance for your time and help.
    MRDK

    Hi MRDK,
    You can/have to use Connectivity>>Input Device Control palette functions.
    Attached is the simple example.
    Regards,
    Yogesh Redemptor
    Regards,
    Yogesh Redemptor
    Attachments:
    Get Keyboard Event.vi ‏15 KB

Maybe you are looking for

  • What to use for this problem?

    Hi. I have a data set containing 500 parameters (for example). The data set should be clustered to 3 or more clusters and all of clusters should belong to 3 and only 3 groups (it means several clusters may belong to one group). My problem to solve is

  • Full import/export from 10gR2 to 11gR1 / ORA-39083: Object type PROCACT_SYS

    Hi, I did a full db export/import (data pump - skipped existing objects) from 10gR2 to 11gR1 (win2003 server). it looks like everything went fine except with this error: is this a serious error? what should I do to fix this error? ORA-39083: Object t

  • Invalid handel error?Urgent

    Hi, I am frequently getting invalid handle error in my jsp response from the server.I had created the connection pool which I use in my jsp pages.The pool has the application scope.In certain pages I use multiple statements,after processing the logic

  • Toolkit Installation - I can't find it

    Hi, I installed the math interface toolkit 1.0.2 and I can not find the functions. I have reinstalled several time. In fact, I reinstall the whole  LabVIEW product, and try  to install the toolkit again, but to no avail. When I checked the Measuremen

  • Need info regarding ECC 6.0

    Hi All, Can you please provide me some good links regarding the addtional functional feature added in ECC 6.0 terms of FI & CO when compared to 4.7 version.