Does System command pipe VI bufferizes data?

Hi,
I have some questions about Pipe VIs on Linux:
1)In my project I open a system command pipe vi that opens another
program's shell. Then, using the write file descriptor, I write a
series of commands in a loop. I could observe that only when I close
the pipe those commands are really sent to the shell, OR when,
aparently, something like a  "pipe vi buffer" overflows.
2) In the same situation, I would like to use both the write and read
file descriptors. The write pipe vi sends a command to the program's
shell and them the read pipe vi reads the shell's results. I tried of
many ways, including forcing serialization (open, then write, then
read), but it didn't work at all. I could see that the write worked but
the read can't read the results.
The most interesting is if I use a ls -l in the open system vi, I can read the directory contents on the read vi...
What's wrong? Is that a problem of LV or Linux? Or of the another program's shell?
What can I do to make sure that a command is issued as it is writen to the pipe?
Thanks in advance for the attention,

Hi, ratem.
I've just created a little code snippet (below), and I'd like you to tell me what happens when you run similar code on your machine. I run the code, read from the FIFO in a terminal, and I'm able to see the data I wrote before the pipe is closed. Does your behavior differ with this code?
Message Edited by sarahk on 04-09-2006 12:36 PM
Message Edited by sarahk on 04-09-2006 12:36 PM
Sarah K.
Search PME
National Instruments
Attachments:
write with while.JPG ‏13 KB

