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


ADVERTISEMENT

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

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

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

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

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

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

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

Office Automation :: Writen A Piece Of Software Which Takes Values From A Serial Port?

Aug 22, 2009

I have writen a piece of software which takes values from a serial port, peforms some calculations and then records the result in an Excel file.It also uses some values stored in an excel file for reference.

The program will run fine for days/weeks until the PC is rebooted mid run.Once it gets rebooted mid run I ge the error "RPC_E_DISCONNECTED"This then occurs everytime the program is run.Full error file below.I'd like to code for this error of course but even a simple fix to stop it happen once the PC has been rebooted to allow it to run again would do. I can give more details but I'm not sure where to start.Target system is windows XP SP3 with office 2007

[Code]...

View 5 Replies

Using A Serial Port In A DLL With .NET 2010?

Jun 3, 2012

I am trying to buld a DLL in VB.NET 2010 that will be use to control a vending machine.Whin a call into the DLL to a function to open and setup the comport the first time its opens it just fine, but if a call into the DLL again it does not know that the port is open even if it is still open. I can check with another program and is shows the port is open and if I try to call into the DLL again to open the port I get an error that the port is already open. Any idea how to set this up so it will work.

I need to open and config the com port in one call that leaves it open and then in other call use the com port to talk the equipment in the machine without closing the com port untill it is required to close it.

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

VS 2010 - Serial Port Communication Between Two Computers

Feb 22, 2012

I am using two computer to connect to each other via serial port, I have made a program in VB that allows me to read from the serial port then store whatever that character is to a variable. The only problem is I have to hit a button to read in from the serial port and pass the character to the variable. Is there any way to do this automatically?

View 6 Replies

VS 2010 Reading Data From Com / Serial Port?

Apr 3, 2012

Private Sub receive_data(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
Dim aBuffer(255) As Byte
Do While SerialPort1.BytesToRead > 0

[code]....

Basically, what I am trying to do is everytime I receive data from the serial port, I turn that data into an array (aBuffer) and I then call another sub using that info.The problem I'm having is that everytime I receive data, the array only fills up to the first 8 bytes! This isn't a problem when I receive smaller packets of 6 bytes but anything else gets chopped off.

What is really frustrating is that it seems quite fickle. I've read somewhere that this happens because the computer is handling the bytes received faster than they are being put in the buffer?? Not really sure but if I put a couple of breakpoints during debug, sometimes the array fills up correctly... Note the maximum size of any one incoming message would be 255 bytes.

View 4 Replies

VS 2010 Reading Hex Data From Serial Port

Apr 23, 2010

This is an amateur radio project. I have a TNC (modem) that receives a digital stream (AX.25) from my radio. The TNC decodes the AX.25 frames and translates them to KISS frames (the protocol used between the TNC and the PC, see documentation here: [URL] It sends the data as HEX values.

What I'm looking for on the serial stream is the beginning of a data frame marked by 0xC0 0x00 and ending with 0xC0. Should be easy. Using serialport.readbyte() I should get binary data that I can convert to hex and look for the beginning of a data frame and then convert the subsequent data to ascii, as it will be text from a chat session.

Just to try it out and see the raw data coming from the port, I use teraterm or realterm and capture the data and it's a mix of junk (control frames and what not) and valid text. When I display the same data in a text box in VB I get data that look like this:

[Code].....

View 5 Replies

VS 2010 Serial Port CTS, CD, And DSR Holding Always On/true?

Aug 31, 2011

I have a serial port hub with 4 ports. 2 of them work perfectly and the other 2 don't.I've found out that the 2 that don't work always have CTS, CD, and DSR on/true.The 2 ports "don't work" because they aren't able to receive a response.How can I turn off CTS, CD, and DSR holding? It seems that they are ReadOnly properties.I don't know if this will help, but I've recorded a log (recorded pin values every 1 second interval) for one port that worked and another that didn't.The one that didn't work:

RTS,CTS,DTR,DSR,CD,RI,TX Total,RX Total,TX CPS,RX CPS,Break,Overrun,Parity,Framing
0,1,0,1,1,0,9,0,4,0,0,0,0,0
0,1,0,1,1,0,9,0,0,0,0,0,0,0

[code]....

As you can see, the one that doesn't work has a value of 1 in CTS, DSR, and CD at all times. Also, the one that does work was able to receive the data, which is shown by the 14.

View 4 Replies

Read Serial Port - Visual Basic 2010

Mar 18, 2011

I got an Arduino hooked up to the PC and would like to read the serial port of it. I read the serial port in Visual Basic with com.Readline, but it won't read everything. It looses around 2-3 lines that were sent over the serial port to the Visual Basic code. They get "lost".

[Code]....

View 1 Replies

VS 2010 Cross Thread Access Of Serial Port

Mar 29, 2012

In my project I'm trying to send data to Serial port. I have added the serial port control to the form. Now if I try to send data to serial port using Serialport1.write method in a button click event, I'm able to send the data successfully to the serial port. Otherwise if I try to send the data using the same "Write" method from another thread other than the one in which the serial port component was created, I'm getting an exception saying serial port busy.

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

VS 2010 Converting Strings Received From Serial Port To Double?

Apr 25, 2012

how to convert received string to double.

I'm receiving string as 420.8 280.9 140.2 like this from serial port.. and transferred it into textbox..

I'm using following code to split string and to convert to double

Dim ReceivedText As String
ReceivedText = txtReceived.Text
Dim str_RY_1U, str_RY_1V, str_RY_1W As String

[Code]...

For calculating percentage RY_R is calculating fine.. But when it comes to RY_Y it showing error "string not in a correct format..."

View 3 Replies

What Baud Rates Are Supported By The Serial Port Object In VB 2010

Jul 12, 2011

What baud rates are supported by the serial port object in VB 2010?

View 1 Replies

VS 2010 - Reading Data From Serial Port And Outputting To Screen And Access Db?

May 1, 2011

I have conquered the problem of the database however what i need is the serial port data sent to a database and outputted on screen however i keep getting cross thread errors ..

Imports System.Data.OleDb
Imports System
Imports System.ComponentModel
Imports System.Threading

[code]....

View 3 Replies

Error In Serial Port Data Capture Program In Visual Studios 2010?

Apr 11, 2012

I'm trying to make a rs232 serial data logging program, that accepts a 12 bit hex RFID tagID from an RFID module. My end objective is to save this RFID tagID into a database and assigned to a person for a personnel management system.I had to use button3 to add the value of the variable 'msg' into textbox1 because I was getting the following error "Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on". It is a temporary workaround.When I do press button3, I get the incomplete hex number, instead of "4C00A2C82A0C", I get "A2C82A0C", and sometimes I get random digits like 1,A,C etc etc.

Public Sub OpenPort()
Try
If SerialPort1.IsOpen Then
SerialPort1.Close()

[code]....

View 4 Replies







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