VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Modem initialisation and serial port communications

by Anonymous (267 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 4th May 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Modem initialisation and serial port communications

Rate Modem initialisation and serial port communications



' You need the freeware AComport.dll to run the sample.
' Download it from http://www.vahland.com/pub/acomport.dll
' and register it on your machine.
' Read http://www.vahland.com/pub/acomport.htm for more info

Const acERR_SUCCESS = 0

' --------------------------------------------------------------
Sub WriteStr( o, str )
    o.WriteString str
    WScript.Echo "-> " & str
End Sub
' --------------------------------------------------------------
Sub ReadStr( o )
    str = "notempty"
    Do While str <> ""
        str = o.ReadString
        WScript.Echo "<- " & str
    Loop
End Sub
' --------------------------------------------------------------

WScript.Echo "Be sure to have the FREEWARE AComport.dll registered on your system"
WScript.Echo "Check out the code header about how to obtain the component."

Set acObj = CreateObject( "ActivXperts.Comport" )

acObj.Baudrate = 19200
acObj.PortID = 1
acObj.Open
WScript.Echo "acObj.Open, result: " & acObj.LastError

If acObj.LastError = acERR_SUCCESS Then

    WriteStr acObj, "atz"
    ReadStr acObj

    WriteStr acObj, "at&f"
    ReadStr acObj

End If

Download this snippet    Add to My Saved Code

Modem initialisation and serial port communications Comments

No comments have been posted about Modem initialisation and serial port communications. Why not be the first to post a comment about Modem initialisation and serial port communications.

Post your comment

Subject:
Message:
0/1000 characters