Serial port doesn't close properly

I'm working with the RXTX comm APi to connect a java application (jdk 1.5) with a mikrocontroller via a virtual serial port (using WinXP). I'm only jumping to certain addresses of the controller and then write into or read from them.
After some tricky problems that were already discussed in this forum I now encountered a new one:
After I finished my communication with the controller, I want to make a clean shutdown by closing the input- and outputStream, removing the SerialEventListener and finally closing the serialPort.
When I'm doing the latter, the program suddenly hangs totally. No exception is thrown and I have to terminate the application through the ide.
I monitor all the port traffic with "portmon" from sysinternals and it tells me that around 5 minutes after I tried to close the port, the javaw-process finally sends "IRP_MJ_CLEANUP" and "IRP_MJ_CLOSE".
Sometimes only the first one is sent, what makes it impossible to connect to the port again without a restart of windows (port in use by unkown application).
I don't have the sourcecode right with me now, so I can't post some examples. However I'm basically doing nothing else then most of the other sourcecodes concerning serial port connections posted in this forum. Anyway I will post some code later.
But for now, has anybody some ideas what could be the problem?
********* EDIT **********
Seems that it's not necessary to post my sourcecode because the same problem occures when I'm running the SerialDemo from the javax.comm 2.0 API.

Here's an update.  The serial port works fine, as long as I don't have any I/O pci cards in the machine.  Both my Adaptec SCSI controller and a Pinnacle AV card cause the same malfunction with the serial port.  When those cards are removed, it works!  No conflicts with IRQ or anything that I can see.....no errors reported by windows device manager.
P

