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


ADVERTISEMENT

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

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 :: Communication Through Webbrowser?

Apr 14, 2011

Is it possible to read out the contents of a page that has already be loaded into a webbrowser...say IExplorer...? On 'normal' windows programs there is a way to externally control a program and its contents. But on a page loaded in a webbrowser i can't find a way to get external control of its contents and buttons ect..

View 1 Replies

FileNotFoundException Message On Modifying Existing App?

Aug 16, 2011

I am modifying an existing application in VB .NET. In one routine, I have added a reference to a class in a newly-referenced class library project that is part of my solution, and now I get run-time FileNotFoundException messages when the program attempts to access this routine while debugging. The error tells me that the class can't be found, what's up with that?

To be clear: If I remove the lines of code relating to the new class, I no longer receive the exception messages. If I add them back in, here they come again! I have referenced the class library in the project containing this routine. The class library is building properly (other projects reference same library, and use it more extensively), and the project is referencing the class library's .dll file in my "debug" folder. I get no errors from other routines that use this new class (thus far). I get no errors in the Error List of the IDE.

View 1 Replies

Communications :: TCP Communication - Send Data

Oct 29, 2009

I've been playing around with the TCP client/server sample code I found on [URL] but I can't seem to get it to function correctly. The problem I am having is that if I try to send data from the client a second time I get nothing back, not even an error that it couldn't send data. Every time I run the project it works the first time but that's it. When I was running the code line by line it seems to get to 'networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))' and then it jumps over the rest of the routine.

[Code]....

View 2 Replies

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

Serial Communication With .net?

Feb 7, 2011

Imports 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'..

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

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

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

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

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
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".

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

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

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

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.

[Code]...

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

View 4 Replies

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

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

[code]....

View 4 Replies

Serial Communication Using Threading In 2008?

Jul 5, 2009

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

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

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

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

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

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

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

Settings Required For Serial Port Communication

Aug 6, 2009

tell me the settings required for serial port communication

View 1 Replies

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







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