Communications :: Close Serial Port After USB Device Unplugged?

Oct 1, 2009

There seems to be a lot of discussion around about handling exeptions when a USB serial port device gets unplugged. What I want to know is how can one re-attach to it once it is plugged back in. The problem is that if you unplug a USB serial port device the app doesn't know it has gone and remains convinced it is still open. I have to close the app completely before I can re-attach to the device. I need a way to force it to close/go away.

View 2 Replies


ADVERTISEMENT

Make Program Feel If Any Device / Usb Device Plugged Into Computer Or Unplugged

May 5, 2010

how can i make my program feel if any device or usb device plugged into the computer or unplugged.url...

View 3 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

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

Open A Communications Port And Read Data From A Wired Usb Device?

May 16, 2011

I know how to open a communications port and read data from a wired usb device.

How can I open a communications port to read data from a wireless bluetooth device?

View 5 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

Communications :: Listening To The Serial Port?

Sep 21, 2011

I am trying to listen to the COM3 port and display the output in the TextBox. If I understood correctly I will have to implement this by using eventhandlers, delegates. I tried following these articles:

[URL]

And this is the code I came up with... Unfortunately it doesn't display anything. App just starts display "True" and no data is being displayed. I am monitoring Arduino platform which I know is sending data constantly.

Code:
Imports System.IO.Ports
Imports System.Text
Public Class ArduinoSerial

[code].....

I am really new into the vb.net. I am sure there are some horrible mistakes with this code but I am kind of stuck for the past 2 days on this one.

View 5 Replies

Communications :: Reading From Serial Port?

Dec 16, 2008

i am using serial communication to read from a plc.The plc will send a string :&H3A as a header byte then C(which is a variable that contains data)I want to read and mask out the header byte.I use the following code but cannot read anything.

Private Sub btnread_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnread.Click
Msg = SerialPort1.ReadExisting
count = Val(Mid(Msg, 1, 2))
Lblno.Text = count

[Code]...

View 1 Replies

Communicating To A Device Using A USB To Serial Port (VCP)?

Feb 19, 2010

I am communicating to a device using a USB to serial port (VCP). I am having a problem with the usb failing. When the usb fails my app will lock up and the com port is lost. I have seen a post about this but cannot find it.

View 3 Replies

Read XML From A Device Through A Serial Port?

May 13, 2011

My current program can read in a continuous stream of data when initialized and I can send a command to retrieve the devices stored data, I also have within the same program code that will read an XML file and populate from controls.

I have two separate idea's right now that I'm trying to merge into one

I want to read in XML and populate my controls. I'm aware of delegate and Invoke but I'm having a hard time working them into my XML portion or the opposite "working my XML into my serial port class".

View 14 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

Communications :: Disable Encoding For Serial Port?

Apr 1, 2009

I am trying to transmit the integer value 360 to serial port. but at micro controller i am getting the 3 bytes (33 36 30) its ASCII Values.So is there any way to transmit the 360's hex value 168 using two bytes only like 01 68 only?

View 2 Replies

Communications :: Receive Hex Data On Serial Port?

Jan 5, 2009

I am trying to recieve HEX data from a seriall device. Code is as below . but the required output is not correct. Some chracter code are not correct even in decimal. like for 80 i recieved 3F and for c0 also. for example i recived a string .

10 02 3F 00 10 03 3F 61

but in actual data should be

10 02 80 00 10 03 c0 61

Public Sub DataSeriallReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort.DataReceived
Dim buff As String

[Code].....

View 2 Replies

Communications :: Receive Text From Serial Port

Apr 23, 2008

I'm trying to receive data from the serial port and display onto a text box in my gui in vb. I'm using xp pro sp2 and vb 2008 exp.What i've done so far:

- I'm able to send data successfully (tested) to the serial port
- I can dispaly what data is being sent (tested)

Steps taken:

- I have looked around on this forum for something similar to what I have but no similar posts are here
- Will look into MSDN help shortly
- Will also try some vb books I have lying around. But the problem is most of the vb books deal with sql server and database stuff and not really interfacing to hardware.

View 1 Replies

Communications :: Serial Port Responding Slow

Sep 22, 2008

i have an application where i send data(a question in a "packet" of 8 digits) to an external controller via serial port, and then that controller sends me back some information(the answer, in a "packet" of 8 digits, not necesarily zeros and ones)I have develope a simply software that is getting the correct data form the controller, here it goes:[code]So now i can see how many times the code needs to enter the loop to get the "answer" from the module.Now i know that the code needs to do the loop from 5000 to 18000 times to get the answer each time!!!!, so that is why the software keeps getting freeze.I supose that that time is neccesary for the module to give the answer, so i think i can't get better respond times, but i would like the software not to get halt.

View 3 Replies

Communications :: Setup A Virtual Serial Port

Jul 4, 2008

I'm writing an app with takes 3 readings off LCD displays via serial ports. The module which scans the serial ports is getting stuck in a loop for around 1.5 seconds. I need it to be much quicker than that. Is there a way I can setup a virtual serial port so I can run test it on my PC. Its very tedious and time consuming of making changes and visiting the machine its for.

View 1 Replies

Communications :: Transfer Image Through Serial Port?

Feb 9, 2011

I have a barcode scanner that beside scanning the barcode it also snaps an image. I wrote a simple application that searching all ports locating in which one the scanner is connected and opening the port.

I can easily read any barcode and the send command to the scanner to pass me the image taken on the port, but i have a problem re-constructing the image from the bytes i read.

