Menu
- Serial Port For Lazarus Youtube
- Serial Port For Lazarus Free
- Serial Port For Lazarus 2017
- Serial Port For Lazarus Island
- Com Port Lazarus
ActiveXperts » Serial Port Component » How to Use Serial Port Component » Delphi
Apr 30, 2013 OpenSource component library for serial communication TComport Lazarus This project is the conversion of the Comport Package of dejancrn and dybdahl, for lazarus pascal project. There are several Serial Communication (COM port) options available for Lazarus, but I would first suggest giving Synaser another try. I'm currently using Lazarus 1.2.4 with Synaser from Synapse v40 and even latest trunk revision without any problems.
ActiveXperts Serial Port Component is a software development kit (SDK) that enables the user to communicate to a device over a serial interface.
Such a device can be: a weight indicator, a modem, a scanner, or any other device that is equiped with a serial port. It can even be another PC, connected via a NULL modem cable.
ActiveXperts Serial Port Component features the following:
- Direct COM port support (like 'COM1')
- TAPI (Windows Telephony Device) support (like 'Standard 56000 bps Modem');
- Support for RS-232/RS422/RS485, up to 256 simultaneous ports;
- Support for all types of Hayes compatible modems;
- Support for serial cable as well as USB cable or Bluetooth connections;
- Support for Virtual COM ports (i.e. COM ports redirected through the network);
- Hardware flow control (RTS/CTS, DTR/DSR) and software flowcontrol (XON/XOFF) support;
- Configurable baudrate/parity/stopbits, full buffered data transfer, text/binary data transfer.
Step 1: Download and install the ActiveXperts Serial Port Component
Serial Port For Lazarus Youtube
Download the ActiveXperts Serial Port Component from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.
Step 2: Create a new Delphi Project
Serial Port For Lazarus Free
Launch Delphi from the Start menu. Choose 'New' from the 'File' menu and select your preferred kind of application, for instance: 'VCL Forms Application - Delphi for Win32'. A new Form is displayed in the workspace.
(Click on the picture to enlarge) Bring that beat back sample.
Step 3: Refer to the ActiveXperts Serial Port Component Library and create the objects
Now that a new project has been created, you must add a reference to Serial Port Component in the project to be able to use the ActiveXperts Serial Port Component object. To do so, choose 'Import Component..' from the 'Component' menu. The Import Components' dialog appears. Select 'Import a Type Library':
(Click on the picture to enlarge)
In the 'Registered Type Libraries' page, select 'Serial Port Component 2.2 Type Library' and click 'Next':
Serial Port For Lazarus 2017
(Click on the picture to enlarge)
In the 'Components' page, leave all fields default and click 'Next':
(Click on the picture to enlarge)
In the 'Install' page, select 'Create Unit' and click 'Next':
(Click on the picture to enlarge)
The interface code is generated now and is shown in the AXSERIAL_TLB tab of the project.
Step 4: Declare and create the object
Serial Port For Lazarus Island
From the Project Manager, open Unit1.bas and add the AXSERIAL_TLB to the 'Uses' statement to refer to the ActiveXperts Serial Port Component library:
(Click on the picture to enlarge)
In the 'private' or 'public' section, declare the following objects:
You can now create the objects, for instance in the 'FormCreate' function:
Step 5: Send an AT command to a connected Hayes compatible modem
You can now send and/or receive data to and/or from a serial port.
The following code shows how to query a modem:
Com Port Lazarus
There are many working samples included with the product. You can also find them on the ActiveXperts FTP site: ftp.activexperts-lab.com/samples/serial-port-component.