.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



Using Two Serial Port For Communication

Feb 9, 2009

I am using two serial port in my programm.What is want is, i need to receive data from one port and send on another port and vice a versa.This code receive data from one port but can't receive data from another port. I have tried to simulate this code by using hyper terminal and it works properly with both com port. Where as i have written code in Vb6 too and its is giving same problem as giving interupt while recieved data from one port but not giving interupt which receiving from another port. I know the another way to receive data is by using timer and read data by command as readline(), but what to do to make both the port gives interupt which receive data.Please help to find out the porblem, the code is in Vb.net and it is as under.[code]

View 1 Replies View Related

Get Serial Port Communication Working Between Two PC's?

Dec 23, 2011

I am trying to get serial port communication working between two PC's.

My environment is:  XP SP3, 9 pin serial ports on both ends, connected by a null modem cable, Visual Basic 2010 Express.

I have a sending routine and a receiving routine, both based on the on line documentation.

There are no Errors, Warnings or messages.

Problem: The receiving machine shows no sign of receiving a message sent by the sending PC. I have tried making the sending PC into the receiving PC - makes no difference.

My sending routine looks like this:
Sub SendSerialData(ByVal SendData As String)   
'Send string to serial port   
Using com1 As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM1", 9600, Parity.None, 8, StopBits.One)


View 1 Replies View Related

Implement Serial COM Port Communication?

Apr 10, 2009

How do I implement Serial COM Port communication?

View 1 Replies View Related

Serial Port Communication VS2008?

Nov 14, 2011

I am trying to interface an instrument that I send orders to.An order consists of 4 lines which I am to write to the serial port one at a time and receive an ACK before sending the next line.I have interfaced in the past using the MSCOMM, I'm new to the Serial Port class. But even then I've always received data, never sent anything.My question is when I'm looping through my 4 lines of my order, at what point do I receive ACK? Obviously, not in the same function, right? And how do I know I received an ACK and can go on to output the next line?

View 2 Replies View Related

VS 2010 Serial Port Communication?

Dec 31, 2010

I'm trying to read data coming from a serial port. I simply want to ignore all other data besides the string "button_pushed". The device actually writes "button_pushed" to clean up the display when viewing the serial connection from console or similar. I can change this easily but I'd like to keep it if possible.

My code is as follows:


I'll get an IOException from readLine(). I tried using readExisting() which prevented the error but results in the block being executed twice (probably caused by the "") so the log reads "No data match" and "Data match" for one button push.I have a few questions. First, why does ReadLine cause an exception? I tried to negate that with is_closing but it still occurs. Second, will I run into problems using readExisting as it reads the entire buffer?

View 1 Replies View Related

Forms :: Serial Port Communication With PLC Machine

Nov 1, 2010

I am working on an application on serial port communication with PLC machine. Now this communication is only done with one PLC at a time. So I m sending a query to PLC and until its responds back the application goes into wait mode. i.e. no other operations can be done, and an hourglass cursor should be displayed with all other components locked on the form. So how do I achieve this using vb.net?

View 3 Replies View Related

Settings Required For Serial Port Communication

Aug 6, 2009

tell me the settings required for serial port communication

View 1 Replies View Related

VS 2010 - Serial Port Communication Between Two Computers

Feb 22, 2012

I am using two computer to connect to each other via serial port, I have made a program in VB that allows me to read from the serial port then store whatever that character is to a variable. The only problem is I have to hit a button to read in from the serial port and pass the character to the variable. Is there any way to do this automatically?

View 6 Replies View Related

J2ME - Bluetooth Serial Port Communication Between PC And Mobile

Feb 7, 2012

I am trying to create a client server application. I am going to make this simple so that a basic chat application. I have gone through these tutorials:


View 1 Replies View Related

Serial Port - Initial Communication Not Respond To Any Commands

Jul 9, 2007

I have a VB2005 application that sends and recieves data with another application (3rd party, not vb 2005) via COM port. When I run the apps on different computers they work great, they send all data to eachother and everything is fine. When I run them both on the same computer with either virtual null modem ports or with 2 hardware ports connected together via null modem cable they stop communicating.


View 5 Replies View Related

Using MSComm32.ocx Control For The Purpose Of Serial Port Communication?

Jun 16, 2010