Code:
sendCommand()
Dim img(SP.BytesToRead) As Byte
SP.Read(img, 0, img.Length)

[Code]....

I can get the image from the scanner in any format needed (jpg,bmp etc) so no need to provide a precise solution just a general idea.

View 15 Replies

PC Communications To Intelligent Instrument With 485 Serial Port

May 7, 2011

Now I'm doing a VB project about pc communications to a intelligent instrument with 485 serial port. I want to use API but I'm not good at it.

View 2 Replies

Serial Port Communications: Turning Of ECHO?

Feb 16, 2011

During Serial communications, is the echoing back usually done by the serial port interface or is it done by the UART at the far end?

View 10 Replies

App To View Which COM Port A USB-Serial Device Is Connected To?

Jul 14, 2011

I am currently having an issue finding information on how to develop a simple application that a user can run to find out which COM port ie. COM1, COM2, ect is assined to the Belkin USB to Serial Adapters we use in the company.

To anyones knowledge is this possible and how would I implement it in a Windows Form Application.

View 15 Replies

Connect To External Device Using A Serial Port

May 25, 2010

I'm trying to connect to an external device using a serial port. I found a couple of tutorials with demo code and tried these. Unfortunately they all return the same gibberish unreadible result.[code]I'm sure my port settings are correct (I have the communication protocol of the device.)

View 20 Replies

How To Show All Available Serial Port In Device Manager

Jul 24, 2011

I have a windows form in vb.net. in my form have a combobox. I want in combo box show only all com ports that exist and available in device manager. How to do it?

View 5 Replies

Communications :: Arduino Board: Communicate With It Using Serial Port

Jan 27, 2011

I have a problem with something.I have a Arduino board I wan't to communicate with by serialport.
In "Form1", I'll retrieve values from the Arduino board, and I want it to calculate and display data in TextBoxes.How can I do this?[code...]

View 8 Replies

Communications :: Send 8-10 Character Strings From The PC Serial Port?

Dec 1, 2011

I have quite a bit of VB6 experience but now am trying to create my first VB.Net project. The project is very simple - it just needs to send 8-10 character strings from the PC serial port. The problem I'm seeing is that VB.Net is always sending out a 0x0A character after each 'WriteLine' call. Using VB6 it was necessary to manually send out any End Of Line characters. My application requires that no extra EOL characters be sent after the string.

View 2 Replies

Communications :: Serial Port Input For Barcode Scanner?

Nov 11, 2008

i need to create an application where input are to be received by the barcode scanner.However, i am not suppose to use the textbox to do so. However i need to use the serial port to do so. Any one know how am i able to do that?

View 1 Replies

Communications :: Serial Port Communication Via Null Modem Cable?

Sep 4, 2009

I have a VB.net app running on one computer, displaying text into 2 texboxes or labels.I need to see the two values in two sperate textboxes or labels from the two labels on another computer via a null modem serial adapter.

1st computer.

Code:

serialport1.writeline(label1.txt)

straight forward right?

2nd computer to read the data

Code:
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
dim s as new string = serialport1.readline()
label1.text = s

This is what I was thinking;

Code:
serialport.writeline(label1.text & label2.text

This would send the two values over the serial port. How would I seperate the two values and display them in two different texboxes?cannot use them together)Am I on the right path at all? Or using the serialport.writeline method won't work at all....

View 4 Replies

Communications :: Serial Port Read Wrong Return Result?

Dec 17, 2008

Anyone else have an issue using read, It appears when I use read it gives me the correct buys but returns the wrong integer value So I use it and it fills the Array i make with &h10, &h6 but read reutnrs number of bytes returned to 1. if there a better way to go with Vb.net with RS232 I mean really my projet dosent have anything out of the Normal

Friend WithEvents CashValidator As System.IO.Ports.SerialPort = New System.IO.Ports.SerialPort("COM1", 9600, IO.Ports.Parity.Even, 8, IO.Ports.StopBits.One)
CashValidator.Read(MyResponce, MyResponceLen, 4)

View 2 Replies

Communications :: Unable To 'activate' Serial Port Like Putty Or Hyperterm

Aug 18, 2009

I'm trying to write a bit of code to communicate with an RS232 coin mech.The problem i have is that the coin mech works fine when used with Putty or Hyperterm but i do not appear to be able to 'activate' the serial port with my code.[code...]

When i open the hypertem or putty session the coinmech's active light immediatly comes on and i am able to send and recieve data. When the port is opened with the code nothing happens.

View 1 Replies

Serial Port Communications - AT Commands - Send And Receive Data

Apr 12, 2009

I have a USB modem that can detect caller ID and can detect dialled digits when special AT commands activated, How to send and receive data. The sent data will be the AT command such as AT+VCID-1 to activate the caller ID, the received data will be caller ID information and the digits dialed. I'm new to prgramming and using Visual Basic 2008 Express.

View 8 Replies

Cant Close Form With Serial Port Open?

Jul 8, 2008

I have a programme that accepts data from a serial port. If I close the port and then the form no problem. However if I try to close the form with out closing the port it appears to hang. I have tried closing the port in the forms close event but this did not solve the problem.The data recieved event is as below and UseData is the private sub which actually handles the data. Usedata contains the code line Dim InputText As String = SerialPort1.ReadLine
Private Sub SerialPort1_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

Me.Invoke(New myDelegate(AddressOf UseData), New Object() {})

End SubI am aware that this event runs on another thread and I have seen but cannot now find information about closing multiple active threads.or do I have to "uninvoke" the delegate

View 1 Replies







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