473,394 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Serial COM in VB 2005

When i send a serial command serialport.write("[exc]") o a specified
serial open serial port. How can i read back the value in a string and
display it in a textbox???
Aug 6 '08 #1
4 1085
"cmdolcet69" <co************@hotmail.comwrote in message
news:9c**********************************@p25g2000 hsf.googlegroups.com...
When i send a serial command serialport.write("[exc]") o a specified
serial open serial port. How can i read back the value in a string and
display it in a textbox???
Check the specs on the device you're working with. If it supports the
functionality, it should be easy. Otherwise forget it. Buffering the data
won't do any good either. It's entirely up to the device you're working
with.

Same as putting gas in a car and asking the car how much gas you just put
in... if the car supports that functionality, the info will be right on the
dashboard... otherwise, ain't gonna happen.
Aug 6 '08 #2
On Aug 6, 10:54*am, cmdolcet69 <colin_dolce...@hotmail.comwrote:
When i send a serial command serialport.write("[exc]") o a specified
serial open serial port. How can i read back the value in a string and
display it in a textbox???
Hi,

Check out this example.

http://www.innovatic.dk/knowledg/Ser.../SerialCOM.htm

Jeff
Aug 6 '08 #3
On Aug 6, 12:08 pm, "Ken Halter"
<Ken_Halter@Use_Sparingly_Hotmail.comwrote:
"cmdolcet69" <colin_dolce...@hotmail.comwrote in message

news:9c**********************************@p25g2000 hsf.googlegroups.com...
When i send a serial command serialport.write("[exc]") o a specified
serial open serial port. How can i read back the value in a string and
display it in a textbox???

Check the specs on the device you're working with. If it supports the
functionality, it should be easy. Otherwise forget it. Buffering the data
won't do any good either. It's entirely up to the device you're working
with.

Same as putting gas in a car and asking the car how much gas you just put
in... if the car supports that functionality, the info will be right on the
dashboard... otherwise, ain't gonna happen.
The device can reply with a {exc 2000} however how can i read that
from the port and then display it in a textbox.
Aug 6 '08 #4
Use the Read or ReadExisting (text only) methods. You can call this from
the DataReceived event. However, if you use DataReceived, you must use a
delegate to display the data, to avoid a cross-thread violation. You also
can use a Windows forms Timer control to poll ReadExisting, with no need for
a delegate.

I have lots of code examples in my book -- see below.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Aug 6 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: nephish | last post by:
i have an interesting project at work going on. here is the challenge. i am using the serial module to read data from a serial input. it comes in as a hex. i need to make it a binary and compare it...
14
by: McBooCzech | last post by:
Hi I am just trying to analyze (parse) data from the serial port (I have connected GPS receiver to the ttyS0, so I can read ASCII characters in the CSV form on the serial port 1). I am doing this...
16
by: halukg | last post by:
I am trying to send a 6 byte char array from the serial port in new C# 2005 Express: com.Write(new string(new char { (char)34, (char)14, (char)192, (char)51, (char)0, (char)0 }, 0, 6)); I am...
1
by: David | last post by:
I have written an application in VB.NET 2003 that uses the SAX serial component for RS232 communications with hardware. The program sets up 2 serial ports so that it can talk to 2 different...
4
by: Gary Frank | last post by:
I'd like to write a program in VB.Net that handles serial communications to several devices. VB.Net 2003 does not have adequate built-in serial communications. I heard that 2005 will have that. ...
2
by: joe | last post by:
Has anyone seen any source code that shows how to use the serial port in VB 2005 (System.IO.Port)? Especially how to use the asynchronous read? John
1
by: henrycortezwu | last post by:
Hi All, I'm trying to connect to a virtual port (COM19, OUTGOING, "Bluetooth Serial Port") using VS2005 System.IO.Ports. When I ran the ff code below here's what happens. 1) VS2005 Compiles w/o...
5
by: Franklin M. Gauer III | last post by:
Hi All, I've written an ASP.NET application (webservice) that does simple serial communications via the .NET 2.0 SerialComm object. The application runs fine on my development machine. The...
4
by: cmdolcet69 | last post by:
This code below write a serial command to the com port then read the results and disaplays it into the label1.text property when button1_click event is triggered. I think what is going on is that...
2
by: Nasif | last post by:
Currently I am writing a program which sends and receives messages through serial port to a device. I am using C# and Microsoft Visual studio 2005 for windows program. But my problem is when i try...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.