Link to home
Start Free TrialLog in
Avatar of kaifong78
kaifong78

asked on

Open Serial Open in VB.NET

Hi,

Can anybody tell me how to I write a code Open Serial COM Port in VB.NET? I have found a sample from http://www.codeworks.it/net/VBNetRs232.htm but I dont know how to add in into my project! Can provide me more information and example from others website?

Your help is highly appreciated!

Rgds,
cathy
ASKER CERTIFIED SOLUTION
Avatar of telefoniaip
telefoniaip

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kaifong78
kaifong78

ASKER

Hi,

Thank you for your reply. However MSComm32.ocx is not delivered with Visual Studio, I am using VB.NET. Please take a look this URL  http://ourworld.compuserve.com/homepages/richard_grier/NETCommOCX.htm

Code is quite similar with MSCOMM

        AxNETComm1.CommPort = 1
        AxNETComm1.PortOpen = True
        AxNETComm1.RThreshold = 1
        AxNETComm1.set_Output("Hello" & vbCr)

I have sucess to sent text to our Making System via RS203 with this code.

MSCOM.Output = "Hello How Are ?"
            MSCOM.Output = (vbCrLf)

The output only display in frist line -> Hello How Are ?

Do you know how do I sent a 2nd text to 2nd line?

example output:
Hello How Are You? -> 1st line in system screen
I am fine.  -> 2nd line in system screen

I have tried WriteLine but got error! Please help. Thanks