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


ADVERTISEMENT

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

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

Communications :: Modifying Existing Code For Serial Communication?

Sep 21, 2009

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

[URL]

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:

Test
Test
Test
Test

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

Get Data From This Radio Set Through A Modem And A Serial Port?

Mar 6, 2009

I have spend about a week trying to get data from this radio set through a modem and a serial port. The data is transmitted by the transmitter in 5-databits at baud rate of 50. An existing vb 6.0 program in windows 98 receives the data correctly with port settings of Speed = 50, Databit = 5, Parity = none and Stop bit = one. The data is received at every 9 sec, presumably with the help of a timer. I have to write a program in .net frame work 2.0 to get the same data. My problems are:

1. The program hangs when I execute SerialPort1. ReadLine().Trim or SerialPort1.ReadExisting

2. When I collect SerialPort buffer after every 9Sec, and try to get the strings out of each byte using following code, I get only repeated squares instead of characters.

[Code]....

View 5 Replies

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

.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

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

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)

[Code].....

View 1 Replies

Implement Serial COM Port Communication?

Apr 10, 2009

How do I implement Serial COM Port communication?

View 1 Replies

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

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:

[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?

View 1 Replies

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

Settings Required For Serial Port Communication

Aug 6, 2009

tell me the settings required for serial port communication

View 1 Replies

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

Receive Data From Serial Port Link To Itegno Modem W3800

Sep 17, 2009

I am wondering is there any code to get the text reply from the modem? I am using the itegno W3800 modem. I have used the below method so far but apparently VB.NET windows form doesnt see the incoming data. The message box comes out empty. But when i try the same method with the TMAS Siemens GSM modem, VB.NET can see the incoming data and display out the data string.

here is the code that i have written:

serialPort.Write("AT" & vbCrLf) 'set command message format to text mode(1)
receiveddata = serialPort.ReadExisting()
it works for the TMAS gsm modem.

The baud rate for the TMAS GSM modem is 9600 and the baud rate for the itegno modem is 115200.

For the itegno modem, the data is sort of like stuck at the serial port as after every time i pressed on the button for example "AT"

this "AT" command gets "stuck" at the serialport and run only when i have connected through the serial port in hyper terminal.

I am thinking is it the baud rate for 115200 is too fast for VB to handle? And also is there any way to solve this problem?

i have to revert back to the itegno modem for use for my project at the end of the day.

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

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:

[Code]...

View 1 Replies

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.

[Code]....

View 5 Replies

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

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

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

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







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