Sending an ESC code using the serial port

I have a motor control aplication that requires sending an ESC character using the serial port. LabView has several built-in functions (end of line, line return, etc.) but I just do not know how to send this particular code using the serial port. Any ideas?

The hex code for ESC character is 1b, Try writing it in a 8 bit unsigned number and then change that byte to charachter using labview function "byte Array to string". In this way you can pass this charachter.

Similar Messages

  • Sending Hex text files to the Serial Port

    Hi,
    Does anyone know or have any experience in how to open a Hex file, read
    the data and send it down the serial port.
    Regards,
    Martin.

    Martin Stanley wrote:
    >
    > Hi,
    > Does anyone know or have any experience in how to open a Hex file, read
    > the data and send it down the serial port.
    >
    > Regards,
    > Martin.
    Martin,
    I have a vi that reads a hex file then sends the data out the serial port.
    It waits for each byte to be echoed back before sending the next one.
    As each hex number is read, it's converted to a decimal number. The number
    is used as a decimal ascii code, the ascii character is then sent to the
    serial port.
    I'm not sure if this is the most efficient way to do it, but it works.
    Walter

  • How to use the serial port

    hello
    I would like to know if there is other library than comm to use to establish communication with the serial port ..
    can we do this with pure java ,I mean without the need of using any library ???
    if not then what is the best library to use ???
    any examples ??
    I have other question
    when i use the library comm
    I use the public void serialEvent(SerialPortEvent event) to get my data
    but that data comme line by line
    is there a way to get all the data at once ???
    than kyou in advance

    There you go
    http://java.sun.com/products/javacomm/
    Some extra resources
    http://www.google.co.in/search?q=java+access+serial+po
    rt&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.
    mozilla:en-US:officialmaybe I was not clear ,I know the comm lib
    Im already using it
    but am asking if there any other lib that will work for windows
    thank you

  • I can not communicate with the FP-1000, using the serial port.

    FP-100 communication by serial port.
    My problem is the communication with the interface FP-1000, I haven been using it for two month with my program application and suddenly it stopped to work. I tried to use the FieldPoint Explorer to communicate using its last configuration but it does not work. I have tried to configure again and the FieldPoint Explorer doe not find any module, also I have seen that the network and access LEDs don lit when I am trying to communicate with the FP-1000.
    I have checked all connection and they are already, the FP-1000 turn on, and the status LEDs does not lit.
    I guess the trouble is the RS-323 connector at the FP-1000.
    Could you tell how can I solve this problem?

    Hello,
    There are a number of things that you can try when you are experiencing communication problems with a FP-1000.
    First, double-check that the serial port that you are using is the same one that you are specifying in FieldPoint Explorer. Try using another serial port on the host computer. Try connecting the FP-1000 to another computer.
    Make sure that you have FieldPoint Explorer version 3.0.2 or later. Free upgrades are available from the web.
    I hope this helps,
    Chad Evans

  • How to detect if my external device is connected to the Serial port

    Hi,
    If I remove the cable from the serial port in my pc or either remove the serial cable from my external device, then when I send a request to open the serial port from my program, it basically does nothing, it just sits there.
    I want to be able to show some sort of message or any other way of indicating to the user that they should check the cable.
    below is the bit of code to open and set serial port params:
         public void openPort() {
              // Initialise the drivers
              System.setSecurityManager(null);
              String driverName = "com.sun.comm.Win32Driver";
              try {
                   CommDriver commdriver = (CommDriver) Class.forName(driverName)
                             .newInstance();
                   commdriver.initialize();
              } catch (Exception e2) {
                   e2.printStackTrace();
              // port will be set in Store Operations.
              String wantedPortName = Configuration
                        .getParameter(ConfigSetting.EFT_COM_PORT);
              //System.out.println("wantedPortname : " + wantedPortName);
              Enumeration portIdentifiers = CommPortIdentifier.getPortIdentifiers();
              CommPortIdentifier portId = null; // will be set if port found
              while (portIdentifiers.hasMoreElements()) {
                   System.out.println("counter");
                   CommPortIdentifier pid = (CommPortIdentifier) portIdentifiers
                             .nextElement();
                   System.out.println(pid.getName());
                   if (pid.getPortType() == CommPortIdentifier.PORT_SERIAL
                             && pid.getName().equals(wantedPortName)) {
                        portId = pid;
                        System.out.println("found a macth");
                        break;
              } // end of while
              if (portId == null) {
                   System.err.println("Could not find serial port " + wantedPortName);
                   //System.exit(1);
              try {
                   port = (SerialPort) portId.open("EFTDriver", // Name of the
                                                                               // application
                                                                               // asking for the
                                                                               // port
                             10000 // Wait max. 10 sec. to acquire port
              } catch (PortInUseException e) {
                   e.printStackTrace();
                   System.err.println("Port already in use: " + e);
                   //System.exit(1);
              // Now we are granted exclusive access to the particular serial
              // port. We can configure it and obtain input and output streams.
              try {
                        port.setSerialPortParams(9600, SerialPort.DATABITS_8,
                             SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
              } catch (UnsupportedCommOperationException usc) {
                   System.err.println("Unsupported operation" + usc);
              }Please advise what method can I use for this purpose.
    Thanks
    Abhi

    You mean it hangs in the open() method despite the timeout?

  • How to get a signal from the serial port to start a labview program?

    I need to synchronize the data obtained from a program (which is not in Labview)with the data collected with Labview on a different computer. I can send some data strings to the serial port of the computer running the Labview program when the other program starts. However, I need to be able to read the trigger in my Labview program. Do you know what I should do? Thanks.

    If you don't have any other programs listening on the COM port, you need to let a LV program run BEFORE the signal comes, otherwise you won't be able to read it. You can have the program wait in a slow timed loop so that it doesn't use up too much CPU time, and when the required "trigger" comes, to move into the main part of the program.
    You basically need a while loop waiting for a certain string in the serial buffer. Once the string is found the while loop is exited, and the data acqquisition or whatever else you require from the progam can be performed.
    In the example attached the program wait for ANY text to be sent to the COM port. Please note that you need to configure the VISA resource before using it. Once there is something at the COM port, the loop will exit and the rest of the program will be executed.
    Hope this helps
    Shane
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
    Attachments:
    Wait for serisl message.vi ‏17 KB

  • Reading a whole frame from the serial port

    I have posted before about my attempts to use the serial port (http://forums.ni.com/ni/board/message?board.id=170&thread.id=387410).
    Anyway, I want to connect an external device through using VISA. It uses a protocol that exchanges frames. My main program is a series of while loops going through the different echanges, it sends one frame, waits for the proper response, sends the frame again etc.
    My problem lies in reading the frames. I'd like to read from the serial port until I get an EOF character, then parse the frame, etc. for every cycle of send/check. This doesn't work. I've managed to get one character from the port, thereby confirming that my reading function does actually read. Then I tried to put it into a loop which resulted in it not returning any characters at all.
    Attachments:
    AssReq.GIF ‏5 KB
    GetFrame.vi ‏14 KB
    readVISA.vi ‏13 KB

    Attachments:
    SerialPortControl_2.vi ‏24 KB

  • How can I control a HP 33120A waveform generator with the serial port of my PC?

    Hello,
    I want to control a HP 33120A waveform generator with my PC using the serial port. I don't have any idea about how to do it. If you've done it or if you know how I can do it, please give me some indications.
    Thanks
    Jean-Baptiste Paillet
    PS: I don`t have G PIB port

    The answer to your cross-post in the LabVIEW General group seems to be right on the money:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000032200000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    Regards,
    John Lum
    National Instruments

  • How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100 format) out the serial port of my computer?

    I am trying to write a vi that interfaces with a piece of OEM equipment that is set up to talk with a VT 100 terminal. I can't seem to locate the ASCII equivalent string (if there is such a thing) of a CTRL D. Is there a vi that emulates VT 100 commands?

    If I recall, CTRL-D is EOF on most ASCII tables.
    You'd probably have to use an escape sequence
    or if you can use an unsigned 8-bit that might be
    easier.
    In article <[email protected]>, TLS
    wrote:
    > How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100
    > format) out the serial port of my computer?
    >
    > I am trying to write a vi that interfaces with a piece of OEM
    > equipment that is set up to talk with a VT 100 terminal. I can't seem
    > to locate the ASCII equivalent string (if there is such a thing) of a
    > CTRL D. Is there a vi that emulates VT 100 commands?

  • Using a PS/2 keyboard on a Sparc workstation through the serial port

    We have recently migrated an application that used to run on a PC, to now run on a Sparc Workstation. This is a SunBlade 1500, running Solaris 8. The application is running in a dedicated console which has a fitted keyboard and trackerball that have PS/2 connectors and cannot be changed.
    We need a way of connecting the PS/2 keyboards to the serial ports of the Sparc workstation. We already have a piece of software that will read ascii values from the serial port so we definately want to go through the serial ports.
    Can someone please suggest what converters will be required to get the output of the keyboard and trackerball as ascii input to the serial port.

    Actually, that's not a bit perverse, at all.
    Jonathan's suggestion is a standard method of connecting to a server.
    (null cable between the computer serial ports)
    ... see the Solaris man pages.
    man tip
    TeraTerm and Hyperterminal are customarily used on a PC running some dialect of Windows.
    The 'tip' command is all that's necessary between Solaris systems.
    PS/2 is not a serial connection, but is a keyboard/mouse interface 'invented' by IBM when they offered their XT-class PS/2 line of desktop systems, back in the 1980's.
    I found this next link by using Google:
    http://members.chello.at/theodor.lauppert/computer/ps2/
    The smaller DIN ports were more compact than the AT-class keyboard ports and the mouse moved from a serial port to a dedicated mouse port.
    Serial communication devices are not keyboards, per se,
    and keyboards are not serial communication devices.
    You need other hardware in between to translate what the human being sends, and another computer is a common method to accomplish that translation.
    Having said all that ...
    Since you cannot change the dedicated console hardware,
    I suggest you go to the manufacturer of that console equipment
    and have them suggest some sort of serial-to-serial interface lash-up.

  • How can I use the output value from SIMPLE PID to write something to the serial port?

    I am working on my Senior Design Project that requires the use of incoming compressed air, propotional valves, continuous servo motors, and a serial servo motor microcontroller.  I have figured out how to send byte sequences to the microcontroller through LabVIEW using the VISA serial write function.  The motors are attached to the valves to control the flow rate.  I have created my own simple feedback system using a bunch of case structures but I realized that I am basically trying to recreate the wheel (I basically was writing my own PID VI).   I have an older version of LabVIEW (7.0 Express) and theres no way to upgrade or buy the PID toolkit, so I am stuck using the Simple PID VI.  Also, the only way the motor works is sending an array of bytes to tell it to turn on/off, direction, and speed.  Is there any way I can use the Simple PID VI in conjunction with the VISA SERIAL write function, or is there any other way I can communicate with the serial port using this pid vi?  Any information would be appreciated.

    Hi gpatel,
    you know how to communicate to serial port, but you don't know how to send a value from SimplePID to serial port???
    You know how to communicate, but then you don't know how to communicate???
    You should explain this in more detail...
    Edit:
    From you first post you know what values your motor driver is expecting. You know which values the PID.vi is providing. Now all you need is a formula to reshape the values from PID to the motor. It's up to you to make such a formula. Unless you provide any details we cannot give more precise answers...
    Message Edited by GerdW on 02-28-2010 08:35 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I want to transfer data through the serial port in the same coding that hyperterminal uses. How can i do it?

    The serial port seems to be working, and labview seems to be sending the data, but the problem is in which format does it send the data, because in hyperterminal i just input the string "JDX" and it sends it to my device, with labview it sends something but my device does not recognize it.

    nobuto wrote:
    > I want to transfer data through the serial port in the same coding
    > that hyperterminal uses. How can i do it?
    >
    > The serial port seems to be working, and labview seems to be sending
    > the data, but the problem is in which format does it send the data,
    > because in hyperterminal i just input the string "JDX" and it sends it
    > to my device, with labview it sends something but my device does not
    > recognize it.
    Hyperterminal adds the carriage return/line feed to the string which is
    generated by the return key to send out the current line. LabVIEW simply
    sends out what you tell it, so try to set the string to "Show \ Display"
    format and add a \r or \n or \r\n to the command you want to send out.
    Assumes of course that you set the right baudr
    ate/bits/parity etc in
    LabVIEW with the VISA property node, when opening the serial port.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • MEASURING FORCE ON BALANCE USING AN ELECTRONIC BALANCE FROM THE SERIAL PORT

    Hi,
    I am trying to measure FORCE using an electronic BALANCE from the serial port. My measurements are strange! The BALANCE sometimes give ZERO reading! Is it because of the sample rate, baud rate etc? I have attached the readings concerned.
    Attachments:
    databalance.doc ‏144 KB

    I think your problem is due to the way you read the weight :
    1/ask the balance to send the data
    2/oversee the byte number on the serial port until it is constant
    3/read the bytes received
    4/convert to number
    During step 2, you compare the bytes at serial port with the previous value. So far, you have been very lucky to be able to read something : the answer here is always ZERO since the readings occur BEFORE the balance has been able to send anything! means that your loop stops immediately (if you are not convinced, jujst add an indicator to display the loop index. However, since you added a wait (0.8 s), when going to step 3, the balance has had some time to send something. Here, you should not have read again the number of bytes at serial port, but that unwillingly corrects the previous error and you can read most of the received data...
    You should modify completely your algorithm. Usually, a balance send the weight as a string with some terminator (RC or LF). Accordingly, the algorithm should be :
    1/ask the balance to send the data
    2/read the serial port, concatenating the received chars until a terminator char is received or a timeout has occured
    3/convert to number
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How can an image be displayed by using raw data read from the serial port?

    Hi there,
    I am using an embedded camera to take photos. To operate it i send commands to it via the serial interface. I have received all of the image data back through the serial port and can view it as hex data in a string. The image data is 16bit colour RAW data at 160x120 resolution meaning i have 38400 bytes of data (160x120 = 19200. 19200*16 = 307200. 307200/8 = 38400). I want to be able to display this data as a picture, but cannot figure out how to do it. Can someone please point me in the right direction? i have been fiddling about with lots of the pixmap functions but no luck. Do i need to put this data in to a 2D array first?

    Yes, first convert it into a 2D array of pixel values. From there you can convert it into an image to display it in a picture control.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • I want to build an array using the data that I get through the serial port

    I am reading data through the serial port, but I want to buffer these data. I have seen a function, but i think that i can use this if I am reading data from I/O intrument, so I don´t how can I fill an array, with the data that I am reading!!!
    Thank you!!!

    I'll hazard a guess that you are reading data with VISA as a string. Then you want to convert that (probably with Scan From String) into a number. Then, you want to collect those numbers into an array.
    We don't really have enough information to tell you the best way to do this. Here are some ideas.
    If you are reading all the numbers from the instrument at once (e.g., a waveform from a scope), you might consider using "Spreadsheet string to array". Most scopes return the data as ASCII with commas between the values, so you'd wire a "," to the "delimiter" input of the "Spreadsheet string to array" function.
    If, however, the instrument is returning a single point at a time, there are more questions. Do you want to do this continuously, or do you want t
    o collect only a certain number of data points, and then process them as a block?
    If the latter, then you'd just acquire each data point, convert it to a number, and then use output indexing on the for loop to create your array.
    If the former, then you may want to store the data in a queue, and read it from the queue elsewhere in your program.
    If you let us know what you want to do, we can probably provide more precise help.
    Brian

Maybe you are looking for

  • Trouble with camera roll to iphoto

    Hi, Question i have is... If I have a picture in the camera roll on my iphone.  And it is not in the Photo Stream.  How do you get the picture into your iPhoto?  do you have to connect the iphone to mac (using USB) and import it? Thanks and I look fo

  • Lightning to HDMI adapter

    HY, i'm Paul and i've a problem with my Lightning to HDMI adapter Apple Original. when i Connected it to Tv, in the upper part of iPhone i can see a blu "Ribbon" for  2-3 seconds only. No input signal on tv. HDMI CABLE IS certified. In iPad or in iPh

  • Ios 7 photos

    Hi all, Yesterday I upgraded my iPhone 5 to iOS7.  Now, I see duplicates of all my photos in Collections.  I have also found I can only manually delete one of these photos (the little trash can icon does not display when viewing the 'copy'). These du

  • How batch export layers to files in CS5

    Hi, I am a newbie in CS5 , I tried to batch export layer to files in CS5 , because I have thousands  PSD files that I need to export layers in  separated png files.. In each script I made I have the following error.." reference error: dlgMain is not

  • Validation Rules Wildcards

    Good Evening (a really busy one for me :p ) is it possible to use wildcards on validation rules? Thanks Francesco