Sending linux command through labview

Hi,
I am using Labview Professional Development system and I have to create a VI that opens a command prompt window to session into a linux based device.
I have used System Exec to open the window and got to "root-bash#" prompt.
Question:
- How do I send command to the linux prompt ? Do I need to buy the labview linux package for Pipe VIs ?

How about a TCP connection?
Ctrl-Space (open quick drop) and TCP give me the TCP vis ....
Greetings from Germany
Henrik
LV since v3.1
“ground” is a convenient fantasy
'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Similar Messages

  • Executing a linux command through flash lite

    Hello All,
    i want to know one thing.. : is it possible to execute a linux command through flash lite?
    I mean, say, in linux at the command prompt if i want to change the date and time then i will execute command date 082110452009.00 to set
    21 August 2009, 11:45:00 .. i want to do this through actionscript2.. first i wil provide a UI asking the user to set date, time, year.. once he clicks OK i want to execute the above command with the user input..
    This is because currently i m running this application on an embedded linux device which doesn't have a real time clock.. i mean once i switch off and ON the device the date and time will set back to default value 01 Jan 1970 as it happens in linux..
    any suggestions?

    get the the inputStream of the runtime object after executing the command.
    now use the readLine() function until it becomes null.
    egs: with reference to ur code.
    InputStream is=p.getInputStream()
    while(is!=null)
    String s=is.readLine();
    if the command don't execute try giving the full path also like /sbin/ls -l

  • Send Ascii command Through RS232 Interface in labview

    Hello,
    I tried to use labview to control the CD2A Compudrive.
    Actually I found the driver of CD2A online in the following link
    http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=266
    but however, I still can't use this driver to send the command and adjust the parameter.
    p.s. Use only "CD2A Setup" or "CD2A Init" should be enough to set the parameter and command, right?
    The command code written in the CD2A Manual is, for example,
    <STX>ST600<ETX><LF>   which is Start of Message,Start Position 600 nm, End of Message, Line Feed
    I've tried to send this using MAX (Measurement & Automation Explorer), but the signal I got back is
    −1073807298
    = Could not perform operation because of I/O error.
    For the command in the driver above,
    The code is written in number form of ascii format  >> e.g. <STX> = ascii 02
    and The Code is written as
    \02ST600\03\r
    But sending this code>> nothing happens
    Which is quite confusing for me.
    1. Is it general to write \02  to send <STX> signal??
    2. actually <LF> = ascii 10  >> so why does it use    /r         instead?
    3. What should I do, is my format correct???  I can't even send one signal to operate it at all.
    Thank you very much for help

    A string control can set for 4 different types of display. When you right click on it, you can select Normal, '\' Codes, Hex, or Password. Normal is ASCII character and the unprintable characters such as <STX> cannot be entered. The <STX> is hex 02 so you enter this as \02. The '\' says to interpret the next byte as hex. A <LF> is not ASCII 10 at all. It is hex 0A. For readability, it was decided a long time ago that certain '\' characters could be represented a bit differently. If \n, that was hex 0A. A \r is hex 0D or the CR. You can find documentation on these stand C Escape Sequences. In LabVIEW, you can type \0A into your control and it will automatically convert or \n.
    Your other option is to use hex display. You just enter all of the hex equivalents though it makes entering the ST600 a bit more difficult in your case.
    I'm not sure if the data entry in MAX is set for '\' Code Display and whether it is interpretting your string correctly. I know that the Basic Serial Write and Read example in LabVIEW is set this way and you might want to try that.

  • Executing sudo linux commands through a JSP page.

    Hi,
    I need to execute some superuser commands through a JSP page under Linux.
    I added users apache and tomcat to the /etc/sudoers file with no password prompting.
    My JSP page works fine with any usual linux command, but when I call a “sudo cmd” I have a message (when reading the ErrorStream instead of the InputStream) that “sudo can’t be executed because it needs a tty” even when I call the shell before the sudo command.
    Here is a piece of my code (very basic):
    String cmd="linux_cmd";
    Process proc = Runtime.getRuntime().exec(cmd);
    InputStream stdin = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stdin);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null)
    out.println(line);
    Is there any way I can make sudo calls from a JSP page ?
    I know that making root calls from a web application is a bad thing, but for now security is not my concern.
    Thank you for any tips.

    JavaFan2 wrote:
    In fact, I help supervising a student project who is supposed to write an admin application to offert graphical interfaces for some security and system tools under Linux (like fdisk, iptables etc) using J2EE, ... something like Webmin.
    As I said, I know that is has a huge security risk but this app has the only purpose of learning J2EE, no security issues are treated.If you want to say "I will leave my office door open because there's no security risk in doing that" then that's a valid statement. But what you are trying to do here isn't the equivalent of leaving your office door open. It's the equivalent of finding a master key for all the offices in the world. And as such it is in fact a serious security risk which should not be circumvented.
    And no, it's no good saying "But I'm only going to use this all-powerful master key to open my own office door". If you get the key then anybody else can get the key too.

  • Sending ASCII commands through USB hub

    I am having issues connecting to hardware. I have 3 types of hardware connected to a Serial to USB converter hub. 2 of the hardware take ASCII commands while the other does not. I am able to communicate with the hardware individually without the hub but when I connect the hardware to the hub and the hub to my computer, it does not work. I do not think MAX sees the hardware connected. Any ideas?
    CLD Certified 2014

    When you say "hub", are you talking about a product like the QUATECH USB to serial adapter (4 ports)?
    If so, then each port has its own serial port assigned to it.  You should be able to communicate through it using a terminal emulator, such as HyperTerm, TerraTerm, ProCOMM, etc.  
    You do have to install the driver for the box and you can also configure the starting COM port number.  For instance, Port A on my box is COM-3.
    You can open multiple ports in parallel, as long as you select different COM port numbers.
    MAX should see the serial ports.

  • Run ssh command in labview

    does anyone knows how to run an ssh command in labview?
    I know how to run some linux commands in labview but my problem is when I try to run an ssh command ...
    thks
    JP

    Unfortunetly, I don't know how to script in a password for ssh. SSH closes the stdin and re-opens the tty that you are logged in at. This is actually a security feature. As well as a way to send stdin to remote programs (otherwise your password would get in the way.)
    If you don't need to ssh to a remote host, and you want to chmod something on the localhost, you could use sudo instead. With sudo you can specify certain users (or all users) to run certain commands. (so you could make a shell script to chmod for you).
    I don't know your exact needs, but I think that a public/private keypair could still work. In your authorized keys file on your "root" account, you can even specify that "this public key does not get shell access, and can only execu
    te this one command." This would probably be the most secure method. But it requires the user to have the correct private key as well.
    If you know that won't work for some reason, then maybe you could setup a inetd process that will execute a command whenever someone connects to a certain port (then you could use LabVIEW's TCP VIs).
    Or, if you are not connecting remotely, you could setuid your LabVIEW executable (A VERY BAD IDEA!).
    Also, it is possible to script "telnet." It would of course transmit your root password as plaintext, but trying to script your ssh session would also embed your password in your LabVIEW VI. Out internet toolkit for LabVIEW has some helpful telnet VIs.
    May I ask why you want to chmod something on a remote system that requires root? Sounds like maybe you should create a LabVIEW application on the remote side that acts as a daemon (running as root) and accepts connections and commands and does the chmodding for you.
    -Duffey

  • Send serial command in VBAI based off of calculation

    I am attempting to send serial commands through VBAI based off of a previous calculation step. For instance, my application will determine an objects mass center and then determine if it is to the left or right of my origin. From here, I would like to be able to send a serial command based on the left/right result. The command will be sent to an arduino which will controll a servo left or right based on the command it recieves. I think I have everything but linking to serial command to the calculation result figured out here. Any feedback or help with this would be greatly appreciated.

    In the Serial step, when you are sending a command (i.e. you press the "Send Command" button), you can press the "Insert Result" button to have the serial command you send out conatin a result from a previous step. There are even formatting options so you can have numeric previous measurements formatting into the string as you want. If you need to send results from other states, you can use variables to pass data between states since the Serial step doesn't currently support accessing results from other states.
    Hope this helps,
    Brad

  • Execute Linux Command via JSP

    How can I execute Linux commands through a JSP page on a Red Hat Linux 6.1 Machine using Tomcat 3.0
    Please Mail your answer
    [email protected]

    Hi Nick,
    Thankx a lot, for suggestion,
    I wanted to make a page which gives me a text box to write a command and below it shows the result of that command,
    Say , I m in directory "/home/dhiraj"
    and I write in command text box : "pwd"
    it should give me the currrent path in result , which I can show in form of HTML as Results ,
    (may be in a String form..)
    same way if I write in command box : "ls -l"
    it should Return me (say a String) the directory listing of the current path in result,
    I have already tried the Runtime & Process class ,
    Runtime rt = Runtime.getRuntime();
    Process p =null;
    p = rt.exec("command here");
    p.waitFor();
    it has following problems:
    1) This way I m not able to get the result ..
    2) I tried to make a zip file via my program it did not threw any exception , but could not execute...
    I was confused is it 'coz of permission ( rights problem) or some programmatical error as the same program runs via a Java Class file ..
    desperately waiting for ur suggestions
    Dhiraj Agrawal
    MCA student and a Trainee in a local Software House
    reply to: [email protected]

  • How do I monitor serial port activity without first sending a command?

    In my application I am sending a command through the serial interface and I want to monitor the response. The response is not instant, in fact it is a timeout response indicating the requested action did not work. How do I monitor so I can parse what is coming in over the serial port without necessarily sending a command?

    You can always place a loop where you monitor the number of bytes at the serial port.
    After configuring your VISA serial port session, you can create a Property Node to get the number of bytes available at serial port.
    You can then process this information, for instance:
    1. Establish a timeout because you never get a response.
    2. Do serial port read if there is data available.
    You can exit the loop with a timeout condition or having processed the data.
    -JLV-

  • Access linux terminal to send shutdown command

    I'm needing to access the linux terminal to send the shutdown command,
    here is the code i'm trying
      try{
                Process p = Runtime.getRuntime().exec("sudo shutdown -h now");
            }catch ( Exception e){
                System.out.println("Exception in shuttin down machine");
                JOptionPane.showMessageDialog(null,"Can't shutdown.  Shit!");
            }I've used this commend to use the command line in windows, but not sure how to change it over for linux.
    Thanks

    I had a similar problem recently where I need to send multiple commands after the initial Runtime.exec(). My solution involved a PrintWriter...
    Process p = Runtime.getRuntime().exec("sudo shutdown -h now");
    PrintWriter pw = new PrintWriter(p.getOutputStream());
    pw.println("yourpassword");
    pw.flush();
    pw.close();As far as this...
    "sudo (and ssh etc.) won't take password from the stdin, if it is not a terminal. "
    ... Im not really sure. The method above did work for me, but if sudo doesn't check stdin, Im not sure how my solution works
    A couple other things you might consider. When you use Runtime.exec(), you are passing the system a command, you are not sending a string to a command line. For example, trying to run ...
    Process p = Runtime.getRuntime().exec("ls /usr/bin");
    ... will do nothing since "ls" does not start a new process, but is more of a routine. Likewise, you may or may not have problems using the shutdown command. If you do have problems, you may need to start a terminal with Runtime.exec(), and then send the shutdown command through the terminals stdin using the PrintWriter method.
    And on a second note, you may also need to reorganize your code to this...
    Process p = Runtime.getRuntime().exec("sudo", "shutdown", "-h", "now");
    Runtime.exec() will take your string and pass it as a command, it is not meant to directly pass arguments. It may work fine as you have it, but if you run into problems, pass your commands in as a String[] (as shown right above)
    Hope that helps
    Edited by: cpetzol2 on Apr 2, 2008 7:49 PM

  • Want to use dotNet with teststand, but unsure how to send commands through serial port

    I have a loCom communication dll used to send and recieve commands through serial comunication for a particular product.  I the past they have used a LabVIEW wrapper to send and recieve commands, using this particular dll.  I would like to just use testStand for the DOTNET Dll.  I can get the commands, know the inputs and outputs required, however I can not figure out how to send the commands to the serial port.  Anyone have any exprience doing this in TesSTand?

    hallawt,
    With your .NET code module, you should be able to call it directly, most likely as a parameter in the .NET method.
    What are the inputs for the method you're trying to use?
    Also, could you clarify where you're starting to have problems in your project?
    Regards,
    Renée M
    Applications Engineer
    National Instruments

  • Can LabVIEW send an email through Microsoft Exchange server without an account set up in Outlook?

    I've found sample code that shows how to send email through Outlook using LabVIEW.  On any computer I log into on our network, my profile loads and I have access to the exchange server through Outlook so the code works.
    However, I am developing a program that will run on a lab computer with a generic PC login that is shared among everyone in the lab.  Exchange server/outlook is not set up for the generic user.
    Is it possible to have labVIEW send an email through the exchange server with a server name, username, and password coded into the executable?

    You would need to send a standard SMTP message via Exchange. The Exchange server will likely require authentication, so you won't be able to use the built-in SMTP VIs, as they do not support authentication. If you're on Windows you can use .NET (see this example), or use the OpenG SMTP VIs.

  • How to send a command from a vc++.exe to LABVIEW.exe in order to control the button on the LABVIEW.exe

    Hello, everyone. Using VC++, I have gotten the handle of a *.exe(built by Labview), but I cannot get the button handle. I want to get the button handle and post the message to control the button. How can I do that? When I use the SPY++, the *.exe(built by Labview) have not any child windows which is very different from the *.exe(built by VC++). In SPY++, what is the LVDChild class? How can I send the message to control the button on *.exe(built by Labview)???
    That is  to send a command from a vc++.exe to LABVIEW.exe in order to control the button on the LABVIEW.exe. How can I get it ?
    Thank you!

    hummingbird wrote:
    Thank you! But I dont kown how to use vi server to raise a value signalling event. Can we put vi server into the vc program? Can you give me some more information or some examples, hehe!
    hummingbird
    Checkout the LabVIEW ActiveX server interface in the User Manual in Chapter 20, Windows Connectivity and the VI Server Reference in Chapter 17, Programmatically Controlling VIs.
    There is a sample for Visual Basic under examples/comm/VBtoLV.frm, which should be quite simple to translate to Visual C as long as you can figure out the basics of ActiveX programming in VC (I have never done anything with ActiveX in VC). For those basics I would recommend some text book or MSDN.
    Rolf Kalbermatter 
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Instrument I/O Assistant (sending command from labview to arduino)

    Hi,
    I am a beginner in Labview. I would like to control the intensity of AC loads using labview. In this case, i would prefer to use instrument I/O assistant. The instrument I/O assistant in labview will have to send a command to Arduino. The intensity will be controlling by using slider in labview. How to write the vi for this example? Please advice.

    feliciacpw92 wrote:
    Hi,
    I am a beginner in Labview. I would like to control the intensity of AC loads using labview. In this case, i would prefer to use instrument I/O assistant. The instrument I/O assistant in labview will have to send a command to Arduino. The intensity will be controlling by using slider in labview. How to write the vi for this example? Please advice.
    In the thread for your other post, you were told that LabVIEW installs by default example programs on how to use LabVIEW with serial port.
    Have you bothered looking at that?
    You need to do some work on your own.

  • Send a Unix command through ARD that will change a OS X admin user to a standard user.

    I would love to send a Unix command through ARD that will change a OS X admin user to a standard user. The only thing I found close is
    sudo dscl . -delete /Groups/admin GroupMembership USERNAME
    which does remove the user from the list of admins, but they are still listed as an admin in the user preference panel, and can still use their account to authenticate for admin privileges.

    I'm not having any problems adding or removing users from the 'admin' group by using the syntax's
    dscl . -delete /Groups/admin GroupMembership ARDusername
    or
    dscl . -append /Groups/admin GroupMembership ARDusername
    What I'm saying is if a user is ticked as an Adminstrator in System Preferences and I run the
    dscl . -delete /Groups/admin GroupMembership ARDusername syntax and remove them from the 'admin' GroupMembership they still have the Administrator box ticked in System Prefs and can administer the machine.
    By the way the '/' doesn't work in the syntax in ARD.
    Thanks

Maybe you are looking for

  • How is the best way to setup toll bypass

    We have setup toll bypass to save long distance charges. For example if someone calls from Dallas to Houston, they would go through the data network and come out in Houston and go out their local phone lines. I have set this up by getting a list of a

  • Doubt in order by clause

    Hi, I have the below query select distinct first_value(column_name) over (partition by table_name order by decode(column_name,'REP','1', 'END','2','3')),table_name from all_tab_columns where owner='ORCL' can someone plz tell me how the order by will

  • 6310 horizontal line appears when copying

    Officejet 6310 all in one when I try to copy the page the copied page has 3 horizontal lines going right through the centre of the page one wider than the other two lines. What can I do. Also I am trying to print on a thicker page which I have previo

  • Cannot play audio files

    So I cannot play songs on my iPod but the audio on my movies are working fine. Does anyone else have this problem or do you know what's wrong?

  • I understand you can transfer photos from Picasa to my ipad using an ipod. How is this done?

    I want to transfer photos from my PC laptop (Picasa)  to my ipad. Someone told me I can do this via my ipod. How is this done?