Command line interaction - piecemeal!

Hi All
I am using "Calling System Exec.vi". Lets say you have a command line app where you have to interact with it over the command line (e.g the command line is the applications UI) The app prompts the user for input for example "Press L to load" and then provides output, e.g. "Load Successful" and these "questions and answers" may occur a number of times.
From what I can understand this VI is geared towards running the command line application and entering all input (standard inpu) and getting all output (standard output) within a single execution of the Calling System Exec.vi
What i need to be able to do is open the app but then enter the input and retrieve the output on a  piecemeal basis, at will, without having to wait for the overall execution of the vi to end and\or having to retrieve the standard output in one big lump when it does end. Is this possible, if so how?
The nearest analogy I can provide to describe what I want to do is when you are communicating with an instrument, you first open it and then you write to it (standard input) to get it to perform some action, and then you read from it (standard output) to get a response. Finally when your done you close it.
I have a feeling that this is looking like a DLL but because this is a third party .exe I cannot obtain a DLL so this is my only option.
Thanks for your help.

This question has been brought up before. Did you try a search?
http://forums.ni.com/t5/LabVIEW/Controlling-the-STDIN-STDOUT-of-a-legacy-application-in-LabVIEW/m-p/...

Similar Messages

  • Command-line interaction

    Hello,
    I am using LabVIEW 6.1 for an application on linux. I wish to use the command line 'sftp' client to do secure ftp transfers. I've been investigating how to do this with LabVIEW and I've come up with the following solution that *almost* works.
    I'm using a utility called "Expect" from expect.nist.gov, which is based on Tcl. I've created a script that works great when I execute it from my shell prompt. However, when I use the LabVIEW System Exec function, I can see the script executing, and then it simply stops when it attempts to spawn the sftp process.
    I was wondering if anyone knows of a way around this. I'm also willing to consider alternate approaches to my problem of interacting with a command-line application.
    Thanks,
    David Moerman, Advanced Measurments Inc

    Ah, a weirdness with sftp. I ran a test like this on my machine:
    # begin typing
    mkfifo /tmp/test
    ftp < /tmp/test
    cat > /tmp/test
    open ftp.ni.com
    cd /incoming
    ls
    ^D
    # end typing ^D, is control, D of course
    You should see the results as you type the commands to cat (cat keeps the pipe open, until ^D). You should be able to do something similar in LabVIEW with the pipe commands.
    As long as you don't close the pipe, then ftp should stay running, even if there is nothing to read in the pipe. FTP shouldn't close the pipe, rather it should wait syncronously until there is something to read.
    But when I tried it with sftp (from openssh), it would only work if it did not need to ask me for a password (either due to host based a
    uthentication, or having already provided a passphrash). If it needed a password, before it would read from the pipe, it would undo the stdin I specified (with the pipe), and actually read the password from the interactive shell. After correctly entering the password (from the shell that executed sftp, not the pipe), it would continue as normal and accept commands from the pipe.
    I hope some of this helps you in the future.

  • Sending Reporting Services report via the command line

    I would like to either execute a subscription that sends a report via email on demand.  That or just email the report without having to edit the subscription date.  Can this be done from the command line?  I see there is the rs.exe utility
    that allows you to deploy reports and run configuration commands, but I would like to execute and email the report.  Is this possible?

    The easiest way to run a subscription manually is to run the agent job in SQL server that is associated to the subscription.  You'll need to know the subscription ID to do that.  So, you could either run it through SSMS, or if it needs to be in
    command line, interact with SQL Server via command line and do so.
    You can use the ReportService2010 API methods and and powershell script to identify the subscription ID
    https://msdn.microsoft.com/en-us/library/reportservice2010.reportingservice2010.aspx?f=255&MSPPError=-2147217396

  • Interactive command line

    I want to build a program with an interactive command line. The screen should be split in two areas: on top of the screen will be displayed the program itself and in a line on the bottom of screen, should be displayed an interactive command line. This program will run in a console, so I cannot use GUI interfaces (swing, awt, etc). There is some way to do it? At the present time, my difficult is to positioning the input command line in the correct line on console view. I feel Sorry by my poor English.

    You'll need JCurses or something similar.
    http://sourceforge.net/projects/javacurses/

  • (sqr 2515) input required user interaction but user interaction was disabled by the -XI command line

    hi ,
    i'm getting below while running sqr in 3-tier mode using process scheduler.
    (sqr 2515) input required user interaction but user interaction was disabled by the -XI command line
    can any one suggest me to resolve this problem

    You should be able to get some more precise information from your Xorg logs, but I would bet it is related to the evdev driver. Some of the options in your xorg.conf no longer work with the latest version. For now you should be able to either map your mouse directly to the appropriate /dev/event* entry or change to the standard mouse driver, both of those methods should be in the wiki.
    You are supposed to be able to use the evdev driver without the input section of your xorg.conf by using dbus/hal autodetection, but AFAIK at the moment the xorg-server package still isn't compiled with hal support, so you would have to patch and rebuild the package.

  • Error Received When Trying To Create DSN From The Command Line

    All,
    Your help is greatly appreciated in advance. I am having trouble packaging Oracle 10G for a batch file deployment. Everything is done except for getting the DSN created which is causing me major problems. We am working with the Oracle 10G R2 10.2.0.1.0 Client on Windows XP Professional SP2. The Oracle database resides on a Windows 2000 Professional Server SP4 running Oracle 9i.
    Our Environment: I am creating two packages of the Oracle 10G client. The first is for a batch file distribution via LANDesk and the other package is for normal batch file install if someone from IT is installing this from a user's desk. Both scripts are really identical the only differences are how they are laid out. I only need help with the DSN creation as everything else is ready to go. I am going to focus on the Non-LANDesk batch file as once I fix this in one script the other one should also be fixed.
    The Problem: The batch script copies the neccesary files to the temporary directory. I then extract the setup files to the temp folder. I run a custom Oracle install using the RSP file from a recorded install. After the install is complete I copy the TNS Names file to the proper location. I then try to call a CMD file with the ODBC command seen below the main script.
    Script (May be easier to read if you download using link below):
    @ECHO ON
    ::This batch files installs Oracle 10G Release 2 Version 10.2.0.1.0 with a Custom Response File
    ::Installation is Interactive
    ::All files are extracted from the ZIP file via the 7-Zip command line tool
    ::The Net Configuration Assistant TNS Names File is copied to its proper location
    ::The CCR ODBC connection is created once the install is complete
    ::All folders used for installation are cleaned up-deleted
    @ECHO Setting Variables
    set NetworkPath=\\dc-landesk\SoftwareForLDAgent\Oracle10G-R2-10.2.0.1.0\Non-LD
    set DefaultPackagePath=C:\Program Files\LANDesk\LDClient\sdmcache\SoftwareForLDAgent\Oracle10G-R2-10.2.0.1.0\Non-LD
    set ExtractionPath=C:\Temp_Oracle10G
    set TempInstallFromPath=C:\Temp_Oracle10G\SetupFiles
    set FileFolderCleanupPath=C:\Program Files\LANDesk\LDClient\sdmcache\SoftwareForLDAgent
    @ECHO Creating Directories
    mkdir "C:\Program Files\LANDesk\LDClient\sdmcache\SoftwareForLDAgent\Oracle10G-R2-10.2.0.1.0\Non-LD"
    @ECHO Copying Files to DefaultPackagePath
    copy /Y "%NetworkPath%\7za.exe" "%DefaultPackagePath%"
    copy /Y "%NetworkPath%\CCR-ODBC.cmd" "%DefaultPackagePath%"
    copy /Y "%NetworkPath%\Oracle10GCustom.rsp" "%DefaultPackagePath%"
    copy /Y "%NetworkPath%\SetupFiles.zip" "%DefaultPackagePath%"
    copy /Y "%NetworkPath%\tnsnames.ora" "%DefaultPackagePath%"
    @ECHO Changing to Extraction Directory
    cd "%DefaultPackagePath%"
    @ECHO Extracting Files to path with no spaces
    "%DefaultPackagePath%\7za.exe" x SetupFiles.zip -o%ExtractionPath% -aoa
    @ECHO Please Open the "Task Manager" manager, Sort by "CPU" Descending
    @ECHO Watch Task Manager For Javaw.exe, press any key when the process Disappears
    @ECHO Install using Custom Response File
    "%TempInstallFromPath%\setup.exe" -responseFile "%DefaultPackagePath%\Oracle10GCustom.rsp" -force -silent -noconsole
    pause
    @ECHO Copying NETCA (Net Configuration Assistant) TNS Names File to proper Location in Oracle Product Directory
    copy /Y "%DefaultPackagePath%\tnsnames.ora" "C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora"
    @ECHO Creating ODBC Connections Using Oracle Driver installed by this Batch File
    call "%DefaultPackagePath%\CCR-ODBC.cmd"
    @ECHO Waiting 20 seconds before proceeding
    ping -n 21 127.0.0.1 >NUL
    @ECHO Remove Temp Files and Folders created during Install
    rmdir /S /Q %ExtractionPath%
    del /Q "%DefaultPackagePath%\*.exe"
    del /Q "%DefaultPackagePath%\*.ora"
    del /Q "%DefaultPackagePath%\*.rsp"
    del /Q "%DefaultPackagePath%\*.reg"
    del /Q "%DefaultPackagePath%\*.zip"
    rmdir /S /Q %FileFolderCleanupPath%
    @ECHO The Oracle 10G installation has been Completed
    pause
    ODBC Script
    odbcconf.exe /a {CONFIGSYSDSN "Oracle in OraClient10g_home1" "DSN=CCR|Description=CCR_data|SERVER=BWB|Database=CCR"}
    As soon as the command is called I see the following error message appear.
    "CONFIGSYSDSN: Unable to create a data source for the 'Oracle in OraClient10g_home1' driver: Could not load the setup or translator library with error code -2147467259"
    The really strange thing though is that if I let the main part of the script run (Not the ODBC call) and then immediately manually start the ODBC call script it works just fine. So, I don't really understand why the script can't add it itself. Or, I can go the Administrator Tools>Data Sources (ODBC)>and then add it manually which also works. I have tried just pasting the command directly in the main script, therefore, bypassing the call feature but it doesn't make a difference.
    Link (Zip with all scripts mentioned above): http://www.cbridegum.com/Fourms/Oracle/Files.zip
    Has anyone ever seen this kind of issue before? Does anyone have any idea on how to fix this? Any thoughts or suggestions would be great.
    Thanks so much for your help in advance,
    Clif Bridegum

    All,
    I thought it may be related to spaces in the path in which the script was called from. I tried having the ODBC command script in another directory but the same thing happens. It will give me the "CONFIGSYSDSN: Unable to create a data source for the 'Oracle in OraClient10g_home1' driver: Could not load the setup or translator library with error code -2147467259". As soon as the script is done running I can manually double click the script and it adds the DSN fine.
    Thanks,
    Clif Bridegum

  • Command-line SSL test in WLS6.1

    With Weblogic 6.0, I used to be able to test if SSL
    was working on the command-line by using this
    command:
    java –Dssl.debug weblogic.Admin -username name -password pw -url
    https://localhost:7002 PING
    This used to work fine.
    But now with WLS 6.1, the weblogic.Admin command
    refuses the protocol https and the port 7002. There's
    probably a bug. It's giving me an error:
    Failed to connect to http://localhost:7001 due to:
    [java.net.ConnectException: No server found at HTTP://localhost:7001]
    These commands work fine though:
    java weblogic.Admin -username name -password pw -url t3://localhost:7001
    PING
    java weblogic.Admin -username name -password pw -url localhost PING
    How else would you test SSL on the command-line?
    Don't tell me "write a utility", cuz none of my clients
    will want to do that. I have to find something
    that is ready to use out-of-the-box.
    Thanks a lot!
    Emmanuel

    This works perfectly!
    java -Dssl.debug=true
    -Dweblogic.security.SSL.ignoreHostnameVerification=true weblogic.Admin
    -username name -password pwd -url t3s://localhost:7002 PING
    BTW, I forgot to turn on the tunneling, so that's why
    accessing with http didn't work. (By default tunneling
    is off, so only t3 works for weblogic.Admin.)
    Thanks a lot, I'll be using this.
    Emmanuel
    Bernhard Hollunder wrote:
    Emmanuel Proulx wrote:
    With Weblogic 6.0, I used to be able to test if SSL
    was working on the command-line by using this
    command:
    java –Dssl.debug weblogic.Admin -username name -password pw -url
    https://localhost:7002 PING
    This used to work fine.
    But now with WLS 6.1, the weblogic.Admin command
    refuses the protocol https and the port 7002. There's
    probably a bug. It's giving me an error:
    Failed to connect to http://localhost:7001 due to:
    [java.net.ConnectException: No server found at HTTP://localhost:7001]
    The solution to your problem is rather simple:
    Just use -Dweblogic.security.SSL.ignoreHostnameVerification=true
    Best regards
    Bernhard
    ArcStyler - award-winning J2EE/EJB development
    -> CyberOne Award 2001
    -> Crossroads A-List Excellence Award 2001
    -> IBM Solution Excellence Award
    -> European Information Society Technologies Prize 2001
    -> Free trial-version at http://www.ArcStyler.com
    ------ < iO > ---------------------------------------------------
    Interactive Objects Software GmbH
    Dr. Bernhard Hollunder
    Basler Str. 65
    79100 Freiburg, Germany
    Tel: [+49]-761-40073-41, Fax: [+49]-761-40073-73
    mailto:[email protected]
    http://www.io-software.com

  • Need a command line switch to close Acrobat Catalog Index batch file

    I am looking for help with a command line switch.  I am VERY new to scheduling tasks and writing scripts.
    Our office created an Acrobat Catalog Index that needs to be updated on a regular basis.  I created a .bpdx file as follows:
    \\dept\SPDintelshare\Analysis\2nd Hand Transaction Logs\Secondhand Transaction Logs.pdx /rebuild
    This runs via Microsoft Task Scheduler from a .bat file as follows:
    "C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe" "C:\Documents and Settings\cutrone0999\Desktop\PawnIndex.bpdx"
    The batch runs just like it is supposed to, but it won't close when it is finished re-building.  I have tried using EXIT at the end of the .bat file and that doesn't work.  I also tried a force close for acrobat.exe and that doesn't work either.  The problem is that if I log off my computer the batch will run as scheduled and when I log back on in the morning the scheduled task shows 'running' and I have to end it.  Then I have to re-start my computer or I can't open any Adobe documents.
    If I leave my computer logged on, the batch runs as scheduled and when I log back on in the morning I have to close the dialog boxes showing the index re-ran and then close Adobe.
    I would appreciate any suggestions.  I have googled this every way I can think of and I'm not finding any results that are helpful.  Thank you in advance!
    Paula Cutrone
    Lead Crime Analyst
    Onondaga Crime Analysis Center
    Syracuse, NY

    Acrobat can be opened by a Windows batch process, but a Windows batch process can not trigger a batch process/Action within Acrobat.  It is possible with MacIntosh's Apple Script to open a PDF and run Acrobat JavaScript but not interact with Acrobat's Batch Processing or Acrobat's Actions. Note that opening a BPDX file is different than opening an Acrobat Seq file.
    The catalog/index scheduled update is not part of Acrobat "Batch Process" or "Action". The running of rebuilding of the catalog/index is controlled by the values within the  BPDX file. So if one opens the  BPDX file with Acrobat and a catalog/index is scheduled to be rebuilt or past the scheduled date and time, then the catalog/index build is submitted for precessing by Acrobat..
    Now the issue is how to close Acrobat after this processes has completed. Since Acrobat does not communicate with the Windows OS system, the Widows scheduled process has no way to know when this task has completed. Even though one can use JavaScript to test the status of a submitted Catalog/Index build/rebuild there is no communication of the submitted catalog job unless quired by Acrobat JavaScript. If you check the Acrobat JS API Reference you will see there are 2 possible results for a catalog/index rebuild, a completed rebuild and a termination with errors. One of these should require additional action.
    Further, a recent update to Acrobat JavaScript has added restrictions to using JavaScript to "closeDoc" method which may need to be addressed.
    It is also possible to open an FDF file and add/run JavaScirpts within a PDF, and again this is different than running a "Batch Process"/"Action" in Acrobat.

  • Can I print the last page of a PDF document using command line?

    Hi
    I am in a situation in which I constantly have to deal with multiple PDF documents and I need to print the last page in each of these, and ONLY the last page. The total number of pages will vary for each file, so the page number for the last page will also vary.
    I would really prefer to not do this manually, by opening up each file in the visible Adobe Reader window and then print.
    Question:
    Is there a way with Adobe Reader (maybe with the help of some other Adobe product) to print only the last page of a PDF document using some kind of command line without opening up the PDF file in the visible Adobe Reader window?
    I'm using Windows.
    Thanks in advance,
    Regards,
    Emil

    Thank you for taking the time to reply.
    I tried both ways and neither works.  It gives me a prompt box that I have to click "next" for every page but after going thru all pages, nothing is sent to the printer.
    Also, all directions I've read indicate it will print to the default printer.  If my default printer is on a network, will that cause problems....
    and...
    should I be getting a prompt box on every page?  I thought all this would happen behind the scenes and not force me to interact with every page.
    dc

  • How do I create a "command-line-interface" for a game?

    Hey people,
    For a game I need to make a DOS-like command-line-interface where the user has at least 3 options to answer with, does anyone know how to go about this?
    Hope someone here can help me out!
    Kind regards,
    Angela

    I'm not sure what part of this you are having difficulty with. Imagine for a moment that instead of asking for your end user to type something into a text-entry field and to monitor what they type (perhaps when the ENTER key is pressed), that instead you provide 3 buttons on your stage. Responding to a button press in this scenario is much the same as responding to typed user input - your movie does something based on user interaction. Going back to the user entered text scenario, a text or field sprite can detect the ENTER key being pressed and examine the string the user has entered, something like:
    on keyDown me
      if _key.keyCode = 36 then
        stopEvent
        sText = sprite(me.spriteNum).member.text
        case sText of
          "hack": -- do whatever you need to here
          "research":
          "wait":
          otherwise:
        end case
      else
        pass
      end if
    end

  • Compressing a large PDF document using command line or Java code without GUI operations

    hi,
    I have a programatically generated very large PDF file with lots of tables and cells in it. The size of the file is few MBs. Using Adobe pro, I am able to reduce the size of the PDF in KBs. I want to achive it either through a command line or using Java API without GUI interaction.
    I am using JDK1.6.
    Thanks.

    I think you need the scripting or SDK forums http://forums.adobe.com/community/acrobat
    As far as I know, Acrobat does not have command line operation

  • Command line program: can it implement keyListener??

    Hello,
    before I take the trouble to learn keyListener implementation, I am wondering if my program could even implement it. It is just a small game that just plays in the command window. I would like it to respond to the user pressing up, down, left and right keys. Is this possible with a keyListener or is this only possible in a 'windowed' application?
    And if you cannot register keys this way from the command line, then how would I make my program interactive. Do you know a link to an API description that explains how to set the program up to give a prompt?
    Thank you very much!
    -Mike.

    guess not...

  • Documenting command line arguments

    I'm very new to javadoc, and I'm trying to put together a set of guidelines for our developers to follow. One thing I came accross was command line arguments. If a main function is expecting command line arguments, how would this be documented, should @param be used? I didn't see anything about this in the guidelines sun has posted. Any help is greatly appreciated.

    This is my own personal opinion, so don't treat it as a "fact", but I don't think Javadoc is best suited for specifying command line arguments. You could do the following:
    *  Description of main() here...
    * @param args First parameter = xxx, Second parameter = yyy;
    public static void main(String[] args)
    }In this way you can specify all command-line parameters that are required in order to make the appliction run.
    BUT...
    Javadoc is meant more to be a programmatic guide to how to allow Java classes to interoperate. Java classes (mostly) will not care at all what the command-line parameters to the main invocation are. That is information that is only really needed to be known by the application executor at runtime.
    Therefore, for all my apps, I do the following to comment what types of parameters should be passed to the invocation of the application:
    * My App comments...
    * @param args Run application without any parameters to see list of all necessary command-line parameters.
    public static void main(String[] args)
       if (args.length < 1)
          System.out.println("This application allows the following parameters:");
          System.out.println("   Param#1 = xxx, <description>");
          System.out.println("   Param#2 = yyy, <description>");
          System.exit(0);
    }In this way, you do not clutter up the Javadoc APIs (used for classwise interaction) with command-line parameters, but the command-line parameters are still specified by "documentation" (running the application without any parameters).
    If parameters are optional, instead of mandatory, you could do something similar...
    * Documentation...
    * @param args Run -h as first flag for list of all optional parameters.
    public static void main(String[] args)
       if ((args.length > 0) && (args[0].equals("-h"))
          // Print out all possible parameters.
    }Anyway, this system has held me in good stead for the last couple of years.

  • Disco 4i Command Line

    All:
    Trying to locate ALL of the export options for the command line, docs don't show it all.
    E.G. to export to a .txt format you specify TEXT, .xls is XLS.
    So what are the others, in particular I'm interested in exporting to .prn which I
    can do from within the interactive app, however when I try to export type prn or print
    I get the invalid command line option.
    Thanks

    Please take a look at Re: Scheduling reports to run and export into a particular folder

  • Command Line Build Option

    Hello All--
    Is there any way I can invoke jdev.exe from the command line with an option to specify that it build my .jpr project file, and without invoking the IDE or requiring any other interaction? I'm new to JDeveloper, and I got used to this nicety over many years of using the -build option of JBuilder (which is now WAY too pricey for my needs). BTW, I know I can use an Ant configuration file, and that is specifically what I am trying to now move away from, and keep things as simple and streamlined as possible.
    If there is currently no way to do this, I'd like to add this to the feature request list. Maybe the developers could squeeze that in before final rollout :)
    Thanks.

    If this is a requirement what is wrong with using Ant? You can generate the Build.xml from the project by using New > Ant > BuildFile from Project so you don't have the pain of maintaining the basic script. Likewise you can use Ant as your build-system in the product as well if you only want to use one method. I find useful for making and testing all in one go.
    Anyway in answer to your question no - to see the command line options to the IDE type jdev -help from the command prompt.

Maybe you are looking for