• Post Reply Bookmark Topic Watch Topic
  • New Topic

COM Ports  RSS feed

 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this is not strictly a Java question but Java brought me to it so if anyone can help or point me in the right direction, I'd much appreciate it.
I'm attaching a Serial Reader Keypad to my only remaining com port at the back of my PC. A Java class tries to locate it but can't. What do I need to do, if anything to allow a new device to be seen by my PC? I thought it might be a driver issue but someone here who does have it working swears blindly that he did nothing but attach the reader.
I've no idea what to do.
Thanks for any help.
Paul
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your OS see the COM port?
 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think so but how can I tell for sure?
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try some code like this to see if Java can see your port. If not, it's probably a hardware issue.

If Java can't see the port, you can right click on you COM port in the control panel, Windows will tell you if it thinks it is working OK.
HTH

[This message has been edited by Michael Hildner (edited April 11, 2001).]
 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help Michael.
Where do I get the CommPortIdentifier class from? Also, when I click on the PORTS icon in the control panel it shows up two com ports and the one in question is there. But I was wondering if that was enough. I don't know what you mean by right clicking because that just gives me the usual 'open' option. Should I be seeing some other icon in the control panel for ports?
Paul
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CommPortIdentifier is in the javax.comm package (in comm.jar) downloadable from http://java.sun.com/products/javacomm/index.html
I'm running Win2000 and that's how my OS behaves. I think there is something similar for other Windows versions. Maybe try to open it? Doesn't Win 95/98 put a question mark or a red X by the device if it's not working properly? Sorry, not really sure...
 
John Zakrzewski
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try running Hyperterminal with a loopback plug? If Hyperterm doesn't work than the hardware is not seen by the OS and thats a must. After that works
you could try sending or receiving from the card reader in Hyperterm if it's a somple protocal. Also with the loopback you could patch in one of those Radshack port monitors to see if your program is causing lights to flash. Start
at a slow baud first so you can verify TX and RX/ Hope this helps.
 
John Zakrzewski
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try running Hyperterminal with a loopback plug? If Hyperterm doesn't work than the hardware is not seen by the OS and thats a must. After that works
you could try sending or receiving from the card reader in Hyperterm if it's a simple protocal. Also with the loopback you could patch in one of those Radshack port monitors to see if your program is causing lights to flash. Start
at a slow baud first so you can verify TX and RX. Hope this helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!