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


ADVERTISEMENT

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

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

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

Displaying Serial Port Data In A TextBox?

Apr 12, 2009

I can read data from the serial port (GPS receiver). Its just 2 lines of data every 0.5 seconds. Whats the best method to read the data and display it in a TextBox?
If I use:

DLdate = SerialPort1.Readline()

Then I don't get the new line character, and it just over writes on just one line of the TextBox.

Also, should I time the grab of data, or is there a better way? Should I create a buffer, and when the buffer is full then do a write?

View 2 Replies

Get Data From Serial Port And Do Textbox Array?

Jul 23, 2009

i'm designing this window application wherby it has to get the data from serial port and new data will be display at the textbox.my textbox namely textbox1, textbox2.. till 20.so when 1st data comes in, it will be place to textbox1 then when 2nd data comes in, it will be place at textbox2 and so on.

Now. Should i place the data as array and do textbox array or is there a way to put the data as the for loop runs?i've tried using for loop and textbox + 1 but its not working.

View 12 Replies

Serial Port & How To Display Data In Textbox?

Dec 10, 2009

I am new to VB2008 Express, I have been trying to get data from the Serial port, i have tried for days to get it working. I have read lots of articles but most seem to be for Console applications and I am using an Application. All I am trying to do is create a form with a Textbox and this should display the data received from the serial port.

The data i am trying to receive is "ABC" on Com1 Can anyone either send me a project, as I am sure its something to do with how i am configuring it, or if thats not possible, show me in code?

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

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 1056 Binary Bits From Serial Port

Aug 8, 2009

I am trying to read the data from a device on a serial port. I connect just fine and can receive data fine in text mode but not in binary mode. I am using VB.NET express. I am at the point in my code where I know that the device is sending 1056 binary bytes of data. How do I go about storing this is a binary array? After I have the array stored (which I dont yet) I need to go through the array and convert the binary to integers. They are 2byte integers in the format: 8bit MSB|8 bit LSB.

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

VB 2010 Send Hex Values Across The Serial Port

Jul 18, 2011

I want to send hex values across the serial port. I know, I know, your thinking not this again. But what I need to do does not seem to be addressed, or I am some how missing it when I search around.

[Code]...

View 2 Replies

VS 2008 Serial Port Can't Get To Send Strings

Dec 8, 2010

I've set up two computers, with a null modem serial cable. When trying the connection in two Realterm windows it works ok to send strings.I'm trying to write a simple project that sends the timestring over the same port.One button sends the timestring. I've created one other sub "AppendLabel" that just updates a label.text so I can see what's happening.[code]

View 8 Replies

Communications :: Send 8-10 Character Strings From The PC Serial Port?

Dec 1, 2011

I have quite a bit of VB6 experience but now am trying to create my first VB.Net project. The project is very simple - it just needs to send 8-10 character strings from the PC serial port. The problem I'm seeing is that VB.Net is always sending out a 0x0A character after each 'WriteLine' call. Using VB6 it was necessary to manually send out any End Of Line characters. My application requires that no extra EOL characters be sent after the string.

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

Send A Simple Binary String To A Printer Port Such As "00000011"?

Jul 3, 2009

I need to be able to send a binary string such as 00000011 to a printer port using visual basic.

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

How To Read Data From Serial Port

Jan 3, 2010

I am trying to read data from rfid tag using rfid reader. i can connect reader, but cannot get data?

View 4 Replies







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