In my application I am using MSComm32.ocx control for the purpose of serial port communication.
when i am using it I am getting a following error while writing data to the port.

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

I am writing the output to the port like below. AxMSComm1.Output ="Hello"

I mention the properties of the ocx control in the form load like below. AxMSComm1.CommPort = 1

AxMSComm1.Settings ="9600,N,8,1"
AxMSComm1.InputLen = 0
AxMSComm1.PortOpen =True

I searched for this error in the net.But I am not found any information for this issue.

can anybody explain why I am getting that error and how to resolve it???

View 5 Replies View Related

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.



straight forward right?

2nd computer to read the data

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;

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

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

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


View 9 Replies View Related

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?


Note: the error: not CLS-Compliant

View 8 Replies View Related

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.


View 8 Replies View Related

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

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

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

Serial Communication Using .net?

Aug 3, 2011

I am using serial port class from VB.net to communicate my hardware. Some times I may lost or get incorrect data. I am just wondering how to implement hardware flow control in Vb.net

View 1 Replies View Related

Serial Communication With .net?

Feb 7, 2011

Imports System.Threading
Imports System.IO
Imports System.Text
Imports System.IO.Ports


in my code,im inputting a byte coming from Arduino board microncontroller..im sending character 'N' to com5, and the code above is fetching that data from arduino board..my problem is the output string on the textbox is <78> which is the ASCII equivalent of 'N' how will i convert that to what is really being sent by the board which is 'N'..

View 4 Replies View Related

Communication Via Serial To USB Cable

Jun 24, 2009

I have a device that communicates with the pc via a serial to usb cable. So I have made windows form with a serial communication to speak with it. The communication is every 125ms so every time it checks if the com port is open and sends the new message. The problem is that if the usb is not connected the program tries every 125 ms to connect to the serial port and the busy cursor appears always and the form is not responding to any action (for example enter into the menu or refresh a listbox). I have tried multiple times to connect and disconnect the usb while the program is running. That's mean that the serial connection stopped and started all over again several time. The problem is that occasionally it shows an error "unable to open com port".

View 10 Replies View Related

Communication With Serial And TCP / IP Ports

Feb 19, 2009

What is the best way of communicating with Serial ports and TCP/IP communcation using vb.net?Using visual studio .net can we make it easier?? Can anyone send me sample application of communications?If I write a program communicating with my hardware using Searial port or TCP/IP, will the program be slow?? Are there any programming techniques working with communication ports?

View 1 Replies View Related

How To Do Serial Communication Using .net Language

Jan 12, 2011

im making project of automated polling system using sms how can i read the text message in the cellphone and display it in textbox

View 1 Replies View Related

How To Perform Serial Communication

Aug 11, 2009

I want to perform serial communication on selecting
.Net Framework2.0--->Visual Basic--->Device application

Presently I am using this code
Imports System.IO.Ports
Imports System.IO.Ports.Serialport
If Button1.Text Is "open port" then
Button1.Text="close port"
[Code] .....

But I am getting error as
"An unhandled exception of type System.InvalidOperationException occurred in System.dll
Additional Information: The basestream is only available when the port is open".

View 1 Replies View Related

C# - Serial Communication Using MSCOMM32.OCX In Forms 6i?

May 17, 2012

I want to communicate Weigh bridge with my ORACLE Form serially. I have already import MSCOMM32.OCX in my Project and On Button Pressed I wrote a Program to Start Communication between Weigh Bridge and my form. I was stuck at GET_NUM_PROPERTY of MSCOMM32.OCX Package.

View 1 Replies View Related

Label Error Upon Serial Communication?

Dec 15, 2010

when I connected the program with a serial port and planning to get the data from the serial port to the label, the label was error its says Cross-thread operation not valid: Control 'Label1' accessed from a thread other than the thread it was created on.


is there any limitation for data taken from serial connection??

View 4 Replies View Related

Serial Communication - Converting To Bytes

Dec 1, 2011

I want to take a number such as 600 (0x0258) and send these hex values to a C-based system which is assigning char's to the received bytes and rebuilding to the original number. Currently, I am converting to bytes in VB.Net but it is not giving me the expected outcome (because of the ascii nature of the transfer most likely) [Code] I've also tried using Hex but this doesn't get the data in the correct format.

View 5 Replies View Related

Serial Communication From 6 To 2010 Conversion?

Mar 10, 2012

