Send And Receive Data From A Serial Port?

Jul 8, 2011

I have created a program to send and receive data from a serial port, some of the data needs to be stored in certain strings for a export to excel. However the data takes while to to send be sent back. So in order to get the right information in the right strings I have to put pauses in my code. I have added a timer to my form:

On my timer's tick event I have the following code:

Public Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
iTick = iTick + 1
End Sub

View 3 Replies


ADVERTISEMENT

Serial Port Communications - AT Commands - Send And Receive Data

Apr 12, 2009

I have a USB modem that can detect caller ID and can detect dialled digits when special AT commands activated, How to send and receive data. The sent data will be the AT command such as AT+VCID-1 to activate the caller ID, the received data will be caller ID information and the digits dialed. I'm new to prgramming and using Visual Basic 2008 Express.

View 8 Replies

Receive HEX Data Through 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

[code].....

View 2 Replies

VB Receive Data From Serial Port?

Apr 20, 2011

I use ReceiveSerialData() function to get a string (20 byte of 8 bit data) from serial portBut I faild and got the error "operation has timeout". I am new in VB 2010

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

Receive Data From Serial Port To Page?

Feb 28, 2011

I am working on my project "PREPAID RESTAURANT CARD USING RFID TECHNOLOGY" in which i sent 12 digit number (rfid tag id) to serial port through my hardware and receive at my vb.net 2008 page.but i don't know how to receive data in vb page in the textbox using which cammand.

View 1 Replies

Receive Data From The Serial Port After Message Is Being Sent?

Aug 4, 2009

I am doing a project on sending and receiving sms from a serial port. But I have a problem on receiving sms. About the receiving sms, how can i show the received sms in the textbox using the serial port. Do I have to use the DataReceived Events. Here is the code i am using:

Public Class Form1
Private WithEvents serialPort As New SerialPort
Private ReadThread As Thread[code]....

View 1 Replies

Receive Incoming Data From Serial Port?

Mar 23, 2011

I am having problem receiving data from serial port. Btw, I am new to Visual studio 2010 too.

I do a test program on my PIC so that when button1 press, it will send character "Y" to visual studio; when button2 press, it will send character "N" to visual studio. I know for VS 2010, sending data out is by the command

[Code]...

View 1 Replies

Unable To Receive Data From The Serial Port (VB)

May 4, 2011

I am writing a VB based program which will receive data from a Micrcontroller (programmed in C) via UART. The data that is transmitted from the Microntroller can be displayed on Hyperterminal when I set it up with the correct settings (Baud, Parity etc), so I know that Microcontroller end is working fine. The VB-based program however (written in Visual Studio 2010 Express), does not however receive any data and I always get the TimeOut exception (despite the fact that Microcontroller is sending data via UART, I have an onboard LED to indicate this). Here is the VB code, it is an adapted version from the MSDN library:

[Code]....

View 11 Replies

Receive Continuous Incoming Data From A Serial Port (MCU) In Vb?

Mar 7, 2012

I am working on a project to receive and send data to a micro controller using a Visual Basic application. I am using Visual Studio 2008. I have done coding to send data on button click event.

But I am stuck at how to receive incoming data to serial port continually from MCU and store it to an integer or string type data in VB.

View 1 Replies

Serial Port - Receive Incoming Data From Radio Equipment?

Apr 8, 2009

I have an application that receives incoming data from a Radio Equipment through a hardware modem. How can I replace the hardware modem? Could I use the PC Sound Card in place of the modem?

View 9 Replies

Send And Receive Data Through USB Port?

Jan 24, 2008

I am trying to send and receive data through a USB port on my computer to an external microcontroller.

I built most of the code using the "serial class" but then i read that this would not work with a USB port.

How would I go about communicating with this USB port on my computer?

View 5 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 :: SEND/RECEIVE Data From Serial, CPU Speed?

Nov 9, 2009

I need to send data via serial and wait for and answer (VB.NET).Right now i'm doing it this way:SerialPort1.Write(sel & Chr(13))Thread.Sleep(50)aaa = SerialPort1.ReadExisting()If i do not thread.sleep, i get nothing, i supose it's because the machine is too fast.

View 1 Replies

Using Chr$ To Send Data To The Serial Port?

Feb 18, 2011

I used this code in the pass with VB6 to send hex data over the serial port to a microcontroller.

MSComm1.Output = "C"
Send command ID
MSComm1.Output = Chr$("1") Send Command Parameter
MSComm1.Output = Chr$(CStr(240)) Send CR

I need to convert the code using VB2010, but Chr$ is not available, and anything I tried will not send the actual ascii code character......

