Click to See Complete Forum and Search --> : Reading Data From A Serial Port


DifferenceOfOpinion
April 15th, 2008, 11:30 AM
Afternoon ladies and gentlemen.

I just got a new project on my desk today for coding a Windows Application. Having only coded web projects, I am here to seek some help as to what to research.

What needs to happen is this. My company uses scales (made by OHAUS) to weigh compounds and the scales that they use have serial ports. I need to write a Windows Application (preferrably in VB) that retrieves the data from the scale via a serial port. This data can be literally be imported into anything, but for now lets just stick with either an XML or Excel document.

I am not asking for the code to do this because I want the challenge and fun of learning this from scratch. All I am looking for is a little direction on what to research.

Thank you very much for your time and I look very forward to your responses.

kmoorman
April 15th, 2008, 01:12 PM
DifferenceOfOpinion,

If I were going to start a serial port project I would start at this web site:

http://hardandsoftware.com/

Kerry Moorman

GremlinSA
April 16th, 2008, 03:25 AM
there are several threads dedicated to Serial communication...

Do a search on CG with 'serial' and 'MScomm' keywords...

to get you started check out Serial Port In VB.NET

Gremmy

Oblio
April 21st, 2008, 09:18 AM
dim firstB as Byte
'in form load
AddHandler SerialPort1.DataReceived, AddressOf SerialPort1_DataReceived
SerialPort1.PortName = "COM7"
SerialPort1.'addOtherSerialStuff
SerialPort1.Open()
dim firstB as Byte
'end in form load stuff

Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
firstB = Convert.ToByte(SerialPort1.ReadByte) 'read a byte
End Sub