VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Serial port communications - VBScript sample how to initialize a modem. Sample can be used a a base

by Anonymous (267 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 19th February 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Serial port communications - VBScript sample how to initialize a modem. Sample can be used a a base for other comport communication programs.

Rate Serial port communications - VBScript sample how to initialize a modem. Sample can be used a a base



' 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

Serial port communications - VBScript sample how to initialize a modem. Sample can be used a a base Comments

No comments have been posted about Serial port communications - VBScript sample how to initialize a modem. Sample can be used a a base. Why not be the first to post a comment about Serial port communications - VBScript sample how to initialize a modem. Sample can be used a a base.

Post your comment

Subject:
Message:
0/1000 characters