Sending an integer to COM1 using SerialPort

Posted by Galwegian on Stack Overflow See other posts from Stack Overflow or by Galwegian
Published on 2010-05-12T10:45:26Z Indexed on 2010/05/12 11:14 UTC
Read the original article Hit count: 305

Filed under:
|

I'm having difficulty sending an integer to a serial port... I'm trying stuff like this, which run fine but I'm not picking anything up at the port.

Private Sub fireToPort()
    Dim sPort As New SerialPort("COM1", 56000, Parity.None, 8, StopBits.One)
    sPort.Open()
    sPort.Write(New Byte() {Hex(1), 255}, 0, 0)
    sPort.Close()
End Sub

Any advice?

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about serial-port