You are here:

se.ActiveXperts.com > ActiveComport

ActiveComport Toolkit

quicklinks


Add serial communications to any Windows or .NET application

Adding serial communications requires specialized knowledge that might be outside an individual programmer's expertise. For years, developers have relied upon the power and reliability of the ActiveComport serial communications control.

  • Easy to use API
  • Control devices over a serial port
  • 32-bit ActiveX and 64-bit ActiveX included
  • Samples available in C#, VB, ASP.NET, HTML, PHP, Javascript, Delphi and more
How to use ActiveComport Visual Studio.NET project Web Application GUI application Console Application
Startup screen MS Visual Studio .NET web application .NET GUI application Console application

Use ActiveComport for different purposes:

  • To control manufacturing machines via the serial port;
  • To configure network devices (like print-servers, routers) via the serial port;
  • To control a modem, connected to the serial/USB port or Bluetooth;
  • To send SMS messages to a mobile telephone using a GSM SmartPhone/Modem connected to the PC (serial/USB port or Bluetooth);
  • To transfer files through a null modem cable;
  • Any other scenario where serial communications is involved.

ActiveComport features the following:

  • Direct COM ports supported (like 'COM2');
  • Windows Telephony Devices supported (like 'Standard 9600 bps Modem');
  • Support for RS-232, RS422 and RS485;
  • Up to 256 ports opened simultaneously;
  • Thread-safe to allow the toolkit in multi-threading environments (multi-threading samples included);
  • Support for Hayes compatible modems, connected via a serial port, USB or Bluetooth;
  • Support for GSM/GPRS modems (serial port, USB or Bluetooth);
  • Support for Virtual COM ports (i.e. COM ports redirected through the network);
  • Hardware flow control (RTS/CTS, DTR/DSR);
  • Software flow control (XON/XOFF);
  • Support for any baudrate;
  • Ability to set baudrates, parity, stopbits;
  • Full buffered data transfer;
  • Text and Binary data transfer;
  • Advanced logging.

ActiveComport includes samples for many development tools, including:

  • Visual Basic .NET.
  • Visual C# .NET.
  • ASP .NET VB).
  • ASP .NET CSharp.
  • Visual Basic.
  • ASP 2.x.
  • Visual C++.
  • VBScript.
  • HTML.
  • Delphi 7.x or higher.
  • PHP.
  • Powershell
  • Any other development platform that supports ActiveX/COM components

System Requirements

ActiveComport is available as a 32-bit component and as a 64-bit component (both part of the product):

  • AComport.dll - 32-bit component;
  • AComportx64.dll - 64-bit component.

ActiveComport runs on the following Operating Systems:

  • Windows 2008 (32 and 64 bit);
  • Windows 2003 (32 and 64 bit);
  • Windows 2000 Server and Professional (32 bit only);
  • Windows 7 (32 and 64 bit);
  • Windows Vista (32 and 64 bit);
  • Windows XP (32 and 64 bit).

ActiveComport is built on top of the Microsoft serial device drivers. It just uses these drivers. It neither replaces them, nor does it install any additional serial device drivers.

ActiveComport can be distributed easily to many PC's. Once you have purchased the licenses, you copy the AComport.dll to the PCs and register the DLL on that PC.


Code Snippets and Sample Applications

The following code snippets (VBScript) illustrate how to use ActiveComport.

For more samples, please check the online ActiveComport samples.

Initialize a modem using a direct COM port

Set objComport = CreateObject( "ActiveXperts.Comport" )    ' Create a new Comport instance

objComport.Device              = "COM1"                    ' Use a COM port directly  
objComport.BaudRate            = 56000                     ' Set baudrate (default value: 9600)
objComport.HardwareFlowControl = True                      ' Set Hardware Flow Control
objComport.SoftwareFlowControl = False                     ' Set Software Flow Control
objComport.Open                                            ' Open the port
Wscript.Echo "Open, result: " & objComport.LastError
If( objComport.LastError <> 0 ) Then
  WScript.Quit
End If

objComport.WriteString( "at&f" )                           ' Write command
str = objComport.ReadString
WScript.Echo "Received: [" & str & "]"                     ' Read the response

objComport.Close                                           ' Close the port
Initialize a modem using a Windows Telephony Driver

Set objComport    = CreateObject( "ActiveXperts.Comport" ) ' Create a new Comport instance
objComport.Device = "Standard 9600 bps Modem"              ' Use a Windows Telephony driver      
objComport.Open                                            ' Open the port
Wscript.Echo "Open, result: " & objComport.LastError
If( objComport.LastError <> 0 ) Then
  WScript.Quit
End If

objComport.WriteString( "at&f" )                           ' Write command
str = objComport.ReadString
WScript.Echo "Received: [" & str & "]"                     ' Read the response

objComport.Close                                           ' Close the port
Send an SMS using a GSM Modem connected to the PC; Enable logging

Const RECIPIENT    = "+31611223344"
Const MESSAGE      = "Hello, world!"

Set objComport     = CreateObject( "ActiveXperts.Comport" )' Create a new Comport instance

objComport.Device  = "Nokia 6680 SmartPhone"               ' Use a Windows Telephony driver  
objComport.LogFile = "C:\ActiveComport.log"                ' Enable logging
    
objComport.Open                                            ' Open the port
Wscript.Echo "Open, result: " & objComport.LastError
If( objComport.LastError <> 0 ) Then
  WScript.Quit
End If

WriteStr objComport, "at+cmgs=" & Chr( 34 ) & strNumber & Chr( 34 )
ReadStr objComport
WriteStr objComport, strMessage
strTermCmd = Chr( 26 )                                     ' Terminate message: [ctrl]z
WriteStr objComport, strTermCmd
objComport.Sleep 3000                                      ' Allow some time
ReadStr objComport                                         ' +CMGS: expected
ReadStr objComport                                         ' OK expected
objComport.Close                                           ' Close the port
   
' ********************************************************************
' Sub Routines
' ********************************************************************
Sub WriteStr( obj, str )
 obj.WriteString str
 WScript.Echo "-> " & str
End Sub

Sub ReadStr( obj )
 str = "notempty"
 obj.Sleep 200
 Do While str <> ""
   str = obj.ReadString
   If( str <> "" ) Then
     WScript.Echo "<- " & str
   End If
 Loop
End Sub

' ********************************************************************

Licensing

  Standard License
AX003-0010
Professional License
AX003-0012
Distribution License
AX003-0020
Direct COM port support XXX
Windows Telephony Device (TAPI) support XXX
Configurable baudrate XXX
Hardware flow control XXX
Software flow control XXX
Support for multiple ports (simultaneously) -XX
High-speed data transmission -XX
Use component on any computer in your organization-XX
Distribution of component --X