Similar Messages

  • Dropped MacBook; hinge doesn't close properly

    Yesterday I dropped my MacBook while open backward on the floor and it fell flat on the back of the screen. Now if I want to close the screen (or open) in one of the corners the hinge does not close properly so the edge squeeks against the back of the bottom part. I'm afraid that in the long run this might cause problems as the screen has to be pushed slightly with it's friction. Are there any instructions somewhere where I can try to set the screen back in the right position?
    Thanks

    You might be able to use some of the information here, http://www.ifixit.com/Guide/Mac/ , to help accomplish this.

  • Serial port doesn't work in installed application

    I have a simple vi that reads serial data coming from a device, using the VISA Configure Serial Port vi. The development vi and the executable (.exe) versions work fine on my laptop, but when I install it on another computer, the serial port sees no data and there is no error message. All com port settings are the same between the Configure vi and both computers. I built a stand-alone application then built an installer, then installed it in the second computer and ran the setup.exe. The vi opens and works in every respect except for the serial port. What am I doing wrong?

    Is the COM port you have selected correct? Are the error clusters in your application all connected so an error will be reported if it occurs?
    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

  • Doesn't close properly the anonymous user's session.

    Hello experts.
    We are implementing the anonymous user in Portal, according to the following link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/1e/e19f58136e654d9709befa464314f2/frameset.htm
    We have used the notes: 709354, 837898 and 728106
    And the only problem we found and we couldn't solve is when the anonymous user navigate between links, Portal is trying to close the session anonymous without success, showing each click an Error like this:
    " Run-time Error Portal
    Exception processing application, send your exception ID Portal Administration
    11:07 20/01/100517_4300950 exception ID
    More details on this exception in the corresponding protocol file "
    We haven't found useful information in the default trace.
    For this we implemented the note "755947 - Session Release Agent - Guest Access" note but still unresolved.
    Any advice would be helpful.
    Best regards.
    Ernesto

    Hi Ernesto.
    You need to activate logging and tracing on Session Release Agent (refer to SAP Note 596698), then post an information relevant for Session Release Agent here.
    Best regards,
    Aliaksandr Zhukau
    P.S.: Do you use a FQDN?

  • My iPhone 5 charging port doesn't work properly

    I have to press my chairing pin in for my phone to charge?

    Either cable is faulty or iPhone is faulty. Both are currently covered by your 1 year Warranty. Make Genius reservation or set up service and take or send both to Apple for resolution.

  • IPhone 5: charger port doesn't work properly

    When I plug my iPhones cable into it it does not normally start charging, I find if I wobble the cable or push it to the left or right it begins to charge the phone, but even then the connection isn't great and will randomly disconnect and reconnect. Any ideas as to what the problem could be?

    Either cable is faulty or iPhone is faulty. Both are currently covered by your 1 year Warranty. Make Genius reservation or set up service and take or send both to Apple for resolution.

  • Charging flap won't close properly

    Hi all,I've had my Xperia Z for about two months now, great phone very happy with it except for this nagging issue. The waterproofing flap on my charging port won't close properly any more, everytime I close it the flap would pop out again after about 30 seconds. It's quite annoying to have it flapping about all the time but obviously it also means that my phone is no longer waterproof. The flap itself looks like new and the seal hasn't been damaged or anything, it just wouldn't stay in place. Is this a common problem? Should I send it back for a replacement?

    I got the same issue on my very new ZR (2 weeks).At first I found the flap quite efficient then I started to play with my new toy so I charged a lot, forgot about the flap... Now that my usage is more reasonable, I noticed the flap start to pop up after a few second. It stays inside but clearly it s no more waterproof and above all it s UGLY! I tried to clean the port as advised in another post on xperia care but it was only a bit better.Wait a few second and it s out. I think it comes from the connection between the port and the small rubber/plastic oval that enable the water protection. As cleaning with towel... didn't work, I took a small sharp knife and I gently rubbed the rim of the usb port on the phone.Of course be very careful. I did it very gently with no real hope it will work (I was ready to go to sony). I just wanted to be sure it was total clean and finaly................ it worked for me! I just hoped I won't need to do that too often... 

  • Cannot close Serial port socket on Server 2008, Can on XP

    As per the subject - running the same code using the same hardware, but different OS (Server 2008 Std. NOT XP Pro)will not work!
    It's all very odd... The port opens fine but will not close using SerialPort.close(), thereby causing problems the next time the port is opened (PortInUseException).
    Has anyone here experienced this before? Any suggestions as to where the problem may lie?
    Edited by: wizzkidd on Jan 19, 2010 7:46 AM - More descriptive title

    I have a serial port monitor open on both machines; it shows that the connection is still open (on Server 2008), even after the following is run:
         public void closePort() {
              if (serialPort != null) {
                   serialPort.close();
                   Console.print("Closed port: "       + "(" + commPort + ")");
              else {
                   Console.print("Port is still open: " + "(" + commPort + ")");
         }However, on XP, the connection is closed properly.
    Upon failure to close the port, the code has already been run, however, no exception is thrown.
    Edited by: wizzkidd on Jan 19, 2010 7:56 AM

  • MacBook Pro display doesn't close down properly.

    We have one MacBook Pro that doesn't close down properly. The display just bounces up. Is there any way to fix this or is this something that needs to be fixed by a technician?

    Try blowing out the slots where the two "prongs" come up, and the release button slot (push it in and out a bit while doing this) with compressed air. (use your lungs if you don't have a can of air).
    Often a bit of crumb or other gunk will impede the mechanism enough to prevent the magnets from being able to do their job properly.
    Cheers
    Rod

  • TS3212 Hi my itunes has stopped working but every time i try to reinstall it it doesn't work properly and asks me if i want to totally remove itunes or replace/repair. I choose replace/repair but it just closes immediately and says it was interrupted...cl

    Hi my itune on my PC  has stopped working and every time i try to reinstall it it doesn't work properly and asks me if i want to totally remove itunes or replace/repair. I choose replace/repair but it just closes immediately and says it was interrupted...does anyone have any clues?

    Hi Shawn and Jason,
    I have the same problem. One workaround is to clean your disk before running LiveCycledesigner. After you have cleaned up your disk LiveCycleDesigner will start a few times and you can work with it.
    It is an Vista problem. LiveCycleDesigner 8.1 which is just released had fixed the problem so you can also download 8.1
    greetings Fons

  • Facebook app on iPad doesn't open properly, it opens , then doesn't go to the loggin page, it just closes again without displaying anything

    Facebook app on iPad doesn't open properly, it opens , then doesn't go to the loggin page, it just closes again without displaying anything, how do I fix this ?

    This worked for me... A little time consuming but once you get rolling it goes GREAT... Thanks....
    I got my artwork and saved it to my Desktop
    Opened up Microsoft Paint and clicked on "File" and "Open" and found it to get it on the screen to resize it
    Clicked "resize" and a box for changing it opened up
    Checked the box "Pixels" and "Unchecked maintain aspect ratio"
    Set Horizontal for 640 and Vertical for 480
    Clicked on "OK" and went back to "File" and did a "Save As" and chose JPEG Picture
    It came up "File Already Existed" and clicked "OK" (really did not care about the original artwork I found because wrong size)
    Went to iTunes and on the movie right clicked on "Get Info", clicked on "Details", then "Artwork"
    Go to the little box on the top left that shows your old artwork and click on it to get the little blue border to appear around it and hit "Delete" to make it gone
    Click on "Add Artwork" and find it where you put the one from above on your Desktop and hit "Open" and OK and your new artwork is now there and all good.
    Sounds like a lot of steps to follow but after around 5 or so you will fly through it. This worked perfect on my iPhone 6 Plus and I have artwork on my Home Videos now.

  • How can I stick an accordion navigation MENU on top of a mobile scrolling page and make it work properly? As I can't pin it, I keep it on top of the page with scroll effect 0. It collapse, shows the menu buttons but doesn't close back once it reaches the

    How can I stick an accordion navigation MENU on top of a mobile scrolling page and make it work properly?
    As I can't pin it, I keep it on top of the page with scroll effect 0.
    It collapse, shows the menu buttons but doesn't close back once it reaches the anchorpoint.

    Muse won't let you, at least not that I know of. You could find the class in the code that muse gives it position: fixed…I think. You could paste it into the head area of your page properties to override the class. I believe something like this would give you persistent nav bar, pinned at the very top, on mobile:
    #youmuseclass {position: fixed;}
    I wouldn't use any parallax on mobile either, the performance is terrible.

  • VISA get resource name doesn't return USB serial ports

    We built an application on a computer that had an onboard serial port - COM1.  We put the option to change the COM port in the application.  We installed the built application on a computer with no serial ports, but installed a USB to serial converter that registers as COM3.  LabView does not see this port, even with a test application to return only the VISA resource names. 
    We have verified that the port is good with another program (a Modbus simulator) and installed the latest VISA runtime v4.41 separately to no avail.
    Any suggestions at further troubleshooting would be extremely helpful.
    Joe T.
    Solved!
    Go to Solution.

    My main application still isn't working, but now the small test ones are.
    Here's what I did:
    1.  Update my LabView 8.5 with the latest VISA runtime - 4.4.  This updated the Installer as well.
    2.  Added the MAX Installer to the build.
    3.  Added  the NI-VISA Configuration Support to the build
    4.  Uninstalled the application and reinstalled it with the new install volume.
    When I run MAX, COM3 shows up.  It also shows up in the Get Resources test application.  The simple test Modbus write program works, too.  I have a sneaky feeling that COM1 may be hard-coded somewhere in the main application; our next task is to find where the communications breaks down in our code.  The bottom line seems to be a lack of experience with the Application Builder on our part.
    Thanks to all who contributed!
    Joe T.

  • Desktop software. serial port not configured properly

    i cant seem to configure my serial port. actually i just dont know how.....ive went into serial setting but i cant seem to find a port number. it doesnt detect anything.....????? can someone with some patience pleeeeeeeese help me. thx alot

    Port is supposed to be auto detected!! Have you tried detecting the port manually by going to connection settings and pressing detect button ? Which version of desktop manager your're using?
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • Serial port: Input/output signal errantly combined

    I am currently in the process of using LabView to replace another user interface for a scientific instrument.
    LabView is connected to this instrument through a serial port.  The instrument streams 25 bytes of binary data every second to the computer.  I can read the binary string (VISA Read) and save contiuously to disk using a while loop.  In addition, there are a few instructions I can send to the instrument that will do various functions (start logging, turn LEDs on/off, etc).  I can successfully send these instructions to the instrument using the previous interface, and in a stand-alone vi using VISA Write, but when I place the VISA Write function into the larger interface vi, signals go haywire.  Specifically, there are two separate LEDs that I can toggle with two different commands, but when in the larger interface vi, both commands toggle the same LED.  Also, it appears that the singal I send to the instrument (a single ASCII character) immediately bounces back to the computer into the 25 bytes of streaming binary data.  In other words, after I press the LED "on" key, one column of my streaming data changes when it is not supposed to (ex: after Binary to ASCII conversion, it changes from a single digit to a twenty digit value).
    Initially, I thought the problem was the sequence of VISA Read/Write.  In the current configuration, I read all data, then allow for Write commands.  Both the VISA functions are within the same While loop to continuously monitor the data.  Is it possible the Write signal output is not leaving the while loop and being read as input?  What would make the instrument read two different commands as the same one?  My goal is to run an interface that displays the streaming data as ASCII, and allows for a few different toggle options while the interface is running - is there are more efficient/elegant way than a while loop?
    ~Going Bananas
    Solved!
    Go to Solution.

    New replies now in gray.
    CodeMunkee wrote:
    1.  If you keep giving me good advice like this, I'll be tempted to change the background to Baltimore prison purple.
    I'll ignore this statement.
    2.  The buffer now lives outside the loop.  I understand clearly.  Part of the problem might be my instrument - when I cycle power the 19 digit number that was 'echoed' disappears.  Forget about that display stuff, it works properly - I accidentally removed the time delay when editing the vi.   But you do bring up an interesting point...
    Without the delay, the loop ran much faster.  If the bytes weren't at the port, the read statement would have returned nothing when it read zero bytes, thus blanking out the indicator rather quickly.
    Yes, Hexadecimal display shows 04 to indicate the end of the 25-byte data sample.
    Doing a bytes at port read is not always a good idea.  If not all the bytes had arrived yet when you ask for the read, you won't get all the data.  The remaining data being sent in that stream from the instrument will show up at the front of the buffer on the next read command. 
    While this isn't a common occurence, it does happen.  How can I prevent this from ever happening?
    Since you know each commands ends with a hex 04 (ASCII character for EOT), you could enable the termination character when you configure the serial port.  Set the termination character to be 4.  Then when you execute the VISA read, read a large number of bytes such as 25 or more.  The read will terminate at either the timeout, the requested number of bytes, or when the termination character is read.  With this setup, you could eliminate the wait statement and also not request the number of bytes as the port.  The VISA read will control the pacing of the loop.  Any extra bytes after the termination character are part of the next frame of data and will wait around until the next time you read the VISA port.
      3.  Implementing your ideas for the latch button works better.  I am still encountering issues with these commands however.  Attached is the new vi.  There are two commands I want to send, 't' turns on the LED light (they blink for 30 sec then time out), and the latch works perfectly for that, 'p' turns on the magnetometer light (an additional 'p' is required to turn it off), but I cannot get the command sent to the mag while the loop is running.  It turns on either at the beginning of the vi, or at the end of the vi (after Finish button is pressed).  This leads me to think the command 'p' is stuck inside the loop.  I tried adding another film strip (see attached vi) for the toggles to force the issue, but it didn't work. Additionally, the 'p' command effectively works as a 't' command, and the LED lights begin to blink when I press the 'p' button.  This isn't supposed to happen, and leads me to believe the 'p' command does in fact exit the loop but in the wrong manner.
    The "film strip" is another frame of a flat sequence structure.  It enforces the order of execution.  The next frame can't execute until everything in the prior frame has completed.  It isn't necessary in your case because the Error and VISA wires determine the order of execution with respect to the other VISA statements.  But it shouldn't hurt.
    There is no reason the "p" case structure should behave any differently than the "t" case structure.  Although you should wire the error wire through in the False case of the "p" structure like you did for the "t" structure.  There is no "exiting of the loop" in either case.  The loop runs until the stop button is pressed.  I would check the manual to see that t and p commands do what you think they should do.  Do they need a termination character of their own when they are sent?  Should they be upper case letters rather than lower case?  You can run NI Spy on your serial port and see the operations occurring with it and see the data coming in and what data is going out.  I would be suspicious that the device is not handling the command properly.
    Any ideas?  I think I've tried to put the toggle buttons outside the loop before, but then could only toggle once before the loop took over.  Ideally, these toggles would be available at any time while the data is streaming, so therefore inside the loop?
    The toggle buttons need to be within the loop so that they can be read on every iteration of the loop.  Outside the loop, as you discovered, they are only read once at the very beginning before the loop is started.
    4.  Thank you for the suggestion about the Selection Mode for the Open/Create File option.  It is annoying to create a file first.  I made the change, but I still get error messages when I use a file that does not yet exist.  LabView takes me to the first Open/Create/Replace vi when the error occurs.  Is there something else I must do?
    On the open file VI, there is an input that is Open as default when unwired.  Create a constant there and change to Replace or Create.
    Remember, if you have any questions about the way LabVIEW is handling something with serial ports, close the port within LabVIEW.  Open Hyperterminal and try the commands from there.
    Message Edited by Ravens Fan on 01-13-2009 03:55 PM

Maybe you are looking for

  • How do I use copyprofile, image manager and create a wim file to Sysprep a reference Windows 8 computer.

    Im trying to deploy a reference machine (configured) to other machines (exact or close image) with different hardware. I have successfully used sysprep in out of the box, generalise, shutdown mode although i havent tried to deploy this to another dev

  • Mid 2007 iMac SSD in optical bay - cannot write to last block of device

    Hi All, I've just replaced my optical drive in my 20" mid 2007 iMac (Dual core, 2.4 Ghz, 2 Gb RAM running Mavericks) with a solid state drive (Crucial MX100). The plan is to transfer my boot disk to this drive while keeping my 1 Tb HDD for media and

  • Printing problem with Lightroom 5

    Lightroom 5 CC is printing a 1/2 inch discolored bar vertically down the right side of my photos regardless of size (ie 4x6, 8x10). It only happens if I print one photo on photo paper the same size as the print.  For example, if I print 2, 4x6 photos

  • Iphone 5 and cruising

    Hoping someone could help me with the correct answer.  I have called Verizon Wireless 3 different times and got 3 different answers. It's simple.....I am taking my Iphone 5 on a cruise with me.  I want to have access to be able to make or receive a p

  • Apple pro res 4444 info?

    COuld someone tell me the data rate for apple pro res 4444 codec? how many megabytes per second does it demand? Will I be able to run it from a 7200 rpm firewire 800 single mobile drive? Thanks!