View 10 Replies

Send Data : String Through Serial Port?

Mar 11, 2010

i knew Serial ports are a type of computer interface that complies with the RS-232 standard. They are 9-pin connectors that relay information, incoming or outgoing, one byte at a time. Each byte is broken up into a series of eight bits, hence the term serial port.And I want to write a program chatting through Serial Port.

View 3 Replies

Send Data On Serial Port And Detecte It In Same Program?

Feb 24, 2011

I am supposed to make a software for data logging via serial port but the hardware is expected to be delayed and iam required to continue with the programming of the software. What i need is that by some mechanism i want to send data on serial port (COM port) and after delay of some mili seconds i want to detect that data. I actually want to do this because i want to create environment like my software i intercepting COM port and on receiving data it captures the data values on port and record them to database. I have done most the work, the only thing left which i want is as above how i will send data on COM port (this was to actually to be done by hardware) and detect it in my program (same program from which data was sent). Please guide from where should i start.

View 3 Replies

Send XML Commands In Vb To Get Data Received Over A Serial Port

May 5, 2011

How do I send XML commands in vb to get data received over a serial Port?

I know the commands I'm just not sure how to send them.

View 2 Replies

Use A Textbox To Send Binary Data To Serial Port

Sep 1, 2009

I am currently sending data via a serial port to an AVR microcontroller. I've tried searching the forums here first but haven't found any posts that specifically deal with what I'm trying to do. Here's some additional information that might help before proceeding:

Sendbox = textbox
ReceiveBox = listbox
ReceiveChk = checkbox

I currently have it setup so I enter hex data in Sendbox, click the button, it sends the data to the AVR micro via the serial port, which gets repeated back through the serial port and receives the hex data in the ReceiveBox. I want to be able to setup something similar so I am able to input data into a textbox as binary and have it sent to the AVR that way.

I realize it will send the same data whether I enter it in hex or binary form. I just want the option of being able to send it in either form.

Below is my code.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendButton.Click
SerialPort1.Open()

[Code]....

View 1 Replies

Padding Receive "Hex" Data From Serial Port?

Dec 12, 2009

How do you add the "0" to the Hex value? What I get: 881 Should Be: 8801

Dim ByteCounter As Integer = 0
Dim DataPacketLenght As Byte
Dim Databyte(DataPacketLenght - &H1) As Byte

[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

Receive Datas From EPBX Through Serial Port?

Jul 22, 2009

How can receive datas from EPBX through Serial port in vb net

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

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

C# - Send And Receive A Tcp Message To A Specific IP/Port In .NET?

May 18, 2011

I'm trying to send a message to a specific IP/Port and receive a reply in an ASP.net website, i tried the method describd at the following link but it didn't work for me as you can see SocketException An attempt was made to access a socket in a way forbidden by its access permissions

View 1 Replies

Send *.Hex File Via Serial Port To A MCU?

Sep 11, 2009

sending a hex file through serial port using vb.net? and i m not really sure the difference between sending data and sending a file, seems majority of the topics on the forum is about sending data via serial port.

View 2 Replies

Send Keystrokes To A Serial Port?

Mar 11, 2010

I am trying to send a ctrl-x keystroke to COM2 and I ahve to code to open the port and read and write but when I tried to send Chr(Keys.ControlKey + Keys.X) it did not work

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

Send A Control String From .NET To A Serial Port?

Aug 5, 2010

I am trying to send a control string from VB.NET to a serial port. I am using a pololu trex jr. on the receiving end of the serial port. I have attached a copy of my current code which compiles without errors, but fails to send data. I can tell that it is not sending data because I have a light on the control board connected to the port and it normally blinks when data is received. The program that came with the board drives it perfectly but does not serve the purpose I need it to. I am open to any suggestions as I eventually plan to write a class to contain the control routines.

View 12 Replies

Send String Through Serial Port To Arudino?

Apr 18, 2012

im very new to visual basic. as in i just started 2 days ago. Currently i have a little program written up that has a couple of radio buttons and then a submit button. when you select a radio button and click the submit button, a little message box with pop up and say "you selected such and such"

Well now im trying to make something that will send a string to arduino through the usb cable. Basically it will use the same set up as stated above but instead of a pop up message it will just send the string through the port. for example Radiobutton1 - when selected and submit button pressed will send "1" (no quotes) through the serial port Radiobutton2 - when select and submitted will send "1" and then maybe "3"

and so on and so. Some radio buttons will only send 1 string through them and some may send multiple. Now, i dont need help with arduino, i have that already set up to wait for the strings to come through the com port. just need to figure out how to do it in VB.

View 1 Replies







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