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


ADVERTISEMENT

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

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

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

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

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

VS 2008 Send An Object Instead Of Strings Which Includes Multiple Unsigned Integers And Strings

Aug 13, 2009

I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.

View 39 Replies

Serial Port In VB 2008

Apr 9, 2011

I am trying to make my own hyper terminal. I have used the serial port component and after setting all the configuration for the com port I press the button Enable ComPORT. The problem is that, when I press the enable com port button the program goes unstable untill the reception starts from the COM port. After the reception is start the program starts working fine.

[Code]...

View 6 Replies

Access Serial Port In 2008?

May 25, 2008

[Code]...

m really not sure in here because this code is for vb .net 2003.. are they the same?

View 2 Replies

Reading Serial Port Using .net 2008?

Oct 2, 2011

I have microcontroller interfaced with serial port of my computer. In my microcontroller I have 2000 sample data and my primary target is to read those data. Now I can read those data in hyper terminal, but when it comes to my application it doesnt show anything.

Private Sub sp1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles sp1.DataReceived
sp1.Open()
MsgBox(sp1.ReadExisting())
End Sub

this simple code block should show me the data.But it doesnt.data format coming Microcontroller is in this following formate :

nitialization successful !,1023
Starting sampling process... 1023,1023 1023,1023
0,2 1023,1023 1023,1023 1023,1023 212,686 1023,1023 1023,1023
1,5 1023,1023 1023,1023 1023,1023,659 213,689 1023,1023 1023,1023

now, I dont understand why it doesn't read anything :NB: SP1 has a baudrate of 19200,Databits 8 and no parity,COM1 port. I aisnt sure whether I will be needing a buffer or not

View 1 Replies

VS 2008 Read Serial Port?

Jul 20, 2011

This code was published a few years ago by stanav. I have it reading my Com1 db9 port but having some issues.i have tried adjusting some timeouts, but then, it may just sit there.Jarbled Text - I should be getting results like "SOHEM709US17946US1114US62RST12345678920110714170301" etc., instead I am getting "3B?B?B?????99?F?F?3B?B?B?CAD?1???2?8?3?0??0?1?6"I/O Error - The I/O Operation has been aborted because of either a thread exit or an application request.

[Code]...

View 17 Replies

VS 2008 Serial Port Control?

Nov 18, 2009

All these days i used to program in Vb6.0. Now since from last 15 days I have been using Vb2008. In Vb6.0 I used MSCOMM for serial communications. Here in Vb2008 I found Serial port control equivalent to it. I somehow managed to learn how to send data using serial port control and set parameters like baudrate , stopbits , etc. But I' not getting how to get the received data. In VB 6.0 we used to use comEvReceive in OnComm event and used MSCOM1.Input to get the received data. But I'm not getting how to do the same in vb2008.

View 2 Replies

VS 2008 Serial Port Read?

Mar 11, 2010

I have written a sketch to an arduino board to send data to the serial port. How can I tell VB to only read from the serial port when data is sent to it? I have been using the timer.tick and tried to sink it with the delay I set in the arduino

View 2 Replies

[2008] Getting Strings From A Bluetooth Com Port?

Jan 9, 2009

i'm currently trying to make a connection between my phone to my PC using vb .net and a program I will build for my phone.my phone should send information (some strings) through the com port, I wrote in google "VB .net bluetooth" and I sew there is a library for vb .net, but I don't think I need that library, can I communicate with a com port without this library? like making a connection with a normal com port?If I'm right, how do I do that? how can I recieve information from the bluetooth com port?

View 7 Replies

VS 2008 : Serial Port And Index Out Of Range?

Aug 13, 2011

the program works fine but there is the possibility of a problem because this error message did pop up.I'm gathering my data bytes in an array --

dim rcvdata(19) as byte
serialport.read (rcvdata,0,20)
serialport.close

(Then decipher the array).But Should I go further with this? Could the error be related to my serialport.read?What if there were NOT 20 bytes read into the array?I think this may be it? I should poll the array for 20 bytes before proceeding?Yes? -- (It's a given and that's standard procedure).No? -- Don't worry, they're going to be there (the read will try again if it has to?) It won't proceed without the 20 bytes?

View 12 Replies

VS 2008 Connect A Photocell To Serial Port?

Apr 23, 2010

I'm trying design an aplication, who receive inputs from a Photocell omron.

I will connect this photocell at serial port, and it, when detect movement, close the circuit.

How can I verifi in the serial port, if the circuit is closed ou opened?

View 6 Replies

VS 2008 Control Laser Via Serial Port?

Mar 23, 2011

I have created a laser that can be controlled via the serial port. I've written the code to switch it on/off and it works fine. How do i make it strobe? Here's the code to switch it on, to switch it off is similar (don't ask why it is like this...i think it's the transistor from the circuit board that switches the signal):

[Code]...

View 4 Replies

VS 2008 Serial Port - Data Type?

Aug 22, 2009

seems to be quite easy but i'm stuck I'm reading a hex string from serial port (f.e. 20FD05C4), but can't read it proper in VS:/ . I've been trying with serialPort.ReadExisting(), serialPort.Read, etc

Is there any way to just read that String or convert it easyly bin/hex ?

View 8 Replies

VS 2008 Serial Port Program Hogging CPU?

Feb 18, 2011

i have the following code which runs ok, but it hogs upto 95% of the CPU.program outline: a timer tick event = 1000ms scans through 30 readlines of data on the comport for a specific line of hex, and then extracts information from the next line and converts it to decimal for viewing on the screen.i've only included the main part of the code to try and keep it simple.

Public Class Form1
Private WithEvents serial As New IO.Ports.SerialPort
Public grab As String
Public cardIndex As Integer

[code]....

View 9 Replies







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