Pb with the serial port

hello
I'm making a programme that deal with the serial port
when i press on the button sennd of my serial device ,I get nothing .
infact i have to press about 4 times to get the output
I will get 4 outputs result at once
I believe that my problem come from
fluxLecture.readLine();I think that my machine is not sending the end of line
what is strange that the "while" will stop but it wont execute the next line
System.out.println("I'm ouside ");any idea ?????
thank you in advance
try {
               fluxLecture =
                    new BufferedReader(
                         new InputStreamReader(serialPort.getInputStream()));
          } catch (IOException e) {
          }then somewere else in my class I use this
public void serialEvent(SerialPortEvent event) {
          switch (event.getEventType()) {
               case SerialPortEvent.BI :
               case SerialPortEvent.OE :
               case SerialPortEvent.FE :
               case SerialPortEvent.PE :
               case SerialPortEvent.CD :
               case SerialPortEvent.CTS :
               case SerialPortEvent.DSR :
               case SerialPortEvent.RI :
               case SerialPortEvent.OUTPUT_BUFFER_EMPTY :
                    break;
               case SerialPortEvent.DATA_AVAILABLE :
                    try {
                                    while(fluxLecture.ready())
                                        result_output = result_output +" "+ (String) fluxLecture.readLine();
System.out.println("I'm inside");
System.out.println("I'm outside");

sorry for being late but as I have alot of work ,so ......
Are you using package RXTX or javax.comm?javax.comm
I tried to chek if the readline is null ,the answer is no
so my while stop but does not execute the next line
strange ????

Similar Messages

  • Establish a connection with the serial port on ST2510

    Hello guys,
    I have one question about connection on ST2510 with the serial port.
    Is it possible to get the following command prompt during connection on ST2510 through serial port (as described in the document 820-0015-11):
    "Enter password to access shell:"
    instead of
    "Enter password to access Service Interface (60 sec timeout):"
    ?

    stapler wrote:
    Thanks a lot,
    ...and how is it possible to get "Enter password to access shell:" instead of "Enter password to access Service Interface (60 sec timeout):" (wrong cable connection, etc.)?
    I ask about it, because one guy said me, that he tried to establish a connection according to the document 820-0015-11.
    But instead of "Enter password to access Service Interface (60 sec timeout):" he has got "Enter password to access shell:" and the default password kra16wen is incorrect.I won't indicate how to get "Enter password to access shell" because this is a special access as indicated in my previous post. However in order to get "Enter password to access Service Interface (60 sec timeout):" you need to press "S" (capital S) within 5 sec and then the password is "kra16wen".

  • Big Problems with the Serial Port

    I'm Spanish and my English is not very good, I'm sorry but I need your help.
    I want to connect two computers (my desktop and my handbook) with the serial port (COM2 in both sides).
    I have the cable.
    I have installed JBuilder 7 in both computers.
    I have installed "commapi"
    I'm running SimpleWrite.java (the example from Sun) in one of them and SimpleRead.java in the other.
    I don't get in any moment receive any data.
    I execute first SimpleRead and I can see what this process is waiting something. After, I execute SimpleWrite (many times), this process star and stop correctly but never the first aplication receives nothing.
    I am trying for four days, I am desespereted.
    I need your help is very important to me. I don't understand what is happening!!!!. This is my e-mail: [email protected]
    Thank you very much.
    NOTE: my handbook has just one serial port, before had a winmodem but it was eliminated.

    hi,
    when your notebook has only one port, how do u know that this port is COM2? I think u gave a wrong parameter for the SimpleReader or SimpleWriter so one send data to a port (say COM1) but the other receives data from another port (say COM2).
    regards,
    eedych

  • How to communicate two PC's with the serial port with Netbeans

    Do you know how to do it?
    Do you know how to communicate with the parallel port too?
    Could you give some ideas?
    What commands or instructions I have to use?

    What does NetBeans have to do with it?
    All these "people" today that start out in Java using all these "nifty" IDE's. All it does is produce exactly this. They think their IDE is Java. Once they no longer have their one specific IDE in front of them, they can no longer function. They have no idea what the classpath, what the compiler actually does, how to package a jarfile, hell, most of the time, they don't even know how to execute a simple application.
    As far as your question. Did you even try to Google for some Serial port API package? Assuming you did, did you download it and read the documentation that comes with it? Did you search for a few examples on the web? Did you read them? Did you try them? I can almost guarantee that the answer to everyone of those questions is "no". So, my question for you is, "Why should we help you?" You obviously have no desire to help yourself, so I think we should reciprocate in kind. Don't you?

  • 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 to control an Xserve G4 with the serial port

    I have an Xserve G4 first generation, and was wondering exactly how you would go about connecting to it via serial port incase I need to change something when there is a network issue. I have looked around the internet without much success. It has Leopard Server on it, so Apple says the baud rate is 56700, and 8bit, no parity. So that's all set in the client machine, which is a MacBook Pro with a USB to Serial adapter on it, which shows up in Zterm. Once I'm in Zterm, it just sits there, and pressing enter doesn't prompt a log in. Does anyone see what else I'm most likely missing?
    Thanks

    Thanks for the reply Cemelot. Yes, I did create a profile in ZTerm. This is what I have it set to.
    I also read that you're supposed to run the command "/usr/libexec/getty serial.57600 /dev/tty.serial" on the Xserve itself.  It made no difference if I did that or not. I also checked to make sure tty.serial was inside /dev/. Anything else I'm missing? Thanks again.

  • Problems with VISA and the serial port

    Hello,
    i have a little problem with the serial port and VISA. I have changed an existing LabView- Software in that way that I have replaced the serial- module by the VISA- module. The function of the program is to communicate with different devices by RS232. After changing the modules to VISA the software doesn't work probably. The problem is, that when I try to communicate with one of the devices first I get no answer. When I try it a second time after some seconds the communication works perfect. After about a minute I send another message to my device but there is no answer again. I have to send the message again.
    I hope someone in this forum can help me with my problem
    cu Marco

    Marco,
    this sounds very much like a problem with the termination of your messages. You may have to tell VISA to add a termination character. Please follow the instructions in this document.
    Best regards,
    Jochen
    National Instruments Germany

  • 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

  • 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

  • Labview needs 2 goes to start the serial port

    Hi,
    When I use Labview with the serial port handlers, beit VISA or the
    serial routines, I always have to run my external device
    (microcontroller based system connected through the serial port) and
    then run Labview but the first time I run it it never works. I then
    need to reset my microcontroller system and run my Labview program
    again and it runs fine, and every time after that.
    Has anybody else noticed this and what can I do to fix it?
    Ken

    Your statement "it never works" is kind of vague. How doesn't it work? Do you get an error, garbage data, no data, or what? Is this system always spitting out data that needs to be synchronized? When you have it working, stop the LabVIEW program and restart it right away, do you have the same problem or do you only see it after stopping the system and restarting it? Aside from recomending that you do a flush of the serial port buffer before sending and receiving data from LabVIEW, more details would help to provide some sort of solution.

  • I'm having trouble communicating with a transducer (Keyence LS-3100 laser scan micrometer) via the serial port. It works in Hyperterminal. Any suggestions?

    Its not a simple baud-rate or parity error. If I issue the command to send data (X1) in hyperterminal I start to get data. If I then switch to Labview I still get data. However if I try to issue the send-data command via Labview I get nothing (i.e. I can read from the device, but not write to it).
    I am on a Windows 98 (version 2) PC, running Labview 5.1.1

    Try adding a carraige return to the end of your command.
    "djb" wrote in message news:[email protected]..
    > I'm having trouble communicating with a transducer (Keyence LS-3100
    > laser scan micrometer) via the serial port. It works in
    > Hyperterminal. Any suggestions?
    >
    > Its not a simple baud-rate or parity error. If I issue the command to
    > send data (X1) in hyperterminal I start to get data. If I then switch
    > to Labview I still get data. However if I try to issue the send-data
    > command via Labview I get nothing (i.e. I can read from the device,
    > but not write to it).
    > I am on a Windows 98 (version 2) PC, running Labview 5.1.1

  • 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

  • Problems reading the serial port with labview 5.1.

    I open the example serial.vi , I select write to serial port, run the programm, I don`t have any problem. But when I select read serial port, I get the error code 16392and hex code error x4008. I need to know what can I do? Thanks a lot

    Any time you get an error in LV you can right click on the error cluster indicator and do a "Explain Error".
    If you do this for the error code you reported, the explanation says that it was a framing error.
    In serial communications, a framing error indicates that the hardware was not able to detect a start bit, data then the stop bits that comprise a frame.
    This prompts me to suggest that you check you port setting on the serial port. You want to make sure you are setting the port for the correct;
    Number of start/stop bits,
    Baud rate
    data bits
    parity (just for good measure)
    and hardware handshaking.
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Problem on WinXP / Labview 6.1 with VISA (serial port)

    There is a problem on WinXP / Labview 6.1 with VISA which i use to poll the state lines of the serial port. The only functions that i use are "VISA Open", "Find Resource", line state properties and "VISA close".
    On my own machine (WinME) it works fine as a standalone application (with runtime engine in the same direction), even if i rename the Labview directory so that Labview is not found.
    From my VXIpnp directory i deleted all but these files:
    directory "Win95",
    subdirectory "Bin" containing "NiViAsrl.dll",
    subdirectory "NIvisa" containing "visaconf.dll".
    When shipping this to WinXP (and copying "VXIpnp" to the root directory), the serial port was not found, so i renamed the direction "Win95" to "
    WinNT", but this did not work also.
    I installed the VISA server, although it seems not to be required -- no result.
    Final question:
    What must i do for distributing the program as a standalone application for all windows platforms?

    Hey Joachim,
    In order to create an installer that includes the VISA Run-time engine for serial IO you will have to purchase LabVIEW 7.x. See screen shot. This packages a small compact version of the run-time that can only be used for serial, but it takes up much less space. The installer that I created has my application, the LV Run-time, and the VISA run-time and it is about 26 MB.
    That is much smaller than if I had to include the 32 MB LV 7.1 run-time and the 14 MB VISA run-time separately. It would have been even smaller if I would have uncheck some of the items that I wasn't using.
    -Josh
    Attachments:
    advanced.JPG ‏31 KB

  • 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

Maybe you are looking for

  • Error in execuitng a trigger

    I am getting the following error in executing while executing the "dropping the trigger " , "creating a trigger " . or executing any stored proc . Please advise . I am on 10g Release 2 on Redhat linux . SQL> drop trigger logon_trigger ; drop trigger

  • Site Won't Publish

    I have been having ongoing problems with iWeb. I thought that I had fixed them, by creating a new account on my computer and shifting my domain to that account and useing iWeb there to pubish and edit my page. I just added a photo album and now when

  • 11G ADF BC: First time loading the page, how to disable some components?

    Hi, I have a fusion web application created using Jdev 11G ADF BC. I am working on a search/results page that has a panel split. In the left panel, there is a list of nevigation links. The data shows in the right panel. What I want to achieve here is

  • Upgrade from Indesign CS3 to Indesign CS5 server

    Hi, I have been looking on adobe site to check if I can have an upgrade from Indesign CS3 to Indesign CS5 server. I have Indesign CS3 license but need to migrate to Indesign CS5 server. Does anybody know whether it is possible to buy upgrade from Ind

  • Capture Action when data changes in Infotypes

    First of all ,  I am not a HCM(functional)  , I am a MDM technical person. I am not sure this question is relevant to this forum. Please bare with me while reading this question: We had a requirement saying that whenever person, position or orgunit c