1 Replies - 5931 Views - Last Post: 25 June 2010 - 04:44 AM Rate Topic: -----

#1 phoeshell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-June 10

VB.net, How can I read 8 bit data from serial com1 port?

Posted 25 June 2010 - 01:03 AM

Now, I am trying to read data from serial com1 port. Now, I am not sure how to send. I found so many method to send but that are not so good and I cann't read any data. I am using VB.net 2005. Which is the best way and how can I read and send?

Please email {EMAIL REMOVED}
Is This A Good Question/Topic? 0
  • +

Replies To: VB.net, How can I read 8 bit data from serial com1 port?

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: VB.net, How can I read 8 bit data from serial com1 port?

Posted 25 June 2010 - 04:44 AM

no mails the point of forum is so other can read it and learn to :P
you may need to look at serial port read function:
Public Function Read(ByVal buffer() As Byte, ByVal offset As Integer, ByVal count As Integer) As Integer
Member of System.IO.Ports.SerialPort
Summary:
Reads a number of bytes from the System.IO.Ports.SerialPort input buffer and writes those bytes into a byte array at the specified offset.

Parameters:
buffer: The byte array to write the input to.
offset: The offset in the buffer array to begin writing.
count: The number of bytes to read.

Return Values:
The number of bytes read.

Exceptions:
System.ArgumentNullException: The buffer passed is null.
System.InvalidOperationException: The specified port is not open.
System.ArgumentOutOfRangeException: The offset or count parameters are outside a valid region of the buffer being passed. Either offset or count is less than zero.
System.ArgumentException: offset plus count is greater than the length of the buffer.
System.TimeoutException: No bytes were available to read.


try it and tell us if you need some more help :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1