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


ADVERTISEMENT

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

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

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

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

Read Data From Serial Port?

Apr 2, 2012

I am using a VB.NET(VS2010) to read data from serial port. I have 8-bit data to collect through rs232. This data is represented numbers. What reading method should I use and how to convert it to double format?

View 4 Replies

Read Data From The Serial Port?

Nov 12, 2009

I need to read data from the serial port Ive used serialport from the toolbox , but dont know how to use it. I used to do it on a Amiga like this

open serial("serial.device".0.2400.0) rem(open port)
repeat GW.w=readserial(0)
if gw>29 and gw<128

[Code]....

View 1 Replies

Reading Hex Data Through The Serial Port?

Oct 27, 2009

I am having a little trouble receiving data via the serial port. I can send just fine. I am using Serial Port object.

Basically my data expected is in the form of: [0x43 0x35 0x64 0x35...] broken up into bytes. I tried using the SerialPort.Read() function but can't get it to work.

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

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 Data To Serial Port?

May 1, 2010

i am doing a project in vb 2008 .net.during execution of the code, a different number is generated every second. the numbers are either 0,1,2,3,4, or 5. how do i send this number every second to the serial port. at the serial port i have a microcontroller connected which should accept this number and light up an LED coresponding to the number received.

View 1 Replies







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