Outputing Pre-programmed Serial Commands

Good Afternoon,
I'm connecting a stepper motor to LabVIEW and was able to make it work with the basic serial write and read example vi very nicely.  I was just curious if there was a way to store  a couple separate sets of code (essentially programs) that could be fed to the serial port on command with LabVIEW depending on the users need.
If I was too vague, let me know.

In short yes.
You can store text in strings and arrays just like other software languages and also pull data from text files or other file formats. These could concievably be stored command sequences for your stepper motor which could then be sent down the serial port under software control.
Check out the help files on strings and then follow it up with arrays, after that look at reading in files. The help files are really excellent, one of the softwares strong points.
Looks like your project is growing all the time, hope all the stuff in the previous question hit the mark.
Message Edité par Conseils le 01-06-2006 11:16 PM

Similar Messages

  • Capturing the output of a os command line

    I need to capture the output of a os command line executed from one java program and I don't know how can do it.
    For example:
    Runtime.getRuntime().exec("hostid");

    Your suggestion worked very well, just in case that this could interest somebody, this is the complete solution
    Thanks for your help
    import java.io.*;
    public class HostID
    public static void main(String args[]){
    try{
    InputStream in = (Runtime.getRuntime().exec("hostid")).getInputStream();
    byte[] arreglo= new byte[200];
    int cantidad = in.read(arreglo);
    System.out.println(new String(arreglo,0,cantidad));
    } catch (IOException ioe){System.out.println(ioe.getMessage());}
    }

  • How to output instructions to the command line?

    How can I make my java program give instructions to the command line, eg to execute programs with command line parameters?

    How can I make my java program give instructions to the command line, eg to execute programs with command line parameters? well you can execute the instruction directly not even going(piping through) to commandline.
    try{
    String command = "ls"; // for windows for example String command = "notepad";
    Process execCommand = Runtime.getRuntime().exec(command);
    // now if you want to pass parameters along with the  command use this
    String command2 ="ls /tmp" ; //respectively for windows
    // if there are many arguments which needs spaces then use
    String [] longCommand = new String[]{"find","whatever","path"}; // here find is the command and rest two are desired arguments.
    // now if you want to read the output from command line
    InputStream in = execCommand.getInputStream();
    int c;
    while ((c=in.read())!= -1)
    // process c the way you want
    } catch(IOException io)
    {}Edited by: KillerDev on Nov 2, 2008 12:00 AM

  • How to executing serial commands from text document

    I'm looking for some direction on how to read and execute a page of serial commands from a text file.  I have an instrument is controlled by serial communication.  Currently I have been using a state machine to operate the instrument.  The issue is that if I wish to change the sequence of commands I have to go back and rewrite the state machine to change the strings.  I had the idea of being able to just write the string commands to a text file with each line being a discrete command and after selecting the file the VI would execute the text page one line at a time.  I just don't  know where to start and have been unable to find an example to get me started.  This is above my programming level and I could use some direction on where to start.  The one issue I need to be able to address is if the VI executing the page of serial commands I have to have a way to abort the sequence if necessary.  
    Thank you
    Danny
    Danny

    ABCPrograms wrote:
    If you want to process the entire array of commands in a state engine, indeed the better way of keeping track of where you are in the array would be a shift register.
    When you're reading a new line, increase the index with one and put the new index in the shift register.
    That seems overly complicated, unless you want to go back and repeat steps.  But from the description from the OP, this is not desired.  The point of the text document is to easily change the state order.  Autoindexing is by far the simplest way to accomplish this.  If you really want to know what index you are on, just use the i terminal.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do I output the program monitor from Premiere Elements 13 to an external TV monitor?

    I can find information about dual monitor set ups, but is it possible to output the program monitor only to an external monitor?
    If so, what is needed?
    I'm using PE`3 on a PC with Windows 7  64 bit  with an NVIDIA Quadro NVS 290.
    Thanks

    bobj
    Have not found a way, but....
    Do you have a HDMI cable and does your computer and TV each have a HDMI port.
    The TImeline panel appears to be the only undockable panel in the Premiere Elements 13/13.1 Expert workspace area (Window Menu/Dual Monitor)
    The best I can do is to make a HDMI connection between the HDMI ports of my computer and TV, with display at Duplicate or Extend. That does not appear to be what you seek.
    The other part of all this is that Premiere Elements used to have a "Playback Settings" in Project Settings and accessed from
    right clicking the Edit area monitor. That is no longer to be found in 13.1, even in a grayed out state. And, for me, the Playback Settings could not be made visible
    when attaching a 3rd party device.
    In the days of Premiere Elements 11, the answer to your question might have been as described in the following
    Adobe Premiere Elements 11 * Previewing movies
    Until proven otherwise, I am thinking that it cannot be done in Premiere Elements 13/13.1. But, I am not at a stage where I would put a never and always stamp on this.
    ATR

  • After load the pdf in this program, what commands must follow to make the correction (edit),

    if you use
    http://www.doc2pdf.net/
    you can convert doc >> pdf.
    I did try with some samples of files but, in some pages where a subheading is in eg page45, in pdf moved to page44, well to modify the pdf so is exact alignment like doc I must use ACROBAT? Well, conversions from this site must done non-restrict modify the pdf? well since I have Acrobat Pro 9, after load the pdf in this program, what commands must follow to make the correction (edit), and save the file?

    Unfortunately, for your endeavor, PDF is not a file format that supports edit-layout-format activities such as are in word processors.
    Not an "issue" - rather, it reflects what PDF was/is designed to be.
    While minor editing ("touchups") are possible extensive editing of PDF content is not.
    What you appear to have encounterd with the process used to convert something to PDF is something that happens rather too often.
    That is, many non-Adobe PDF creation processes to not provide "proper" PDF.
    Which is to say PDF built to the Adobe PDF References or, now, the ISO Standard for PDF (32000-1:2008).
    As you have Acrobat Pro perhaps using it to convert the document's authoring file to PDF via print to Distiller or via Adobe PDFMaker is something to consider. These convert to PDF per the PDF References/ISO Standard.
    Be well...

  • Pre-Program DME

    Hi All,
    I am basically from SAP HR background. But we are facing an issue, where when we run the pre-program DME, the corresponding SAPScript form is not being generated. We have asked the client team to give us more information but we do not have any at the moment. They have just told us that we need to maintain SAPScript forms in transaction FBZP and then we run the pre-program DME.
    Can you please guide me regarding what could be the reasons the form is not being generated? How should I start my analysis, given that I have absolutely no knowledge of FI?
    Thanks and Regards,
    Vidya.

    Thanks Jason,  after applying the corrections will get back to you about result.

  • Pre-programmed sequence for data bits on parallel port.

    I've found and made a bunch of vis that allow for interactive high/low control of the 8 data bits on the parallel port. I want to control each pin with a pre-programmed pattern of bits. Any ideas?

    A U8 is an unsigned 8 bit number. To create one place a number control down on the front panel. Right-click on it and select Representation>>U8. To create an array of U8s you place an array control down, and then drag the above numeric into the array shell. You now have an array of U8s, which you can expand and place things in it.

  • Pre-programmed text

    Does anyone know how I can set up pre-programmed text messages?

    Your form data hierarchy is different than mine. You need the brackets also, otherwisethe first assignment statements executes only.
    // form1.#subform[0].DropDownList1::exit - (JavaScript, client)
    if (!(this.isNull)) {
      var char = this.rawValue;
      TextField41.rawValue = "Data " + char + "1";
      TextField42.rawValue = "Data " + char + "2";
      TextField43.rawValue = "Data " + char + "3";
    Steve

  • Pre-programmed voice mail key

    I am trying to modify the pre-programmed voice mail number in my bionic (*86) to include pauses and waits separating various prompt numbers, etc.  I found under voicemail settings where you can perform this mod and it accepts and displays the changes made, but when the green "voicemail" touched on the home page, only *86 is prompted and none of the modified prompts appear......I have managed it to make it work by creating a new 'contact", naming it "voice mail", then creating a separate quick dial on the home page, but utilizing this method and not the pre-installed green prompt will not allow user to see the number of voice mails waiting like the green dedicated prompt displays.
    Surely there is a way to go in and modify the default number of the pre-installed voice mail prompt as there surely could be other required numbers besides *86 customarily used by Verizon??? 

    Usually you can go to Settings>Call Settings>Voicemail Settings and change it there..

  • Pre-programmed labs

    Why does HV not have pre-programmed fields for extremely common blood tests such as the CBC, the Comprehensive Metabolic Profile, and Urinalysis  like it does for Blood Glucose and Cholesterol measurements? It's extremely cumbersome to enter these
    values one by one in the Lab Test Results section.

    Note if you're lucky enough to be using Windows 8, our HealthVault app does support many common panels in the Lab Results section. Just start typing the panel name and we'll show matching ones and auto-populate for you.
    This functionality is something we'll move onto the web and such as well ... there's just always too much to do and we get to it as quickly as we can. Thanks for the feedback!
    ---S

  • How to redirect output of an OS command to a stream???

    how can i redirect the output of an OS command (such as 'ls' in linux or 'dir' in windows) to a io stream???
    ....for example, assume i'm having a textbox and a button...when i click the button , i need the output of 'ls' to be in the textbox....i think execution of the command could be accomplished by Runtime's exec() ...but how to redirect outputs???

    You should find what you are looking for here:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How can I run my program on command line?

    I'm having some trouble trying to run my program on command line.
    I get a message saying "Exception in thread
    "main" java.lang.NoClassDefFoundError: Rectangle
    <a href="http://img145.imageshack.us/my.php?image=untitled2copylh2.jpg" target="_blank"><img src="http://img145.imageshack.us/img145/3002/untitled2copylh2.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" /></a>
    import java.util.Scanner;
    public class Rectangle
    public static void main(String[] args)
    int width;
    int height;
    int count = 1;
    Scanner scan = new Scanner (System.in);
    System.out.println("Please enter the width of the rectangle: ");
    width = scan.nextInt();
    System.out.println("Please enter the height of the rectangle: ");
    height = scan.nextInt();
    while (count <= width)
    if(width < 1 || width > 30)
    throw new IllegalArgumentException("The numbers must be in range");
    if(height < 1 || height > 30)
    throw new IllegalArgumentException("The numbers must be in range");
    for (int star = 1; star <= height; star++)
    System.out.print("*");
    System.out.println();
    count++;
    }

    What doesn't work?
    When you type javac Rectangle.java do you get error messages? Does it create the file Rectangle.class? If yes, type java Rectangle and your program should run. If you get an error post it but if you followed earlier advice you should be able to solve the problem yourself.

  • 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

  • How to compile and run java program at command console

    hi there
    can anyone tell me how to compile and run a java program at command console? I have installed JRE 1.3.1, and also have installed JBuilder 5 if it helps.

    try this
    System.out.println("Enter your Name : ");
    BufferedReader console = new BufferedReader( new InputStreamReader( System.in ) );
    String s = console.readLine();
    System.out.println("Hello : "+ s+" !" );

Maybe you are looking for