as i learn VB 2010 express, i want to try some serial communication and i found this code for VB6..but i have no idea how to make it work in VB2010?

Private Sub Form_Load()
MSComm1.RThreshold = 44  'transfer  data into VB program only after receiving 44 characters into buffer
MSComm1.InputLen = 0     'i think only for receive data & not for sending data ...check
MSComm1.CommPort = 1


View 4 Replies View Related

Serial Communication Using Threading In 2008?

Jul 5, 2009

how to do serial communication using threading in vb.net 2008, 

View 1 Replies View Related

VS 2010 - Serial Communication Between PC And Circuit

Jan 10, 2012

I implemented a serial communication between a PC and a circuit based on ATMEL mP, managing the submission of correct / incorrect reception of commands ... The following code works, I wanted a block on the performance and reliability as it is for me very important part of this project that I'm doing.

Public Class frmTrattamento
Dim IsStart As Boolean = False
Dim inputData As String = ""
Dim Stmp As String = ""
Public Event DataReceived As IO.Ports.SerialDataReceivedEventHandler
[Code] .....

View 1 Replies View Related

Download Data From GPS Logger With Serial Communication?

Jun 6, 2011

I have a gps logger which store the gps data into its internal memory .I have a description file for the data format and how to send commands to the logger to get data . this file is present at the following website L [URL]

I need to make a vb.net application that can download data from the gps logger . and to set its configuration parameters .

View 2 Replies View Related

Establish Link In Windows For Serial Communication?

Oct 11, 2011

how to create an application in vb 2010 platform to serial communication port for Mifare module with using command sets defined by the firmware.

View 3 Replies View Related

Serial Communication - Unable To Retrieve Data?

Apr 21, 2010

I am having some issues with serial port communication. My event handler to poll data is not working. I even tried to retrieve it using a button event, but that also does not work. I know there is data in the buffer.Here's my

Private Sub DataReceived( _
ByVal sender As Object, _
ByVal e As System.IO.Ports.SerialDataReceivedEventArgs)[code]...........

View 13 Replies View Related

Storing Running Serial Communication Dialog?

Jan 29, 2010

Using Visaul Basic 208 Express. I have running serial port communications with send and receive texts shown in a richtext box. I would like to store that data in a text file for later review.reate such window text file to store all data sent and received from the serial port in all events. I would like to have that file accessible through a button in the form. Also, the file should store all data in all events, i.e. same file needs to be opened so all data accumulated in all events

View 9 Replies View Related

Change Code For Communication USB Port In Program6 To NET?

Nov 25, 2009

I have 1 project to comunication with usb port in VB.NET.But now,i have code VB6 and then i want to change the code VB6 to VB.NET.[code]....

View 4 Replies View Related

Communications :: Modifying Existing Code For Serial Communication?

Sep 21, 2009

I've seen this great example of serial communication in VB.NET


I try to use it in a project I am working on but somethings are not clear to me.

1: Now the send and received data is shown in one RichTextBox but I would like to split this into two RichTextBoxes (RtbSend and RtbReceived).It is unclear to me how and were data is assigned to the RichTextBox?

2. the received data is shown in the Richtextbox as one long line, I would like to get a new line for every send message.So for example: I I send "test" four times, I would like to see:


now I see: Test Test Test Test I've tried ctrlf but this does not work.The example describes that "comPort_DataReceived" is executed when data is waiting in the buffer. Where can I see the eventhandler responsible for this? How does it know data is waiting?The problem is this kind of coding is a bit to difficult for me. I want to understand the code before I implement it into my project.

View 5 Replies View Related

Write Using Visual Basicprogram 2008 (for Serial Communication)?

Mar 22, 2011

I am working on a porject that interlinks a PC and PIC using the USBtoUART programmer for Serial Communication.

I have just started using and reading the Book on Visual Basic 2008 Professional and read the book by ROD STEPHENS <VB 2008> Programmer's Reference.

However, I would like to know where should I start working from?

I personally want to start from building the Visual Basic interface that enables serial communication between PC and the USBtoUART converter.

View 2 Replies View Related

Communications :: Freeware Program For Serial Communication That Is Better Than Windows Hyperterminal?

Aug 27, 2008

Like the title says, is there a freeware program out there for serial communication that is better than Windows Hyperterminal?

View 1 Replies View Related

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