Using netcomm

  • Thread starter Thread starter Pedro Silva
  • Start date Start date
P

Pedro Silva

Hi,

I´m a newbie to vb, i´ve been using it for a while to talking to
microcontrollers.
In VB6 i could do this "MSComm1.output = Chr$(255)" but moving now to
vb net and using the netcomm ocx this "AxNETComm1.set_Output(chr(255))"
doesn´t seem to work.
I´ve already bought Richard Grier book, but it takes time to arrive and
i cant figure this out.
Please Help!!!

Best Regards
 
Hello,

Pedro Silva said:
I´m a newbie to vb, i´ve been using it for a while to talking to
microcontrollers.
In VB6 i could do this "MSComm1.output = Chr$(255)" but moving now to
vb net and using the netcomm ocx this "AxNETComm1.set_Output(chr(255))"
doesn´t seem to work.

Thomas Scheidegger's (aka NETMaster) Serial Port FAQ:

http://makeashorterlink.com/?M2FE42E83

HTH,
Herfried K. Wagner
 
Hi,

Thanks for the reply, i´ve already saw this and i can´t still figure this
out.

Best Regards

Pedro Silva
 
Hi,

I´ve succeeded but only this way (below).
I´m doing something wrong?
Dim c As String

Private Sub Form1_Load...

AxNETComm1.set_Settings("9600,n,8,1")AxNETComm1.CommPort = 3

AxNETComm1.PortOpen = True

End Sub

Private Sub Button1_Click...

c = Chr(Val(TextBox1.Text))

AxNETComm1.set_Output(c)

End Sub



Private Sub Form1_Closing...

AxNETComm1.PortOpen = False

End Sub



Best Regards

Pedro Silva
 
Hi Pedro,

I answered this by email. However, for lurkers:

Dim buffer As String = Chr(255)

AxNETComm1.set_Output(buffer)


--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 
hi,
After I get the Netcomm demo. I try to run but i has this error message

An unhandled exception of type 'System.NullReferenceException' occurred in
NETComm.exe

Additional information: Object reference not set to an instance of an
object.

What should I do ?

regards
Tan
 
Back
Top