Port identification(com1 port)

Help me pl
I am developing an application for rfid in java.In that i am finding the ports in system.(com1..).I am not able to find the ports.It is throwing exception.How to find a port.
my code is,
CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM1");
the exception which i got is,
No port named COM1 foundjavax.comm.NoSuchPortException
javax.comm.NoSuchPortException
at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.ja
at connectPro.main(connectPro.java:40)
Help me pl...

I think you can create a Socket instance yourself.
If it works, then the port was open.
If the constructor fails, the port may have been in use.
What would be nice, especially if you have to work through a firewall, is to have a property file which sets which ports / port range you can use.
Example: 2000 - 2050
Then you use a for loop to run through that range, attempting to open a socket.
To test whether this theory works, you can open a socket, then try opening it again with another socket.... see if it fails.. then you know you have a way to determine if a port is in use or not.
Ps. Steer clear of ports under 1024, as these are "well known ports" and by convention reserved for other applications eg. mail, telnet etc.
regards,
Owen

Similar Messages

  • How to force the "Bluetooth Communicat​ions Port" to be one of COM1 to COM8 ports?

    Dear Lenovo Community, Happy Holidays to you all and wish you a great happy new year. Recently purchased a Bluetooth OBDII device and have difficulty making it to work with its provided software on my T61 (running original XP Home). My short story and question/problem is that I can open "My Bluetooth Places" and pair with the OBDII device as an "OBDII SPP Dev", but my T61 assigns serial port COM19 to it. The OBDII software which came with the device only can let user set to one of the COM1 to COM8 ports and in the properties of Bluetooth pairing, there is no way that I can select which COM port to use. I looked at the Device Manager and I do see these COM port assignments: COM4,5,6,7: Sierra Wireless (the HSDA modem in the laptop which I have never used BTW) COM 9,10,11,12,13,14,15,16,17: Bluetooth Serial Port COM 18, 19: Bluetooth Communications Port and I don't see anything for COM1,2,3, and 8 My question is how to force the computer/OS to assign one of the COM1 to COM8 ports to my device upon pairing? Can I disable the Sierra Wireless model from the COM ports list and hope this will happen? Thanks for your help and inputs beforehand. Regards, AL

    Hi, AL_K
    Have you attempted to change the port number in device manager itself? If you navigate to Device Manager and open the list of Ports, you can right-click on the device you wish to assign a different port number. After right-clicking, click Properties. There should be a tab called Port Settings. In here, you should find a setting to manually assign a port number.
    Good luck, and let me know how it goes,
    Adam
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution!" This will help the rest of the community with similar issues identify the verified solution and benefit from it.

  • "The selected port, COM1, is not available..."

    I had a Sony Clie working just fine on my new Dell XPS 400 with Windows XP 2005 Media edition. It died on me and when I went to recharge it, I got a message I'd never gotten before:
    "The selected port, COM1, is not available at this time. HotSync Manager will open the port when it becomes available."
    I just bought a new Palm Z22 and I'm having the same problem.
    The crazy thing is, I HAVE NO COM (SERIAL OR PARALLEL) PORTS ON THIS COMPUTER! Consequently, there is no "Ports" icon in the Device Manager.
    I'm totally stumped. Any help would be greatly appreciated!!
    Post relates to: Palm Z22

    I am having the same problem on both my PCs (HP Laptop and Dell Laptop) using Bluetooth via USB. I can connect with the cable just fine every time. I also successfully HotSync’ed via Bluetooth the first time.
    After shutting down the PCs, the I get the "The selected port, COM X, is not available at this time. HotSync Manager will open the port when it becomes available."
    I've gone in to the Microsoft Bluetooth manger and added and deleted ports several times. That hasn’t worked.
    Help!!!

  • How can I write bits through the COM1 serial port?

    I'm trying to write bits through the serial port COM1.
    Labview "Write VI" only writes everything in string. It seems. How can I write bit by bit through COM1?
    Thank you,
    Van

    Serial transmission (COM port) protocol requires sending a group of bits at one time. You cannot just send one bit. Standard COM port settings must be either 7 or 8 data bits, 1 or 2 stop bits, etc... You have to group your bits 7 or 8 at a time. You could probably send a 0 byte or a 1 byte. This would be like sending 0000 0000 for a low bit and 0000 0001 for a high bit. Your receiving end would have to know how to interpret what you are sending if you choose this method. Of course you have to convert your byte into a string before sending to COM port. Wire a U8 data type to a Build Array input. Then wire the array output to a Byte Array to String input. The output of this function will be the character representation of your byte suitable for sending acr
    oss a serial port.
    - tbob
    Inventor of the WORM Global

  • I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadshee​t. Any ideas?

    I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadsheet. Any ideas? Right now my data will collect one reading instead of continuously reading my IMU which displays data in a continuous stream.
    Thanks
    Attachments:
    Read_IMU_Drew.vi ‏21 KB

    Hi
    Your vi is in 2009 version, which i am unable to open in 8.6
    However, if you want your data to be saved in excel sheet, here is the VI
    Somil Gautam
    Think Weird
    Attachments:
    save to excel.vi ‏12 KB

  • Msi 5124 serial port com1 com2

    i have a mainboard msi 5124 and want to use the serial port (COM1) for connecting a standard serial mouse. however i cannot get the mouse to work nor even be detected. not under dos nor under win98.
    before i used a ps/2 mouse, and never a serial mouse.
    most likely the pin-connections are not correct.
    can someone please give me a layout of the pins of the COM1 and COM2 port on the mainboard? on the msi homepage the manual is just 6 pages - which do not cover this information
    thank you,
    PS: the keyboard i am using is still ps/2 and is working fine.

    YOU CAN USE ACTIVEX COM CONTROLS IN YOUR FORM.

  • ThinkCentr​e M72e Serial Port/Com1 datasheet

    Hello, I would like to ask you a diagram COM1 connector on the motherboard, specifically where I can find the pins RXD, TXD, GND on PC Lenovo ThinkCentre M72e. Thank you for the quick help 
    Link to image
    Moderator note: images totalling more than 50k converted to links per forum rules:  Lenovo Community Participation Rules

    there's a way to list all ports available
    try listing them and check if you have COM1 there
    Kuba

  • Serial port identification

    I'm using LabVIEW 8.2 to communicate throught serial port. 
    I developed the software in one PC but I needed to change it.
    The program was ok. In this new PC, LabVIEW can't identificate the serial ports. I tested the ports throught Hyperterminal and they are ok.
    How can I make Labview identificate then?
    (I have NI DAQMX 8.8 installed)
    Thanks,
    Carol
    Solved!
    Go to Solution.

    Carol_UFRJ wrote:
     LabVIEW can't identificate the serial ports.
    Hey, I just learned a new word today!  And all this time I thought "Identify" was the verb associated with the noun "identification".

  • I'm having problems communicating with a Thermotron AST-8800 Controller via RS-232 COM1 Port

    Spoiler (Highlight to read)
    I configure the RS-232 COM1 port in my laptop for 19200Baud, 8bits, NOparity, 1StopBit, NONE_flowcontrol, CR_termchar.
    When I sent the IDEN? command (Thermotron's *IDN? version), I got Warning # 1073676294, "The number of bytes transferred is equal to the Input Count. More data might be available".   I then doubled the Write count and sent it in as the Read count.
    The response I get is this: ýýýýýýýýýýýý.
    I have tried a Null-Modem cable, with and without Termination Characters, and no luck.   Any ideas ?
    Attachments:
    AST8800_Response.jpg ‏329 KB

    In addition to what RavensFan suggested, I'd also suggest that you reference the Themotron product manual. If you see garbled characters in hyperterminal, this could indicate the baud rate is not configured properly. Please verify that the controller should be configured for 19200 8-N-1.
    Doug W
    Applications Engineer
    National Instruments

  • Firefox is not respecting HTTPS to a non-443 port when identification is required

    Firefox seems to be turning my HTTPS request into a plain HTTP request when I try to access a page that requires identification via a certificate (I don't know what this, specifically, is called). The server returns a 400 Bad Request because a HTTP request was sent to a HTTPS port.

    It would be easier to get an Airport Express and use it to bridge WiFi to ethernet, putting the Airport Express in "Bridge" mode.
    Or find a way to run ethernet from your router to the device.
    Or get a pair of Power Line Ethernet adaptors.
    The problem is that the easy solution on the Mac is what you are doing, however, it is acting as a NAT router and as such various discovery protocols used by the Pioneer unit will not cross the router boundary.
    There is mostly some kind of software out there that will allow the Mac to act as a bridge or gateway and not a router, but Apple did not package that up in an easy to use GUI.

  • Port identification question

    I am writing a single app to control two arduino based microcontroller boards. How do I identify which board is connected to what port? Also to clairfy I can send primitive data types over serialization protocols however I cannot send something like a string over it? Thanks

    TheSponzyParadox wrote:
    I am writing a single app to control two arduino based microcontroller boards. How do I identify which board is connected to what port? Wrong site.
    The IDE for that might be written in java but the programming language and architecture is not java.
    There is a forum for it which at least has some occasional traffic.
    If you do not already have at least a medium experience level with C/C++ then you should probably focus on the basics of learning that first.

  • Port identification-help

    hello everyvody!!!
    i want to use dynamic port allocation instead of assigning static port in the text field,but i don't know how to check the port is free or not and assign the free one for use.Please help me....

    I think you can create a Socket instance yourself.
    If it works, then the port was open.
    If the constructor fails, the port may have been in use.
    What would be nice, especially if you have to work through a firewall, is to have a property file which sets which ports / port range you can use.
    Example: 2000 - 2050
    Then you use a for loop to run through that range, attempting to open a socket.
    To test whether this theory works, you can open a socket, then try opening it again with another socket.... see if it fails.. then you know you have a way to determine if a port is in use or not.
    Ps. Steer clear of ports under 1024, as these are "well known ports" and by convention reserved for other applications eg. mail, telnet etc.
    regards,
    Owen

  • How Vlan identifies from which port the data has come ?

    Hi ,
    We know that more number of ports can be configured to same vlan. How vlan distinguish between the ports ? How vlan knows from which port this frame has come ? in tagging we add the vlan id to the frame and not any other info ? little confused on how this haapens ??

    Disclaimer
    The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
    Liability Disclaimer
    In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
    Posting
    A VLAN doesn't really distinguish between ports.  A switch does, though, "remember" (for some time) the source MAC as frames enter its ports.
    Tagged frames may contain more than VLAN ID, such as L2 CoS.

  • Read Data from Communication Port (COM1)

    I am designing a system for a weigh Bridge using FORMS 4.5. The computer is connected to weigh Bridge meter through com1. Is there any command or procedure through which I can read that particular reading through com1 and incorporate it in my Entery Form. If some one knows please give me feed back
    Thanks

    Hello adigerimu,
    If you are using National Instruments ComponentWorks (Tools for Visual Basic) package, you can find serial examples located at "C:\MeasurementStudio\VB\Samples\Instr\Basic Serial" or wherever you installed Measurement Studio. We also have an example that uses VISA online at http://zone.ni.com then click RESOURCE LIBRARY >> COMPONENTWORKS >> GENERAL and look for links that mention "serial". If you are not using ComponentWorks, then this is not the appropriate newsgroup for your question, and I would recommend you start by looking at http://www.msdn.microsoft.com.
    Jeremiah Cox
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • M500 with V4.0 Desktop Software won't HotSync Windows Vista (32 Bit) - Message Com1 Port Not Available

    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

    Try using Palm Desktop 6.2.2 together with the free utility called PalmHotsyncSetup available from www.pimlicosoftware.com and let us know if you have any better success.
    smkranz
    I am a volunteer, and not an HP employee.
    Palm OS ∙ webOS ∙ Android

Maybe you are looking for

  • Application Builder Create Page Wizard... huh?

    I just tried this wizard to create a wizard. I assumed the wizard would look like the Apex wizards with a "step" ladder. The Wizard wizard seems to create pages, next, previous, and cancel button and not much else. I tried creating it using tabs, jus

  • Method.invoke

    Hi, I'm trying to dynamically load various classes at runtime but have encountered a problem with the Method.invoke() method. Class c = Class.forName( "car" ); Method m = c.getDeclaredMethod("Execute", new Class [] { String.class } ); object res = m.

  • Inbox won't rotate with iPad

    My inbox has stopped rotating as I turn my iPad.  All other apps rotate as expected just the inbox that has stopped. Other than this it seems to be working perfectly. Can anyone help me fix it?

  • System.in newbie problem

    I'm new in java and i can't find anywhere: Like i have PrintWriter object (and OutputStreamWriter(System.out,"codepage"); I want the same thing, to read form windows console, for example a String... (is there an object, that is similar to OutputStrea

  • No DEFAULT or UI configuration directive found

    Upon booting from a usb installer of the 1686 netinstall, syslinux presents the error No DEFAULT or UI configuration directive found. syslinux.cfg wrote: SERIAL 0 38400 DEFAULT vesamenu.c32 PROMPT 0 MENU TITLE Arch Linux MENU BACKGROUND splash.png TI