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


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

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 :: Like A Serial Port

Mar 8, 2010

For many years, I have sent data between 2 computers using serial ports."Here is the data", "Thank you for that data!" type stuff.Where do I get more information for doing the same thing with 2 computers that are networked together? Assume a local ethernet connection.I have experimented with serial-ethernet modems and that works well but I don't want any more hardware.Is there a good thread here I should read?I want 2 VB programs running and I want to exchange data periodically.

View 2 Replies

Communications :: Listening To The Serial Port?

Sep 21, 2011

I am trying to listen to the COM3 port and display the output in the TextBox. If I understood correctly I will have to implement this by using eventhandlers, delegates. I tried following these articles:

[URL]

And this is the code I came up with... Unfortunately it doesn't display anything. App just starts display "True" and no data is being displayed. I am monitoring Arduino platform which I know is sending data constantly.

Code:
Imports System.IO.Ports
Imports System.Text
Public Class ArduinoSerial

[code].....

I am really new into the vb.net. I am sure there are some horrible mistakes with this code but I am kind of stuck for the past 2 days on this one.

View 5 Replies

Communications :: Reading From Serial Port?

Dec 16, 2008

i am using serial communication to read from a plc.The plc will send a string :&H3A as a header byte then C(which is a variable that contains data)I want to read and mask out the header byte.I use the following code but cannot read anything.

Private Sub btnread_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnread.Click
Msg = SerialPort1.ReadExisting
count = Val(Mid(Msg, 1, 2))
Lblno.Text = count

[Code]...

View 1 Replies

Communications :: Serial Port - Run Program, "Access To The Port 'COM1' Is Denied"?

Oct 15, 2008

Im having problem with the Serial Port. When i run my program, "Access to the port 'COM1' is denied". What does that mean? Im not sure whats happening because theres no error in my code. Someone suggest me to use 'COM2'. Which is also the same result. I have a microcontroller, programmed and run it. And i need to capture the data onto my vb, which is on a multiline textbox. How to i do that?Just to double check my code?

[code]...

View 1 Replies

Communications :: Disable Encoding For Serial Port?

Apr 1, 2009

I am trying to transmit the integer value 360 to serial port. but at micro controller i am getting the 3 bytes (33 36 30) its ASCII Values.So is there any way to transmit the 360's hex value 168 using two bytes only like 01 68 only?

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

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

Communications :: Serial Port Responding Slow

Sep 22, 2008

i have an application where i send data(a question in a "packet" of 8 digits) to an external controller via serial port, and then that controller sends me back some information(the answer, in a "packet" of 8 digits, not necesarily zeros and ones)I have develope a simply software that is getting the correct data form the controller, here it goes:[code]So now i can see how many times the code needs to enter the loop to get the "answer" from the module.Now i know that the code needs to do the loop from 5000 to 18000 times to get the answer each time!!!!, so that is why the software keeps getting freeze.I supose that that time is neccesary for the module to give the answer, so i think i can't get better respond times, but i would like the software not to get halt.

View 3 Replies

Communications :: Setup A Virtual Serial Port

Jul 4, 2008

I'm writing an app with takes 3 readings off LCD displays via serial ports. The module which scans the serial ports is getting stuck in a loop for around 1.5 seconds. I need it to be much quicker than that. Is there a way I can setup a virtual serial port so I can run test it on my PC. Its very tedious and time consuming of making changes and visiting the machine its for.

View 1 Replies

Communications :: Transfer Image Through Serial Port?

Feb 9, 2011

I have a barcode scanner that beside scanning the barcode it also snaps an image. I wrote a simple application that searching all ports locating in which one the scanner is connected and opening the port.

I can easily read any barcode and the send command to the scanner to pass me the image taken on the port, but i have a problem re-constructing the image from the bytes i read.

Code:
sendCommand()
Dim img(SP.BytesToRead) As Byte
SP.Read(img, 0, img.Length)

[Code]....

I can get the image from the scanner in any format needed (jpg,bmp etc) so no need to provide a precise solution just a general idea.

View 15 Replies

PC Communications To Intelligent Instrument With 485 Serial Port

May 7, 2011

Now I'm doing a VB project about pc communications to a intelligent instrument with 485 serial port. I want to use API but I'm not good at it.

View 2 Replies

Serial Port Communications: Turning Of ECHO?

Feb 16, 2011

During Serial communications, is the echoing back usually done by the serial port interface or is it done by the UART at the far end?

View 10 Replies

Communications :: Arduino Board: Communicate With It Using Serial Port

Jan 27, 2011

I have a problem with something.I have a Arduino board I wan't to communicate with by serialport.
In "Form1", I'll retrieve values from the Arduino board, and I want it to calculate and display data in TextBoxes.How can I do this?[code...]

View 8 Replies

Communications :: Close Serial Port After USB Device Unplugged?

Oct 1, 2009

There seems to be a lot of discussion around about handling exeptions when a USB serial port device gets unplugged. What I want to know is how can one re-attach to it once it is plugged back in. The problem is that if you unplug a USB serial port device the app doesn't know it has gone and remains convinced it is still open. I have to close the app completely before I can re-attach to the device. I need a way to force it to close/go away.

View 2 Replies

Communications :: Serial Port Input For Barcode Scanner?

Nov 11, 2008

i need to create an application where input are to be received by the barcode scanner.However, i am not suppose to use the textbox to do so. However i need to use the serial port to do so. Any one know how am i able to do that?

View 1 Replies

Communications :: Serial Port Communication Via Null Modem Cable?

Sep 4, 2009

I have a VB.net app running on one computer, displaying text into 2 texboxes or labels.I need to see the two values in two sperate textboxes or labels from the two labels on another computer via a null modem serial adapter.

1st computer.

Code:

serialport1.writeline(label1.txt)

straight forward right?

2nd computer to read the data

Code:
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
dim s as new string = serialport1.readline()
label1.text = s

This is what I was thinking;

Code:
serialport.writeline(label1.text & label2.text

This would send the two values over the serial port. How would I seperate the two values and display them in two different texboxes?cannot use them together)Am I on the right path at all? Or using the serialport.writeline method won't work at all....

View 4 Replies

Communications :: Serial Port Read Wrong Return Result?

Dec 17, 2008

Anyone else have an issue using read, It appears when I use read it gives me the correct buys but returns the wrong integer value So I use it and it fills the Array i make with &h10, &h6 but read reutnrs number of bytes returned to 1. if there a better way to go with Vb.net with RS232 I mean really my projet dosent have anything out of the Normal

Friend WithEvents CashValidator As System.IO.Ports.SerialPort = New System.IO.Ports.SerialPort("COM1", 9600, IO.Ports.Parity.Even, 8, IO.Ports.StopBits.One)
CashValidator.Read(MyResponce, MyResponceLen, 4)

View 2 Replies

Communications :: Unable To 'activate' Serial Port Like Putty Or Hyperterm

Aug 18, 2009

I'm trying to write a bit of code to communicate with an RS232 coin mech.The problem i have is that the coin mech works fine when used with Putty or Hyperterm but i do not appear to be able to 'activate' the serial port with my code.[code...]

When i open the hypertem or putty session the coinmech's active light immediatly comes on and i am able to send and recieve data. When the port is opened with the code nothing happens.

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

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







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