Need a gui to send simple ascii commands to com port

I am not a programmer. Several years ago I took a class in Java. Now, I am looking for a gui with buttons that are programmed so that when clicked on with mouse a command (ascii or hex) will be sent to the com port. I am pretty sure that I don't want to read from the port. I have a table of commands that I want to match up to some buttons - a simple way of putting it.

Before you embark on Swing and javax.comm, I'd encourage you to get up to speed with basic Java. A lot has changed in the past couple of years, and getting some practice with the basics will save you a great deal of frustration. Here are some recommended resources:
Installation Notes - JDK 5.0 Microsoft Windows (32-bit)
Your First Cup of Java
The Java� Tutorial - A practical guide for programmers
The Java� Tutorial - Trail: Learning the Java Language
New to Java Center
Java Programming Notes - Fred Swartz
How To Think Like A Computer Scientist
Introduction to Computer Science using Java
The Java Developers Almanac 1.4
Object-Oriented Programming Concepts
Object-oriented language basics
Don't Fear the OOP
Books:
The Java Programming Language - 4th Edition
Head First Java, by Bert Bates and Kathy Sierra
Thinking in Java (Free online), by Bruce Eckel
Core Java, by Cay Horstmann and Gary Cornell
Effective Java, by Joshua Bloch
Let us know if you have specific questions. Good luck!

