473,383 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

IO Serial COM Exception

Hi All,

I write a dll use vb.net 2005 to read data from a serial port and use this
dll in a C# 2005 application. It works well except when I close the port.
After I close the port, sometimes the dll stopped at the readline statement
in data_received function. But the port closed already, why this function is
still fired? ( is it because the delay message? I guess ) I catch the
exception and try to throw a excption, but the dll stopped at the throw
exception statement. This problem is not always there, but sometimes, lets
say 1 of 5. The error message in debug mode is "System.IO.IOException was
unhandled".

Your help are always appreciated
Feb 5 '07 #1
3 2012
Hi,

This (probably) is a problem in the device driver handling the serial port.
I say this because I have seen it with USB serial devices, but not with
internal ports that use physical UARTs instead of the virtual UART that is
furnished by a USB adapter.

You can download DesktopSerialIO.dll for VS2005 from my homepage. I have
tested it with several USB devices, and it (so far) does not have this
problem. Let me know if it works for you. The API that it provides is
similar the SerialPort, but not exactly the same, so you will have to do a
small amount of "porting."

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Feb 5 '07 #2
Thank you, Richard

Sorry for the late reply.
I'm trying to use your dll; one question, how the CommPort (an Integer)
relate to Serial Port ( a string, COM1, COM2...)?

Rgds,

Taoge
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:uc*************@TK2MSFTNGP02.phx.gbl...
Hi,

This (probably) is a problem in the device driver handling the serial
port. I say this because I have seen it with USB serial devices, but not
with internal ports that use physical UARTs instead of the virtual UART
that is furnished by a USB adapter.

You can download DesktopSerialIO.dll for VS2005 from my homepage. I have
tested it with several USB devices, and it (so far) does not have this
problem. Let me know if it works for you. The API that it provides is
similar the SerialPort, but not exactly the same, so you will have to do a
small amount of "porting."

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.

Feb 10 '07 #3
Hi Richard,

Is the InputString same as ReadLine?
If set the PortOpen property to false, is the Port closed and released? Or
should I use dispose to release the port?

Thanks
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:uc*************@TK2MSFTNGP02.phx.gbl...
Hi,

This (probably) is a problem in the device driver handling the serial
port. I say this because I have seen it with USB serial devices, but not
with internal ports that use physical UARTs instead of the virtual UART
that is furnished by a USB adapter.

You can download DesktopSerialIO.dll for VS2005 from my homepage. I have
tested it with several USB devices, and it (so far) does not have this
problem. Let me know if it works for you. The API that it provides is
similar the SerialPort, but not exactly the same, so you will have to do a
small amount of "porting."

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.

Feb 10 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mimisam | last post by:
hi, I am using Win XP and writing an application to check POS devices (printer and cash drawer).In the application I need to choose the port which the device is connected to. If the port chosen...
0
by: David | last post by:
I am having trouble with "ACCESS DENIED" error messages in a VB.NET 2003 application when attempting to open serial comms ports. The application has 2 ports that connect via serial cable to 2...
4
by: Lonifasiko | last post by:
Hi, I've been able to communicate using HyperTerminal with my device via serial port COM1. I just send a command and device switches on. I just need that to start playing with it. This way, I...
5
by: LongBow | last post by:
Hello, Is there a way, in .NET, to determine what are the avialable Serial (Communications) Ports on a Windows OS and is there a way to determine that port isn't being use other than attempting...
2
by: joaquimfpinto | last post by:
Dear All, I made an app in c# that uses several serial ports. For the serial ports I use a pnp Sunix board, some with 8 serial ports other with 4 or even 2 serial ports. Whenever I use the...
2
by: Japan Shah | last post by:
Hello, I am trying to connect my Nokia 6610 using usb cable, I have installed usb-serial driver of it. I hv tested it with Hyperterminal and it works fine. but when I wrote a python...
4
by: cmdolcet69 | last post by:
This code below write a serial command to the com port then read the results and disaplays it into the label1.text property when button1_click event is triggered. I think what is going on is that...
0
by: ghjk | last post by:
I want to read sms from GSM modem using C# in serial communication. I wrote the code. But i want to do it automatically. I put my code here and please tell me how can i do it automatically. ...
6
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send...
2
by: Bassem | last post by:
I'm working on simple chat program via serial port. It works fine, but i face this problem. When i try to open the exe, UnauthorizedAccess exception occurs, i can't use COM1 becuase someone else has...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.