Error Occurs When Closing Serial Port?

Jul 5, 2010

I have developed serial port communication application using vb 2008 with serial port class.

Previously everything was ok. Now a days error occurs when closing serial port.

At the time of closing there is no receiving data .

Error is "The i/o operation has been aborted because of either a thread exit or an application request"

View 11 Replies


ADVERTISEMENT

Program Hangs When Closing Serial Port?

Feb 15, 2009

I have a VB.Net 2008 app that I have converted from VB6 which reads data from a weight scale connected to a serial port. I am able to read the received data and display it on the screen, but when I go to Stop the reading and attempt to close the serial port, the app hangs.

Private Delegate Sub ShowWeight(ByVal tWeight As String)
Private Sub comScale_DataReceived(ByVal sender As Object, ByVal e
As System.IO.Ports.SerialDataReceivedEventArgs) Handles

[Code]....

View 10 Replies

Reading Serial Port Read Data From Serial Port?

Aug 16, 2011

i am a absolute beginner and i want to use vb to receive data from micro controller through serial port using rs232 standards, i found this code to receive the data serially, can any one tell me where should i paste this code, so that the data received will be displayed in message box.Private Sub DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) HandlesSerialPort1.DataReceived

[Code]...

View 9 Replies

Serial Port Example Code - Connect To A Modem Thru The Serial Port

Oct 26, 2011

The link below has code to connect to a modem thru the serial port but it is for an earlier version of VB. when I convert the code, it does not fully convert and has 4 errors that prevent building the project. can someone tell me what needs to be changed or added?

[URL]

Note: the error: not CLS-Compliant

View 8 Replies

Error Disconneting From Serial Port?

May 25, 2011

I am currently working on a program that gets data from an external device (microcontroller) and saves the data into a database. I got everything to work except for one simple part. Everytime I disconnect from the serial port, the program stops working and highlights this part of my program:

x = SerialPort.ReadTo("a")

This part just gets the data from the serial port and saves it to variable [COLOR="rgb(72, 209, 204)"]x[/color]This is the complete subclass of my program:

[code]...

It is supposed to read data from the serial port and execute a command that tells VB store the data collected. Whenever I use the function

[COLOR="rgb(72, 209, 204)"]SerialPort.Close()[/color] , the program stops working. What could I be doing wrong? Could the program be stuck in the serialPort.ReadTo() function? Although it does execute the lines in the subclass.

View 7 Replies

Serial Port VB Net Error Sending &HBB

Sep 9, 2009

When i try to send the &HBB value through it just sends a &H3F value i think is an error character i use this code:

SerialPort1.Write(System.Convert.ToChar(&HBB))

I am able to send other ascii character using this but i really need to send this &HBB value through serial port.

View 2 Replies

VB 2005 - Serial Port Communication - Error: AxMSComm1.Output

Jun 16, 2010

I am using MSCOMM (mscomm32.ocx) for serial Comm. using VB.NET 2005:

Receiving Error: "AxMSComm1.Output {"Exception from HRESULT: 0x800A018A (CTL_E_GETNOTSUPPORTED)"} Object "

How to resolve this Issue, Below is the code snippet which i am using. [Code]

View 1 Replies

Error In Serial Port Data Capture Program In Visual Studios 2010?

Apr 11, 2012

I'm trying to make a rs232 serial data logging program, that accepts a 12 bit hex RFID tagID from an RFID module. My end objective is to save this RFID tagID into a database and assigned to a person for a personnel management system.I had to use button3 to add the value of the variable 'msg' into textbox1 because I was getting the following error "Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on". It is a temporary workaround.When I do press button3, I get the incomplete hex number, instead of "4C00A2C82A0C", I get "A2C82A0C", and sometimes I get random digits like 1,A,C etc etc.

Public Sub OpenPort()
Try
If SerialPort1.IsOpen Then
SerialPort1.Close()

[code]....

View 4 Replies

Unable To Close Serial Port After USB / Serial Converter Disconnected

Mar 28, 2006

I have a stand alone VB.Net 2005 application that uses a serial port that generally stays open while the application runs on a Windows XP system. In trying to bullet-proof the UI, I ran into a problem when the USB to Serial Converter normally used to provide the serial port is disconnected while the serial port is open. In trying to handle the resulting error when accessing the port, I find I cannot close the port.