Similar Messages

  • To send multiple operation commands to serial port

    My AC power source is able to communicate to PC via serial port using LABView and I can perform any operation by giving commands in Hex individually, But when it comes to the parallel operation of all the commands or to put them in a particular sequence. I am failing to do so.

    You can only send 1 command at a time.  That is just bus communications 101.  But you can string together many VISA Writes to send the individual commands, one after the other.
    But since if sounds like you are doing this on a GUI based instance, what you want to do is configure the port before your loop and close the port after the loop.  Then inside your loop you just have an Event Structure to key off of the different controls changing values.  You just send the command you need to inside of each event case.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • AT commands and Com port

    Connection to the com port is ok and i can send AT commands.
    But i need to make a few AT commands one after another. And i think i am getting errors..anyone can help?
                        outputStream.write("AT+CMGF=0\r".getBytes());
                        outputStream.write("AT+CMGS=153\r".getBytes());
                        outputStream.write(commandString1.getBytes());
                        outputStream.write("\u001a\r".getBytes()); // ctrl + Z
                        outputStream.write("AT+CMGS=153\r".getBytes());
                        outputStream.write(commandString2.getBytes());
                        outputStream.write("\u001a\r".getBytes());
    as u see there are 2 "at+cmgs=153" i guess this is where the problem lies...

    You must wait for the replies. I've not done this in java, but I have in VC++ and I remember that the Hayes AT commands are reversing half duplex. When you send a command read the incoming data until you see a carriage return.

  • Send a single command to LTP Port

    Hello,
    I am still some what new to java. I have been looking and looking for a way to simply send the hex code 07 to my LPT port. When reading the documents provided by with the printer there is a simple way to it in doss. type "echo (press control+G) > LTP1".
    Is there any way i can do the same thing but through java.

    You can use the methods of ProcessBuilder (preferably) or Runtime classes to execute a command like that in Windows' cmd window. Make sure that the command works from the cmd window, first. Read about how to use the methods of these 2 classes in the Java API documentation. It can be read or downloaded from Sun's JDK download page.
    Or, youu could install the RXTX package and use that.

  • Simple Serial Com port

    I have an external device that I need to write and read simple ascii commands to through a serial port. For some unknown reason I can not get Labview or for that matter M&A to com to it. I can com to it through a terminal (putty) with no problems. I have tried through M&A and also several labview basic read & Write Serial example VIs. No luck. All I need to send is  $1RD  This tells the external device to send a measurement back. Its basic ascii. The device coms on 19200 baud 8 bit words no party or flow control and 1 stop bit. Anyone have any ideas?

    Bkasper wrote:
    It works fine in putty. Yes I have to press the enter key to send the $1RD. I have tried adding \r and \s to the end of the command in labview, but no luck.
    Try adding a \r\n or just a \n to the end of the line. A carriage return by itself is not a normal line termination.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Tcp/ip write help - need to send a motor command with parameters

    hello - i have one small, main labview 7.0 vi that i use to control a drill's two motors.
    right now i press a button on the front panel to move the motor, and when i do, a sub vi window pops up so the operator can set a couple of parameters and press an ok button.....the vi then sends the command with the parameters to the drill's motors.
    i am trying to change it so i can send the move command from another computer, in another room, while the main vi sits on the computer with the drill. i know i will use TCP listen, write, read, and close in both the main vi (the TCP server?) and the client which is on the remote computer.
    my problem is with setting the parameters for the subvi's that usually pops up. how do i set the parameters from the remote-client and have them be sent into the subvi on the main vi. if i can do this, i would have to also have a way to close the sub vi after it pops up in the main program too.
    OR should i use something else like and application reference or an invoke node function?????
    please help
    thanks!!!!
    sam

    Hi again,
    If the VI in the lab will be running continuously, then you will need
    to alter some things from the example I sent you or look at an
    alternate implementation. The example I sent you assumed that the VI in
    the lab was not running. This technique actually starts the VI and runs
    it somewhat like a subVI. It inputs values into the connector pane,
    runs it, and then returns values from the outputs on the connector pane
    after it finishes executing. It will not work to call a VI by reference
    if it is already continuously running.
    Instead I imagine you would want to have your VI in the lab have some
    sort of State Machine that polls a certain control value, such as an
    enum control, to determine which state to execute next. You could
    modify the technique I first sent to still open a reference to the VI
    in the lab, but it wouldn't try to run it. Instead you could use the VI
    method Set Control Value to set the value of a certain control or
    controls in the lab VI to certain values. The VI in the lab would then
    hopefully be in some Idle state where it polled one of those control
    values continuously to decide what to do next. That would allow the VI
    in the office to programmatically send commands to the other VI, as
    well as parameters for those commands. Simply set control values for
    the VI in the lab and let the VI in the lab go about its business. I've
    attached an example below.
    That's just one idea. Other options you have would be to use a
    DataSocket connection to send parameters and commands back and forth
    between computers. This is a pretty simple API to use. If you have
    LabVIEW 8, Shared Variables are an option. Or you might look into
    simply using Remote Front panels, which allows you to connect to a VIs
    Front Panel across the network. You could then have the whole VI in the
    Lab, but you could connect to it, view it, modify the controls and so
    on from your office. If you want to view and control a VI without
    having LabVIEW installed on the viewing computer, you can use the Web
    Publishing Tool to create a web interface for your front panel. Lots of
    options. Let me know what sounds interesting.
    Jarrod S.
    National Instruments
    Attachments:
    Lab_VI.vi ‏29 KB
    Office_VI.vi ‏51 KB

  • 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.

  • Print Report using ASCII command through printer selection available on windows

    Hi,
    I'm using Labview 2009 to create a report using Report Generation Toolkit.
    Creating a report is not the problem, the problem is I need to print the report manually by sending an ASCII Code.
    I noticed that there are few example on send ASCII code command, but neither of them are related to printing.
    The printer I use is Panasonic dot matrix printer KX-P1121E with USB port. (Fanfold type of paper)
    I used "NI_report_lvclass: Print report.vi" from Report Generation before this to print my report, everything is okay and not receiving any error.
    But I noticed that after finish printing, the paper will automatically feed out as if that VI (Print report.vi) is sending out "Form Feed" (FF) Command to the printer. 
    My application cannot use this method because I need to print a set of data in every minute. If the data only have 2 rows, then it will be a wasting a lot of paper if everytime finished printing paper feeding out. I want the printer to continue standby on the same paper after finished printing previous data. In other words, maybe just manually send "Line Feed or Carriage Return" to the printer.
    So I have a few things need to be clarified step by step;
    1. How can I send an ASCII Code to my printer? Do you have any example for this? link below is the character of ASCII Codes that can be use :http://webpages.charter.net/dperr/links/esc_p83.ht​m
    2. Can I send a report created by report generation to be printed using this ASCII command method?
    3. If my printer is setup by using windows (Meaning: Available on "Printer and Faxes" list), How can I configure the printer setup in sending the ASCII Code? 
    Really appreciated your reply
    Thanks!

    Hi Zwired1,
    Just to make sure I fully understand the situation - I am assuming since you say you are printing to two different printers that when you are using the Print Report.vi you are using the printer name string to specify which printer you would like to print on. And if the printer that you specify is not functioning it automatically prints on the other printer, is that correct?
    From looking at the code in the Print Report.vi, it looks like if you specify a printer name in the input string, if there is a problem with that printer or if that printer is unavailable, the VI should not print anything, so please let me know if that is not the behavior you are seeing.
    For your question about checking the health of printers, there is a VI in the report gen toolkit called Query Available Printers. You can find it if you open up the Print Report.vi and choose the Standard Report instance, the Query Available Printers.vi is on the block diagram of that VI. It will return the list of available printers and the default printer.
    I hope that helps,

  • Need Suggestion to build a simple web service demo

    I'm planning to build a demo using java packages JAX* for my team using my workstation and another standalone box.
    I got a Sun One Web Services Platform DVD from JavaOne, but it only support Win200 or XP, too bad our company still using Win NT SP6.
    I only need a very simple web service that will bring data from server DB. I knew I can download the JWSDP1.2, but there is no tutorial right now. And I have tried JWSDP1.1 but not really understand what it is doing(because only Hello world service is working). I need to do some modification to change the default server port from 80 to 81, and I need to modified localhost to [my-machine-name] so that the other machine can talk to the JWSDP server.
    My question is how can I build up a web service demo really easy and quick and what tool should I used, any suggestion will be appreciated! Thanks in advance!
    Henry

    1. Use XML Spy Enterprise edition editor.
    2. Goto www.xmethods.com, select service you want to create demo of.
    3. Get its WSDL url.
    4. In XML Spy SOAP menu there is a command 'create new soap request'. Press that, enter the WSDL url. You will get a SOAP request.
    5. Edit SOAP request parameters. Type parameters of your choice.
    6. Press 'send request to server'. You will get SOAP response. It will contain result from the requested method.
    7. Paste that response inside a JSP.
    8. Write a local method which will return same response (remote method's return value) that came from remote web service.
    9. Paste that method inside abovementioned JSP. Replace static response in that JSP with the response generated by local method. The method parameters will come from client's SOAP request. Parse SOAP request to get request parameters. (As it's your demo, you know the data types of the parameters).
    10. Host that JSP on any Servlet/JSP engine.
    That makes your Web Service.
    You can use any package like Aapche SOAP, AXIS or JAX-RPC to generate a SOAP client. Use the URL of JSP(step 10) as "endpoint".
    Note: Indside JSP make sure that there in no endline and carriage return character. Otherwise it won't be a valid SOAP response.
    Good luck.

  • Is there now a system call to send pass-through commands to ATA devices?

    I want to send pass-through ATA commands to SATA/ATA devices on intel-based solaris. From the beginning the USCSICMD ioctl has worked just fine on SCSI/SAS/FC targets on intel & sparc-based solaris, but the mechanism to send pass-through commands to ATA devices has always been undocumented, closed, unavailable, whatever.
    Is there now a way to do this w/o writing a custom device driver? Does anybody have an example chunk of code that does something simple like send the ATA IDENTIFY command to a disk drive? I know I can use SATL to encapsulate commands to SATA disks using certain SAS controllers, but I really need a way that will work with devices that are plugged into a standard SATA port on a motherboard.
    Thanks

    Hi Dhalek,
    Just tried out a small example and it works ok in SQL Dev 4
    drop table t1;
    create table t1 (col1 int);
    insert into t1 values (1);
    insert into t1 values (2);
    insert into t1 values (3);
    select * from t1;
    /*sqldev:stmt*/BEGIN;
    DELETE FROM t1;
    SELECT * FROM t1;
    /*sqldev:stmt*/ROLLBACK;
    SELECT * FROM t1;
    ---- RESULT ----
    table T1 dropped.
    table T1 created.
    1 rows inserted.
    1 rows inserted.
    1 rows inserted.
    col1      
    1         
    2         
    3         
    /*sqldev:stmt*/BEGIN
    3 rows deleted.
    col1      
    /*sqldev:stmt*/ROLLBACK
    col1      
    1         
    2         
    3        
    Regards,
    Dermot
    SQL Developer Team

  • Cannot Send Ctrl+B command over serial Com2

    I am trying to communicate with a serial instrument. The ascii command is "STX" however with labview when
    the command is sent there is no response. Using Hyperterminal with the same configuration(as labview) I can press "ctrl+b" and instrumnet responds. what is different?

    I think what you need to do is send the byte value for STX which I think is 02 hex. There are a few ways to do this. The easiest way to do so is to right click on a text control and select hex display. Now type 02. Change it back to normal display if you want to type in the rest of your message. Connect this control to serial/VISA write. This should be the same as type "ctrl+b" in HyperTerminal.
    Let me know if this doesn't help you.
    Brian

  • How can i send simple message from PC-to-another device

    How can i send simple message from PC-to-another device
    just simple message (like command String) not SMS or Data File.
    I have a computer with bluetooth and the oter side is Embeded Blue
    Thanks.

    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_AQ_Configuration.pdf
    This document details how to create triggers on a table that send out JMS messages.
    In this example, the messages are going to Oracle BAM.. your message could go to your J2EE application listening to its own topic/queue.
    an alternative idea.
    you could also just cache your lookup table with something like Oracle Coherence and than try to ensure that all changes to the lookup go through Coherence, so that you won't need to do notification from the db up to the application. the application and the lookup data management tool would be using the data grid for management of the lookup table data, and the data grid (coherence) would persist the lookup data changes back to the db.

  • How do I get labview to send out ascii code to a device?

    I am trying to use a device that does not have labview drivers. However, the company has sent out their own program but it is two letter ascii code. I want to make the interface easier than having to learn all the ascii codes when one wants to do something. How would I go about programming labview to send out ascii code to move my device?

    Are you asking how to communicate with the device or how to allow user to select from easily understood commands?
    If you need help communicating, look at the communication examples that ship with LabView. I'm guessing that your device is serial. To find the examples, from any LabView window, goto Help >> Find Examples >> Search, then enter Serial in the box labeled Type a keyword to find:
    If you want to help the user pick a command, there are a bunch of ways to do this. Most typical are using a ring or enum on your front panel and doing the translations from user commands to machine commands on your diagram. Look at the attached LabView 6.1 example which shows a ring and an enum. To initialize the enum or ring, select the text tool and left-click on the
    control, then enter your text. To add more items, right-click on the control and select Add Item After (or Before) and type the text for the new command. The diagram will see the output as a number. Use that number to select an index from a multi-line string or to select a case in a case structure. One nice thing about the enum is that the cases are automatically named with the enum string. An easy way to get cases for all items is to put a string constant in the first case, wire it out of the case, then right-click on the case boarder and select Duplicate Case. You'll get a new case named for the next item with a string already wired out. Then you can just edit the string text in each new case for the desired output.
    Attachments:
    PickCommand.vi ‏33 KB

  • I need ready code for a simple paint program today

    hi all I need ready code for a simple paint program today for me ics projct
    plz give me a halp on this give me what you have with you and it is so good if it look like this :
    Design a GUI based drawing Java application that works like a simple paint program
    1-There should be a number of buttons for choosing different shapes to draw. For example, there should be a button for rectangle. If user presses the rectangle button, then he can draw a rectangle using mouse. Similarly, there should be a button for each shape(rectangle, circle, ellipse, and line etc.
    2-The shapes can be filled with different colors.
    3-There should be option of moving .
    4- There should also be three menus including File, Shape, and Color menu.
    i. File menu can have menu items New and Exit. If user selects New, the drawing area will be cleared and all shapes will be erased.
    ii. Shape menu will serve the same purpose as of feature 2 described above. It will have menu items for drawing all the different shapes. For example, there will be menu item for rectangle; so user can draw a rectangle by selecting the menu item for rectangle.
    iii. Color menu will serve the same purpose as of feature 3 described above. It will have menu items for all the colors which are shown in color buttons. The user can select a color from this menu and then click inside a shape to fill it with the selected color.

    Read the Swing tutorial. There are sections on how to use menus and painting and all other kinds of stuff you need to do this homework assignment. Nobody here is going to write the code for you:
    http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

  • How do I get labview for linux to send out ascii code to a motion controller?

    I have posted part of this problem but I will now try to clearify things. I have an x-y stage that needs motion control. I have to run the motion controller from within a linux system (RedHat 7.1) due to others in the research area. I have found a motion controller card (PCI) that will run under linux. This card is not National Instruments. I understand that they do not have drivers for their controller cards. This other card comes with the companies own software that uses ASCII codes to move the motors on the stage. I was hoping to create a program that could call those ASCII codes to move the stage. An example would be if a user wanted to have the stage move to the right he would press a b
    utton on the screen instead of typing in whatever ASCII could that move to the right happens to be. How would I go about programming something like this? I have heard of others doing things like this but I am unsure of how to program labview to send out ASCII codes to a PCI card to move motors.

    > would I go about programming something like this? I have heard of
    > others doing things like this but I am unsure of how to program
    > labview to send out ASCII codes to a PCI card to move motors.
    Look in the manual to see get familiar with the sequences of codes you
    need to write, and more importantly, where you write them to. I suspect
    a memory location, but it could be a socket or port.
    Each of these locations will have a slightly different way of accessing
    it. Once you know, search devzone for how to do it on linux, or post
    back here.
    After you can send the codes to the right location, you probably want to
    build a state machine that simplifies the interface and prevents certain
    actions from taking place. Now determine which buttons or
    keys perform
    which actions and use either the event structure or the older polling
    for control changes to affect state changes in the state machine.
    I'm summarizing here assuming that you know what a state machine is and
    why you'd want to use it. If I'm assuming too much, do some research
    and post again with more specific questions. Also be sure to look at
    example VIs as they show how to respond to UI actions.
    Greg McKaskle

Maybe you are looking for