Receiving Wrong Serial Data?

Dec 13, 2009

I have a program that receives serial data from a microcontroller and displays it.If I use windows terminal I get the right data.For some reason my program is not displaying the right data.What is sent is temperature.So the actual data is 24 degreesC and my program is showing 10 degreesC.

Private
Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

[code]....

View 8 Replies


ADVERTISEMENT

Receiving Data From Serial Port?

Nov 30, 2008

i was not getting o/p properly when i tried to receive data from serial port using the following code.

Public Class form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If SerialPort1.IsOpen Then

[code]....

View 4 Replies

Sending / Receiving Data To Serial Port

Aug 13, 2009

I'm trying to control a serial port device that both send and receives data. I can receive data quite happily from the serial port but I don't appear to be able to send data to the device. The device works perfectly as I can test it using putty, I open putty select serial and select 1200 baud, the device immediately lights up and can send and receive. However when the port is set up and opened in VB the device doesn't light up so I can't send data to it but can receive data from it. According to the instructions I need to send either ASCII 'X' Hex '$58' or Decimal '88' to make the device ready.

Code (VB Studio 2005) :-
Public Sub New(ByVal synchronisingObject As ISynchronizeInvoke)
ComPortUsed = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINESoftwareNJB", "COMUSED", Nothing)
PricePerTrack = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINESoftwareNJB", "PRICETRACK", Nothing)
Me.synchronisingObject = synchronisingObject
[Code] .....

View 11 Replies

Sending/receiving Serial Port Data?

Feb 22, 2011

Opening and closing the port works fine, and as far as i can tell, the serial.write("blahblah") should be writing to the output buffer, but I am unable to test or verify this by reading it in. the commented "Receive data from serial port" and subsequent DoUpdate() function are where i am having trouble. It doesnt seem to actually be reading in the data if it is in fact writing it correctly.

[Code]...

View 9 Replies

Check When Serial Port Has Stopped Receiving Data?

Dec 20, 2009

What I am doing is creating an app to send and receive CNC programs to machine tools via the RS232 interface. At the moment I am testing the software with 2 laptops linked together through a cable I have made up. which all works. I have added a serial port to my form 1 and using the code below I can send and receive data. However with the send button I can open the comm port send the data and then close the comm port (No Problems there). With the receive button I want to open the comm port receive the data and close the comm port. The problem I have is checking when the app has finished receiving data so I can then close the comm port

Private Sub Btn_Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Send.Click
Try

[Code]....

View 2 Replies

Forms :: Serial Port, Continuously Receiving Data?

May 11, 2011

I have serial port object which continuously receiving data from weighing device, which sends data in 0001450= format (8 Bytes). I read about datareceived event, and implement that, but i must use Thred.Sleep to get all data and read with serial.ReadExisting. Does the ReadBytesTreshold=8 raised DataReceived event after 8 bytes of data??

Is there any way to cancel, abort, stop DataReceived event?

View 4 Replies

VS 2010 Receiving Data From Serial Port Monitor 4.0

May 30, 2012

i'm using serial port monitor 4.0. i need to know how to received the data and show in a textbox.

here is how my data look like in the serial port monitor:

40 03 04 05 00 00 00 80 05 04 01 00 00 00 11 00 @......�........
80 07 04 05 00 10 00 01 02 02 14 80 07 04 05 00 �..........�....
10 00 01 02 02 14 80 07 04 05 00 10 00 01 02 02 ......�.........

[Code].....

View 9 Replies

Changing Form Controls After Receiving Serial Port Data?

Feb 13, 2009

first post here at the forums. I am a complete noob when it comes to VB .Net, but I have done a lot of VBA programming and some VB6 back in the day. I have posted this question on two other forums (including the MSDN forums) and no one has responded so please let me know if I need to clarify the question.

I am (trying) to write my first .net app which reads/writes data to a device connected over the serial port. I have manged to get it to work to send commands to the device and receive the reply back, mainly using the info from this article: Beth Massi - Sharing the goodness that is VB : Reading from a Serial Port and Saving to a Database

However, I am having problems with updating the controls on the main form based on the received data from the serial port. Basically I want the user to click a button (one of six on the form) which will send data to the device, then based on the response from the device, the BackColor of that particular button, will be changed accordingly. I just am missing something b/c the button click is a different sub than the sub that handles the form controls update and I can't get the two to talk

[Code]...

View 5 Replies

Continuously Receiving Data From Serial Port And Display In Textbox

Apr 28, 2012

I ve been reading forums all over the net for 2 weeks and I failed to find solution for my problem. here is my problem;

I am able to receive data from serial port in to richtextbox and its working fine .. what i wanna do is dislay data in textbox by spliting string[code]...

View 5 Replies

Receiving Invalid Data From Serial Port Using SerialPort.ReadExisting

Jan 16, 2010

Recently we have connected one bluetooth device which receive data from our serial device. The bluetooth device further transmite this data to a Windows Mobile which is bluetooth enable. Baud rate of whole system is 19200 with 7 data bit and 1 stop bit.When we send command to serial device through bluetooth device it is accepting the command and respond accordingly. but some of data byte of string is desplay as question mark (?).But in case we connect the serial device directly to PC, the string received is correct.[code]Response given by Serial Port is "?09?D03?A D?

View 1 Replies

Receiving Invalid Data From Serial Port Using SerialPort.ReadExisting()

Jan 16, 2010

Recently we have connected one bluetooth device which receive data from our serial device. The bluetooth device further transmite this data to a Windows Mobile which is bluetooth enable. Baud rate of whole system is 19200 with 7 data bit and 1 stop bit.When we send command to serial device through bluetooth device it is accepting the command and respond accordingly. but some of data byte of string is desplay as question mark (?).[code]...

View 4 Replies

Write An Application For Receiving Data (ascii Characters) From Microcontroller Through The Serial Port In Three Separate Parts

Jul 18, 2009

I need to write an application for receiving data (ascii characters) from microcontroller through the serial port in three separate parts. I've created three RichTextBoxes, but I do not know which commands I need to type. In first textbox I need to receive one byte... next six bytes need to be placed in second text box, and finally last seven bytes need to be placed in third textbox.

View 11 Replies

VS 2008 Application To Reject Serial And Count How Many Times Entered In A Wrong Serial

May 16, 2009

I made my program and now I just need to add in the serial and trial part of the application. I know the application must connect to the host and go to a txtfile. How would i do the trial and serial. Also If the serial is already activated I want the application to reject that Serial and Count how many times they entered in a wrong serial.

View 2 Replies

Receiving Sms Using Serial Port?

Aug 5, 2009

I don't really quite understand how the receiving works but could anyone please help me on how does the receive sms works when using serial port and AT-commands? Here is how I use my code:

Imports System.Windows.Forms.Form
Imports System.Text.Encoding
Imports System.Threading
Imports System.IO.Ports

[Code]...

View 21 Replies

Receiving The Sms From The Serial Port?

Jun 28, 2010

I am doing a project on receiving the serial port. but the problem is that I am a lost now because I am in the dead end because my project is near the dateline. I am at blank now. Can anyone help me to teach me step by step on how to do the part on receiving sms using the modem?

View 10 Replies

Serial Port Not Receiving?

Sep 19, 2011

If I touch the Power & Send wires together on a serial cable the program needs to count up by one. It is just acting as a counter is all.I have some code, but I cannot get it to count....It doesn't even appear to be getting to the SerialPort1_DataRecieved event....ok at this and see what I'm missing? I'm using VB 2010 Express. The serial port properties are all left at default.

Code
Public Class frmMain
Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As

[code].....

View 1 Replies

Serial Port In Receiving File

Sep 10, 2011

I am using VB studio 2010 now. What I want to do is to receive data from another port and save it in my directory. However the port can receive my buffer from another port but could not save the file. [Code]

View 14 Replies

Datagridview - Remove Wrong Columns And Display The Wrong Data

Jan 12, 2010

I've got a DataGridview I want to remove columns from as it greatly increases performance when I format the DGV. The first time I remove columns in a loop (using the removeat) property, everythings fine. But when I try to remove more columns in another loop, it appears to remove the wrong columns and displays the wrong data. In other words, it displays the wrong data and headers; and the columns it does show has headers and cells that don't match.

[Code]...

View 2 Replies

Receiving Command Codes Via Serial Port?

Jul 14, 2010

I am currently writing a console code that I will eventually create with a GUI. The problem I am currently having is that when a message I received to the port is an ASCII command code i.e. <BEL> <CR> then rather than printing these messages
it performs the command and I am unable to respond as per when the command is received. Is there a way to alter the code so I can see these messages or at least determine its been sent so I can respond to it?

View 5 Replies

Receive Wrong Caracters From Serial Port?

Dec 15, 2011

I need to communicate with a PLC in serial port. PLC sends 4 possible data: 0, 1, 2 or 3 (which are status).My vb.net program uses IO.Ports.SerialPort class. When I read the data, the "1" and "2" are good, but the "0" and "3" are received as "?". I tried all the Read method (ReadByte, ReadExisting, Read, etc), it always give the same result. In HyperTerminal, it's fine.I made a test program in another computer (Win 7). Test was perfect, I received all 4 status correctly. I ran the same test program on the original computer (Win XP) and once again, I got the "1" et the "2" but the "0" and the "3" was "?" (ascii 63).

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

Pass Serial Data From Serial Data Received Event

Dec 13, 2009

I'm trying to pass a data packet from the serial data received event.The code can capture the data without any issues.I'm spinning my wheels on getting the data packet out of the thread for further processing.[code]

View 4 Replies

GPIB Communication - Sending Data - Receiving Data - Saving Data

Sep 19, 2010

I need to control a device with a GPIB port. I have the commands that I need to use to do this; but I don't know which is the sintaxis in Visual Basic.

For example if I need to send a instruction like "START:0.01" to the external device which are the libraries that I have to include?, how should I write the programming line to do this?

The main tasks that I need to program are sending data, receiving data, and saving data

View 5 Replies

.net - Tcp Client Not Receiving The Entire Data Response Data From Server?

Apr 19, 2011

I have a small program which is a tcp client. I send a string from this client to a device over ethernet (it acts as the tcp server). As soon as the device recieves the input string it will respond back with response data. My problem is i am not getting the entire response data back from the server. (device).

Dim serverStream As NetworkStream = clientSocket2.GetStream()
Dim outStream As Byte() = System.Text.Encoding.ASCII.GetBytes("my-cmd")
serverStream.Write(outStream, 0, outStream.Length)

[code]....

View 4 Replies

Receiving Data From USB?

Mar 23, 2007

Actually my project is based on rfid. The transmitter sends data to the remote reciever that is attached to the pc through USB. Now i have to design a VB.net interface for the recieved data.I dont know how to program and get data from USB and utilize it. I only have to receive the data and not to send.

View 14 Replies

TCP Receiving / Sending Data

Nov 11, 2009

Im woundering how does Receiving/Sending data work in a TCPClient/Server that is connected in the same networkstream.

View 4 Replies

Data Receiving With Socket?

Sep 27, 2011

i am working on 3rd party chat software, when ever i send data to server i get incorrect buffersize of data. like when i convert that data to hex to matching header for splitting data i got huge lengths data

in the above textbox of image i have got some 0000000000000000000.... with the hex data, how can i get only only original data. The code i have used to receive data is

[Code]...

View 1 Replies

Sending And Receiving Data To Or From PIC Through RS-232?

Nov 14, 2011

Currently I had write a simple VB code, my aim is when i click "Forward" button then the vb will send a character "A" to PIC, "Reverse" button will send "B" so I write my vb code for sending as below:

Dim Forward As Char = "A"

SerialPort1.Open()

SerialPort1.Write(Forward)

For the receiving part, after I received the data from PIC then I will show it at the label which act it as a screen. the receiving code as below:

SerialPort1.Open()
receive = SerialPort1.ReadChar()
If receive = "A" Then[code]....

View 14 Replies

Sending And Receiving Data Via USB?

Dec 4, 2011

I am working on system support for an electronics project wherein I have to receive an 8 bit (binary) data through a USB port and store either the binary or the corresponding decimal into a variable. How can I implement this in visual basic 2010?

View 11 Replies

TCP Client Receiving Data?

Dec 6, 2009

I have made this code:

Dim tcpClient As New System.Net.Sockets.TcpClient()
tcpClient.Connect("usuarios.lycos.es", 80)

[Code]...

View 4 Replies







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