Similar Messages

  • Linux system command pipes

    I am trying to integrate TCL scripting code with  LabVIEW in a way I can send every TCL command separately and read back the results (under Linux platform).
    From searching and reading information on web pages I found out that the best way to do so is by using the System command pipes .
    I tried to do it but with no success I couldn't write or read from the pipe. I also didn't find any example how to implement the command pipes.
    Does any one has any example (labView 2009 Linux) of opening a system command pipes reading  data from it and writing data to the pipe?

    Hello
    The examples are for named pipes and it works fine for passing data to the pipe and read the data from it.
    But it cannot processes commands. In order to write Tcl commands I need pipe that is able to interpreter commands.
    So I tried the system command pipes but it can only process bash commands like ls or pwd but I didn't find a way to open the tclsh and process commands in TCL.
    I had another problem with concatenating commands got error 6.
    I attached the file I created can you find what I am doing wrong?
    Attachments:
    Test command Pipe.vi ‏15 KB

  • System_Exec and Open System Command Pipe hangs in Solaris

    I'm using LV 7.1.1 on Solaris and I'm having major problems with the System Exec function in combination with Open System Command Pipe.
    1. The program has to run different stuff in parallel but the System Exec won't run in parallel with Open System Command Pipe. It immediately hangs and neither function ever returns. LabVIEW must be killed.
    2. After executing Open System Command Pipe, stopping the program and then executing a System Exec, that too hangs. The external script called by Open System Command Pipe is no longer running but obviously LV leaves something behind anyway. Close Pipe doesn't seem to clean up everything. Again, LabVIEW must be killed.
    3. Also, regardless of any System Exec call, the first time Open System Command Pipe and Read Pipe is executed it takes a very long time to get the result. After stopping the program and restarting it, it's much faster.
    Has anyone else experienced these problems?

    I'm having the same difficulties... tried many things, with no luck...

  • HT5048 10.7.3 does not show up on my system update and it says that all system is all up to date even though my mac is 10.7

    10.7.3 does not show up on my system update and it says that all system is all up to date even though my mac is 10.7. all updates do the same thing. 
    thank you

    Click on the Apple icon (upper left-hand corner), select About this Mac, and post the OS X version number.

  • Does not make sense in evaluating data using isnull(Command.name)

    Hi,
    Environment:
    Os - Windows 7
    Crystal report developed in CR2008 - .rpt developed and running successfully here with the same formula.
    VS2010
    CRforVS2010
    Does not make sense in evaluating data using isnull(Command.name)  function when the report is integrated into VS2010 using Crystal report for VS2010 (13.0.2).
    But the same report is running in crystal report 2008 (12.3.0.601)  report Dev environment when previewed.
    Please reply me ASAP.
    Thanks & Regards,
    Mani G.S.

    Thank you and are you using the MS SQL Native 10 drivers.
    And still need to know if you are using ODBC or OLE DB?
    Can you copy the SQL in and use the PUBS sample database? Or import the xtreme.mdb and use one those tables. You can get it from our sample reports:
    https://smpdl.sap-ag.de/~sapidp/012002523100005852352008E/cr_xi_xtreme_rep_smpl_en.zip
    Thanks again
    Don

  • How does client invoke an operating system command in the Server machine.?

    Guys,
    Is there any way that a client could trigger an operating system command on the Oracle Server machine?
    I've a VB scipt file in the server machine.My requirement is to execute that VB file on the server machine.(The script would essentially create a DSN on the server machine).
    The normal way to execute a VB script would be to specify the name of the file in the command prompt.(If my VB script ONDEMAND.VBS resides in C:\ONDEMAND folder,I need to execute the statement
    "C:\ONDEMAND\ONDEMAND.VBS" in the command prompt to get it executed.)
    I would utilise the SQL command below
    HOST C:\ONDEMAND\ONDEMAND.VBS
    to invoke it programatically(from a PL\SQL scipt).
    Can someone help me in utiliting HOST command in Oracle(Or by any other means) for a client database operation to execute an Operating system command in the Oracle server machine?
    Thanks,
    Bhagat

    Hi Bhagat,
    This has been asked several times recently:
    Executing Shell Script from PL/SQL Block
    Fire an executable using oracle
    Cheers,
    Colin

  • Gnome Panel applet that shows output of system command.

    Hi all;
    Because of the recent hostile takeover of #archlinux channel by tilling WM fanatics..    I will ask here..
    Does any one know of a Gnome Panel applet that shows the output of system command of your choice?
    For people who Conky is a bit too much and they only want a simple piece of data available (like what is the current IP on ppp0 interface) like me..  this is a necessity.
    If its not in existence I would probably make one.. shouldn't take long, I also would like to hear if there is any interest.
    Thanks

    That's exactly what I was looking for!  Thank you!
    Changed code to:
    $dism = "X:\Windows\System32\Cmd.exe /c start CMD /k dism /apply-image /imagefile:D:\W7x86.wim /index:1 /applydir:C:\"
    And voila, new window opened with the live output of dism.
    new... and have a glazed over look about my eyes to prove it...

  • Executing system commands like cd on Linux from Java Code

    Hi,
    I need to execute a few system commands (like cd, ls, tar, etc.,) on RedHat Linux 7.1 from Java code. Any ideas plz.
    best wishes,
    Issac

    Since this thread mentioned using the DOS START command
    from an exec(), I was wondering whether anyone else is
    seeing the odd behavior I am.
    Most of the examples showing how to read stdout and stderr
    while the process is running show simple loops that use
    getInputStream and getErrorStream and do read's until they
    get back -1. Most of these examples are insensitive to the
    state of the Process.waitFor that happens elsewhere and sort
    of rely on the -1 and the waitFor happening roughly together.
    Whenever I use this technique to launch an arbitrary DOS
    command (e.g. Runtime.exec("dir")), it works fine, and
    everything seems to terminate as expected.
    However, when my command is something like:
    Runtime.exec("cmd /c start my.bat")
    where I deliberately use the START command to fork off
    a different process, something odd happens.
    Those simple read loops get an initial burst of stdout/stderr
    bytes from the "start" part of the command. But then eventually,
    these loops do a "read" which blocks on those InputStreams. Now,
    even if my Process.waitFor returns (because the start returned
    immediately), those read loops stay blocked **until that script
    started by 'start' runs to completion**. It is like the child
    of the child is holding those streams open somehow.
    I found that by doing something like an InputStream.available() or
    a BufferedReader.ready( ) check before dropping into the read,
    and allowing the Process.waitFor completion to exit those read loops,
    them I get what I expect -- namely immediate return from the START,
    but apparently complete copies of stdout and stderr.
    Curiously, in the case where the reads block until the child process
    started by START terminates, they still don't get the child's/child's
    stdout and stderr. It is just a long duration thread block that
    yields no data.
    Can anyone explain what is happening to a
    Process.getInputStream( ).read()
    when the process immediately does a START and returns? Why would
    the read( ) stay blocked when the START finished launching a new child
    process?
    ... ron cain

  • How to Run Operating System Command Before/After Message Processing SAP PI

    Hi,
    We are trying to execute multiple commands via "Operating System Command Before/After Message Processing".
    When we use single command say for example cp or mv (copy or move) the commands get executed fine.
    eg: cp %F /var/opt/data/outbound/Test/Dummy.txt 
    /this works fine/
    when we club commands together or try to redirect the outputs of commands, none of the commands get executed.
    eg:
    cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
    or
    wc -l %F > /var/opt/data/outbound/Test/Dummy.txt
    Is it possible to execute multiple commands or redirect the output  of commands without using a shell script? The PI server we are working on iis hosted on UNIX environment.

    Hi Harleen,
    try like this
    cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
    instead of semicolon try this
    (1) &
    command1 & command2
    Execute Command1 and then execute Command2
    (2) &&
    command1 && command2
    Runs the command2 only when command1 doesn't Complete successfully
    (3) ||
    command1 || command2
    Runs the second command if the first command had an error
    (4) ()
    (command1 || command2) || (command3 & command4)
    Defines the order in which commands are to be executed
    Regards
    Suraj

  • File Receiver Adapter:Run Operating System COmmand after message Processig:

    Dear All,
    I have gone through this link
    [http://help.sap.com/saphelp_nw2004s/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm]
    But i have a problem.
    In the scenario which we have, File name is DYNAMICALLY GENERATED by a UDF
    I want to call the file at run time after message processing via Command Line and execute some os commands.
    But since the file name is Dynamic....How will i call the file at run time in Command Line:
    SYNTAX: %f(FileName)
    How will i specify the file name in the above syntax as the file name is Dynamic and not constatnt.
    Please Advice.
    Senthilprakash.

    Dear All,
    Yes just now i got the answer from this thread[OS command line script - Need help;
    Actually i have another doubt now
    In REVEIVER FILE ADAPTER:
    when we give Run Operating system Command After Message processing
    does the OS command get executed after the output file is placed in the Receiver folder/server or before its placed in the receiver folder?
    Regards,
    Senthilprakash.

  • Operating System Command After File Processing in Sender File Adapter

    Hello guys,
    actually we have different interfaces, and the client to take all the files from only one directory, for example D:/DPI.
    Unitl now we had one adapter for every file with the content conversion, so we didn't have problems with that. Now we have the problem that we sould maintain an order processing files.
    We thougth that an idea could be to execute one file pointing to D:/DPI and at the Operating System Command put like: copy D:/DPI/file.txt D:/DPI/outbound/file.txt, so when file is executed, we move the next file to another directory where is pointing the adapter. Doing this we have an error on the adapter giving us the message: Could not process due to error: java.lang.NullPointerException
    We are using a Windows.
    There is anyway to do in our way, or there is a better solution to resolve this problem?
    Any other idea to do this?
    Many thanks in advance.
    Regards,
    Xavi.

    Helo Guys,
    maybe I haven't explained well.
    We have one directory with different files. We have one adapter for every file( we need for the content conversion ) using NFS and all the adapters are pointing to the same directory.
    The problem is that if we have files A.txt, B.txt and C.txt we need to process in an order.
    And the problem we see is that for every file we have one adapter, so for example if we process file A.txt with one adapter, when this part is finished, we want to process file B.txt with another adapter, and the same for the rest of the files.
    So the idea we had is to create another directories, and when A.txt has finished move file B.txt to another directory.
    However this way is not running, if we log on the PI machine and execute cmd, we can do a copy of one file from one directory to another, but when we put this sentence in the adapter in OS command if we see the adapter log we see an error executing the OS command, but we don't know what is the error, there is no more information.
    There is any way to do this or maybe we have to manage in a different way?
    Many thanks in advance.
    Regards,
    Xavi.

  • Run operating system command for sender File adpter (NFS)

    Hi All,
    iam doing a file to RFC scenario, using 'Run operating system command' in sender file adapter to change the file name while archiving (after processing completed).
    I mention OS command like this:
    sample_server\scripts\Test\Rename.bat"
    Rename.bat file calls a 'perl script' code.
    when i run interface, could see below statement in adapter log ->
    "Execute OS command "
    sample_server\scripts\Test\Rename.bat"
    but the script was not run and file name was not changed.
    Please advice what could be the problem?
    Does this mean script executed successfully?
    Do i need install perl software on XI server, even perl script (.bat file) is executing on sample_server?
    Thanks in advance..
    Regards,
    Rajesh

    Hi,
    Just check the following URL and give it a try again :-
    Executing Unix shell script using Operating System Command in XI
    Hope this info Helps..
    Regards,
    Aditya

  • RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESSING

    hi.
    just i want to know what is the purpose of run operating system command before message processing,after message processing under file sender adapter.
    waiting for your great answer.
    bye.
    regards.
    seeta ram.

    Hello Seeta,
    let me see if I give it using a simple scenario that I implamented : i nedd to transfer a very large file from one server to the other by XI.
    to save space and network traffic I use an OS command before picking up the file to run a zip command to zip the file.
    after I transfer the file to the target server I run another OS command after the transfer to unzip the file.
    now to your second question:
    the before Os command on the target server is used mostly for checks (make sure there isn't a file by that name or backing up existing data)
    and the after sender OS command is usualy for backing up or erasing existing files (cause it is done only after the first part was finished succesfully).
    Uri Lifshitz.
    p.s.
    there was a blog obout this titled "XI as a huge file mover"
    and you can see a description and my scripts at https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/03/additionaltipsforusingXIasahugefiletransfer%28withbatchscripts%29&

  • Problem with zip operating system command

    Hello,
    i have the following configuration in the file receiver adapter:
    Directory: /tmp/
    File Name Scheme: %name%.txt
    Variable substitution:
    Variable Name: name                 Reference: payload: record,1,name,1
    Run Operating system command:
    /usr/bin/zip /tmp/%f.zip %F
    The execution is succesful, but i have a small problem. The file name is "file.txt.zip", the .txt should appear but i dont know how to skip it, I have tried so many ways but it doesnt work, I should receive a file called "file.zip" With a file inside in txt format...
    Thanks,
    Luis

    Hi Sriram,
    Thanks, but that wouldnt work out, Im using the %f for my file name, so this move command shouldnt work for me, because my filename changes in every execution, so I cant write something like this: mv file.txt.zip file.zip
    The only solution I see would would be a command which deals with strings and that could remove the four last characters of "%f"..but I havent found anything for doing it.
    Regards,
    Luis

  • Executing Operating system commands in ABAP

    Hi
    I want to execute a unix operating system command in an ABAP program. I remember seeing code which executes an operating system command. Could any please let me know about that code?
    Thank You.
    Eswar

    Hi,
    you can try something like this.
    data:cmd(254) type c.
    data: RESULT(255) OCCURS 100 WITH HEADER LINE.
                cmd = 'ls'.
    ** Execute command
      REFRESH RESULT.
      CALL 'SYSTEM' ID 'COMMAND' FIELD CMD
                    ID 'TAB'     FIELD RESULT-*SYS*.
    Kostas

Maybe you are looking for

  • Finger Print Login in Win 8.1

    I have entered my fingerprint to login to Windows in PC Settings -> Sign In Options However there are no options during login. I tried swiping my finger over the reader, nothing works. I dont see the light blinking too. I have configured for fingerpr

  • Connecting a new iMac to a telly

    Hi all, The college I work at is going over to Mac from PC editing systems. What's the cheapest way to connect a new intel iMac to a television so that you can monitor video editing in Final Cut? (I don't want to go via a camcorder). Thanks, Sean

  • Intel Smart Response and RAID bios option

    hi unfortunately, i have lenovo M5400 and i am disappointed that i have another problem with this notebook. i cannot enable intel smart response in intel rapid storage because i ave no RAID option in bios, only compatible/ahci. why? how to fix it?

  • Will there be any slowness

    Hi, I have a dynamic sql and it's partly shown below. key_col column is indexed in the table. But I'm searching for a '#' for breaking that column into 2 parts. If I'm doing this against one varchar2 indexed column in the table, will it lead to the s

  • Why does Photoshop randomly change Smart Object sizes when transforming?

    This has happened to me forever and every so often I ask to see if there's a solution. It seems like a bug. Here's the process. Select smart object (via panel or Move tool) Free Transform Select top left anchor (happens with any btw) Change measureme