Implement Serial COM Port Communication?
Apr 10, 2009How do I implement Serial COM Port communication?
View 1 RepliesHow do I implement Serial COM Port communication?
View 1 Repliesi'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]...
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 RepliesI 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)
[Code].....
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 RepliesI'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:
[Code]...
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?
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 Repliestell me the settings required for serial port communication
View 1 RepliesI 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 RepliesI 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:
[Code]...
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.
[Code]....
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???
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....
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]
Do i have to implement the serial port in the interface again if i have put it in the behind code? Do have any links that can make me understand.
View 8 Repliesi 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]...
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
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]...
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 RepliesI 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 RepliesIf 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 RepliesI 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 RepliesImports System.Threading
Imports System.IO
Imports System.Text
Imports System.IO.Ports
[code]....
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'..
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 RepliesWhat 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 Repliesim 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 RepliesI 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
SerialPort1.Open()
Button1.Text="close port"
Button2.Enabled=True
[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".
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 Replieswhen 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.
[Code]...
is there any limitation for data taken from serial connection??
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