When trying to do so, the error message says something like "unable to close the port. You may not have sufficient permissions." Reconnecting the USB/Serial Converter does not reactivate the port.

[Code]...

View 8 Replies

Read The Data From Barcode Weight Scales By Serial Port And TcpIp Port?

Nov 27, 2010

I'm mohammed from Oman ,I'm visual studio.net programmer How I can Read the Data From Barcode Weight scales By Serial port and TcpIp port

View 7 Replies

Get FullName From Available Serial Port (Com Port) From Device Manager In Windows Form With .net?

Jul 25, 2011

I have a Windows form.in windows form have a combo box that give me a list of available port serial with it code (Dim ports As String() =SerialPort.GetPortNames())for example( Com1,Com8,Com15,...).but I want to give me fullname of serial port in device manager for example in dvice manager is these (Comunication Port(COM1) - Printer Port(LPT1) And USB Serial Port(COM8)).how to Get it?

View 2 Replies

The Given Port Name Does Not Start With COM/com Or Does Not Resolve To A Valid Serial Port?

Aug 2, 2011

If I uninstall the COM1 and reboot, it works. If I shut down (power off) and restart, I get the message below. If I uninstall then click on Scan for Hardware Changes,The given port name does not start with COM/com or does not resolve to a valid serial port. Parameter name:portName

View 8 Replies

Communications :: Serial Port - Run Program, "Access To The Port 'COM1' Is Denied"?

Oct 15, 2008

Im having problem with the Serial Port. When i run my program, "Access to the port 'COM1' is denied". What does that mean? Im not sure whats happening because theres no error in my code. Someone suggest me to use 'COM2'. Which is also the same result. I have a microcontroller, programmed and run it. And i need to capture the data onto my vb, which is on a multiline textbox. How to i do that?Just to double check my code?

[code]...

View 1 Replies

VS 2010 Read A String From The Serial - The Condition "If .. Then" Never Occurs?

Nov 22, 2011

I read a string from the serial and I have to check if it matches another string .the condition "If .. Then" never occurs, I think because of the characters carriage return and various codes are present but not visible ... how can I fix this?

[code]...

View 4 Replies

Closing Application Via X Button Without Closing Forms Inside Mdiparent Causes Exception Error

May 3, 2010

Form1 is a mdi container. It has a bunch of forms that can load inside of it as mdi children. If I close each open form inside the form1, and then click the red X at the top right, application exits fine.If I click the red X without closing the forms inside I get: An unhandled exception of type 'System.CannotUnloadAppDomainException' occurred in mscorlib.dll

Additional information: Error while unloading appdomain. (Exception from HRESULT: 0x80131015) However I can break from it. How do I get the application to not show that error? What must I do to fix those inside forms or close when the red x is clicked?

View 1 Replies

Communications :: Long Delay While Closing Port?

Nov 7, 2008

I have noticed that I am getting a long delay while waiting for the serial ports to close.

Heres my code.
Code:
Using comI As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort(strPort(0))

[code].....

View 1 Replies

Error Occurs When Using More Colums

Jun 22, 2010

My code was working fine when I tried with 3 columns. Now, when I mode columns (13) it throws the error.

View 4 Replies

Serial Port Use In A DLL?

Jun 3, 2012

I am trying to buld a DLL in VB.NET 2010 that will be use to control a vending machine.Whin a call into the DLL to a function to open and setup the comport the first time its opens it just fine, but if a call into the DLL again it does not know that the port is open even if it is still open. I can check with another program and is shows the port is open and if I try to call into the DLL again to open the port I get an error that the port is already open. Any idea how to set this up so it will work

View 7 Replies

Calling A DLL From .NET - Error Occurs On Windows 7?

Feb 8, 2012

I have a VB6 DLL that wraps a call to a 3rd party component. When I call my DLL from VB6, everything works fine, but when I call it from vb.net (2.0 framework targeted - VS2010) I get this error:

AccessViolationException occurred

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.This error only occurs on Windows 7 (Windows XP clients work fine).I've looked this up and all the articles I found talked about the declaration not being correct.I am not declaring any APIs calls though, the 3rd party component is early bound in my VB6 DLL.I can run the DLL, set a breakpoint,and it goes into my VB6 function, but errors calling a function in the 3rd party component.My VB6 DLL takes 3 string and one 32bit numeric (long in VB6) parameters. The 3rd party's DLL function that I am calling is taking a string (bstrDNSID as string is what Intellisense shows in VB6). This is where it errors.

Update: None of the marshalling has helped, so I tried creating a test sub in my VB6 DLL. I hardcoded all the values within the DLL's test sub. It works fine when called from VB6, but gives the same error as above when running from .NET. Also of interest, when I have the VB6 DLL running from the VB6 IDE, I do not get the error when calling the DLL from .NET.

View 2 Replies

Detect When A Popup Error Occurs?

Mar 30, 2010

I have an error appearing in my webbrowser, and as there doesn't seem to be a solution to stopping it, i'm attempting to just detect when it occurs, and use sendkeys to press enter.[code]..

View 8 Replies

Throw A Message Box If An Error Occurs

May 4, 2009

I wanted a Message Box to appear when a file can't be found, for example. I made a Combo Box (ComboBox1) and a button, this is what the code was:[code]If a file can't be found, I want a message box to appear, not an Error Provider, I tried this code, but it did not work:[code]

View 2 Replies

.net - Serial Port Communication?

Dec 30, 2009

i'm creating a windows form to send/receive data to/from serial port.At first : i send the data as string to the serial port .Second: i tried to read the string again for test the successfull transmission , but i recieved empty string

[Code]...

View 4 Replies

Accessing The Serial Port?

Oct 21, 2011

I can find documentation (preferably with code samples) that will guide me through all the steps to activate and read from a serial port?

View 6 Replies

BreakState Serial Port In CE6.0?

Oct 31, 2010

For my application a need to set a breakstate on/off of 25ms.In Xp this runs fine when I set breakstate=true and wait for 25ms and then breakstate= false and wait 25ms.In CE6.0 when I set breakstate = true, it only throws a puls.It is even not possible to keep breakstate on.

how to solve this or is there an alternative to simulate a breakstate?

View 3 Replies

Communicate To Serial Port?

Jan 15, 2011

can we communicate to Serial port COM1 through Microsoft Robotic Studio?We are developing wireless robot which will take data from serial por

View 14 Replies

Communications :: Like A Serial Port

Mar 8, 2010

For many years, I have sent data between 2 computers using serial ports."Here is the data", "Thank you for that data!" type stuff.Where do I get more information for doing the same thing with 2 computers that are networked together? Assume a local ethernet connection.I have experimented with serial-ethernet modems and that works well but I don't want any more hardware.Is there a good thread here I should read?I want 2 VB programs running and I want to exchange data periodically.

View 2 Replies

Controlling The Serial Port?

Apr 23, 2006

I know things have changed in VB2005.net and i have Express and i want to controll the serial port. I have a program from VB6 that i understand and i tried to convert it but i get alot of errors and i have know idead what they mean. As you can tell i haven't been programming very long.

If someone can point me in the right direction for programming the serial port in VB2005 .net i would appreciate it or tell me what differences there may be.

View 12 Replies

Detecting A Serial COM Port?

Nov 9, 2009

I am developing a UI for an embedded device that I have designed and built. The device uses an FT232 chip which, when connected via USB is automatically assigned one of the COM ports. I was wondering if there is a way to set up a loop which would automatically detect which COM port the device has been assigned. I could then add some handshaking to verify that the port is correct.

View 4 Replies

Get The Serial Port Available In The System?

Feb 16, 2009

I have a little code for get the serial port available in the system.

For Each pn As String In IO.Ports.SerialPort.GetPortNames
Debug.WriteLine("NAME : " + pn.ToString)
Next

[Code]....

So, The PORT1 and PORT5 its ok (because this are real serial port, with a real RS232 interface), but PORT4, I don't know.

How I can do for get only true serial ports ?

View 3 Replies

Getting Data From Serial Port

Jan 30, 2011

I am facing problem reading data from Serial port. Actually I am connecting with the hardware device called Crimp Force Analyzer. It gives the data on hyperterminal and I have to read that data from my <acronym title="Visual Basic">vb</acronym>.net program. The data is somewhat like this:

[Code]....

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved