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


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

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

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

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

Check Serial Port Data Received Event Status?

Oct 2, 2009

I am trying to write something through serial port to my device. Before that, I added the data received handler to read the data when the device response with some data. The problem now is how can i check the status of the data received event? I need to know when the data received event has started or has ended before I can proceed to do some other task like check if the result is successfully receive.

View 2 Replies

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

[Code]...

View 9 Replies

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

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

Check State Of Serial Port?

Jan 8, 2011

I am very new to this but i have with alote of help maked a program that comunicates with a relay board over rs232.

[code]...

View 2 Replies

Check To See If A Serial Port Even Exists?

Feb 9, 2010

I'd like to check to see if a serial port even exists. I know that if it doesn't, there is an error thrown when you do a port.open So, I would imagine that doing a simple IF port.isopen won't work?I looked at all the methods on the class and don't see anything obvious on how to do it.I just want to see if the hardware exists on the PC and set a boolean variable if it does when the form loads.

View 3 Replies

VS 2008 Sending And Receiving Data Via Com Port?

Aug 16, 2010

I have a very basic knowledge of coding, just enough to understand some PicBASIC Pro and program a microchip to send the values of some variables to a PC via the com port. I've used a terminal utility like Hyperterm to confirm the right variables are being sent, so I thought it would be cool to have a custom application on the PC to display these variables, and possible set them via the application by writing the new one back to the PIC. So I downloaded VB express 2008 - and whilst it was "simple" to draw a box and add a few text boxes I'm lost at how to actually do anything practical with it

[Code]...

Could someone advise me in laymens terms exactly what I need to do inorder to populate the text boxes with the data from the PIC micro. Whilst I understand the basics about BASIC, I have no idea on things like classes etc

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

Getting Data From Serial Port

Jan 30, 2011

I am facing problem reading data from Serial port. Actually I am connecting with the hardware device called Crimp Force Analyzer. It gives the data on hyperterminal and I have to read that data from my <acronym title="Visual Basic">vb</acronym>.net program. The data is somewhat like this:

[Code]....

View 8 Replies

VB 2003 - Handling Data - Transmitting Data From A Comm Device Via Serial Port

Nov 10, 2009

I'm currently working on a project where I am transmitting data from a comm device via the serial port and resorting the raw data (in binary) to its respective ascii values. The problem I'm facing is determining the most efficient method to accomplish my goal. Essentially, I have 68 bytes coming in, the first and second bytes represent the page and packet number and the data itself ranges from 3 to 64, the remaining for my checksum.

What I am needing to do is, grab 50 consecutive bytes per variable in my array, and that is where I'm confused. I have easily pulled my 3-64 bytes and stored that data to a string. I just don't know the most efficient method to accomplish my goal. Should I write directly to file all my data, as there are like 8 pages, of 128 packet data. [Code] I can capture the the first 50 by using a for-loop easily, but what would be the preferred method to track what data chunk I've taken? The more I think about it, I think I may just want to write to file, all my data, and then just take them back to back in 50 byte chunks. Is that the most efficient method?

View 3 Replies

Connect To Serial Port And Get The Data From That Using VB

Jan 12, 2012

I want to connect to serial port and get the data from that using vb.net how to do this.........

i have found one sample and i tried that but in that datareceived event is not firing

View 1 Replies

Data Input From The Serial Port?

Jul 15, 2008

how to write code to read data from the serial port. I have a microcontroller connected to the serial port and I need the C++ program to read the input and to perform a certain task according to the information.

View 19 Replies

Data Logging Through Serial Port For Gps

Apr 8, 2010

Data Logging Through Serial Port For Gps

View 1 Replies

Display Serial Port Data?

Nov 6, 2011

I want a text box in my application that will display the data currently coming from the serial port,So if i will send ascii "hello" from another computer on my program it will diaplay "hello".

View 23 Replies







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