Serial Port Component For Lazarus Log

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. Can communicate with any device connected to the serial port using RS232 protocol. It uses multithreading and overlapping for maximum performance. Source code included in the registered version. It’s part of Communication Protocol Suite. Available for Delphi/C Builder 5 – 10.4 and Lazarus 2.0.10. Serial Port Component For Lazarus. Projects using Lazarus/de. 5dpo Component Library is a set of components developed by the 5dpo Robotic Soccer Team.

Deutsch (de)English (en)español (es)suomi (fi)français (fr)magyar (hu)Bahasa Indonesia (id)italiano (it)日本語 (ja)한국어 (ko)português (pt)русский (ru)slovenčina (sk)中文(中国大陆)‎ (zh_CN)中文(台灣)‎ (zh_TW)

  • 1Lazarus-CCR Released Components

Lazarus-CCR Released Components

Multimedia

  • ACS - Audio Component Suite, eine Sammlung von Komponenten zur Entwicklung von Anwendungen zum Abspielen, Aufnehmen und Bearbeiten von Audios. Wiedergabe von wav,ogg,mp3,mp2,wma ... Aufnahme von jeder verfügbaren Audioquelle, das alles simultan, Ripping und mehr. Siehe (ACS)
  • Bluetooth - Zugriff auf Blueetooth-Geräte. Zum Beispiel das Wiimote.

Graphik

  • Graphics libraries - eine tabellarische Übersicht der wichtigsten Grafikbibliotheken für die Programmentwicklung (in Englisch).

2D-Darstellung

  • ZenGL - eine cross-platform Bibliothek zur Spieleentwicklung mittels OpenGL.
  • BGRABitmap - Zeichnen von Formen und Bitmaps mit Transparenz, direkter Zugriff auf Pixels, etc.
  • LazRGBGraphics - Paket zur schnellen Bildverarbeitung und Pixelmanipulation (ähnlich Scan line)
  • fpvectorial - bietet Unterstützung beim Lesen, Modifizieren und Schreiben von Vektorbildern.
  • Double Gradient - Zeichnen von Bitmaps mit doppelten und mehrfachen Gradienten (=Farbverläufen).
  • Gradient Filler - TGradientFiller ist der beste Weg, um in Lazarus benutzerdefinierte, mehrfache Gradienten zu erzeugen.
  • PascalMagick - eine einfach einzusetzende API als Schnittstelle zu ImageMagick, einer freien Multiplattform-Software-Suite zum Erzeugen, Bearbeiten und Zusammensetzen von Bitmapbildern.
  • Sample Graphics - eine Galerie von Grafiken, die mit Lazarus erzeugt wurden
  • Fast direct pixel access - ein Geschwindigkeitsvergleich einiger Methoden des direkten Zugriffs auf die Pixel einer Bitmap
  • SMNetGradient - Eine Komponente, mit der sich Farbverläufe realisieren lassen.
  • TMetafile/TMetafileCanvas - EnhMetafile-API-Implementierung für Windows.

3D-Darstellung

Serial Port Component For Lazarus Log
  • GLScene - Eine Portierung der OpenGL-Graphikbibliothek GLScene
  • TOpenGLBox - Eine OpenGL-Komponente für Lazarus, die 'OpenGL rendering' unterstützt.

Diagramme

  • TAChart - Eine Komponente zum Erstellen von Graphen und Diagrammen. ( Bei Lazarus dabei )
  • PlotPanel - Eine Komponente zum Erstellen von (animierten) Graphen/Diagrammen.
  • Perlin Noise - ein Artikel über die Verwendung von Perlin Noise in LCL-Anwendungen.
Port

Tools/ Werkzeuge

  • FpSystools - Umsetzung von TurboPower's Systools als Kylix package für Lazarus/FPC
  • DCPcrypt - DCPcrypt Bibliothek zur Verschlüsselung
  • RXfpc - Einige der weithin bekannten RXlib Komponenten, konvertiert für Lazarus
  • MultiLog - Ein Log-System, entworfen für FPC-Lazarus
  • OnGuard - Eine Portierung von Turbo Power OnGuard
  • UniqueInstance - Eine Komponente, die nur eine Instanz eines Programms starten lässt
  • XDev Toolkit - Plattformübergreifende Programmierwerkzeuge.
  • MouseAndKeyInput - Tool for cross-platform manipulation with mouse and key input.
  • PascalSane - bindings for the libsane scanner API, with demo application.
  • log4delphi - A Log system based on log4j
  • fppkggui - A simple frontend gui for fppkg
  • SymScan - Barcode Scanner interface for Symbol/Motorola MC series handhelds.
  • Theodp - UTF-8 Tools
  • Delphi form to HTML converter - Delphi Form to HTML Converter - new by PEW
  • InstantFPC - run pascal programs as normal unix scripts

Archivierung

  • Zlibar - Erweiterung, um ein mit 'zlib' komprimiertes Archiv aus vielen Dateien zu erzeugen oder zu entpacken.
  • FreePascalArchivePackage - Umsetzung von TurboPower Software's Abbrevia Bibliothek für den Free Pascal Compiler
  • ZipFile - Komponente, die eine Zip-Datei kapselt, gewährt Lese- und Schreibzugriff wie bei einem Dateisystem.
  • libtar - Klassen für .TAR Archive von Stefan Heymann, der sie freundlicherweise neu lizenziert hat, so dass sie nun in FreePascal 2.1.1 und späteren Versionen enthalten ist. Kann mit 'zstream' kombiniert werden, um .tar.gz-Dateien zu erzeugen.
  • bzip2lib - Stream Klassen für bzip2 Komprimierung und Dekomprimierung.

Editoren und Betrachter (Viewer)

  • PowerPDF - Portierung der PowerPDF (visuell) Komponente für Lazarus
  • RichView - Portierung der TRichView Freeware Edition Komponente für Lazarus
  • Fshcomp - Zum Bearbeiten von Komponenten.
  • SynEdit - Quelleneditor für Komponenten (von der IDE genutzt)
  • RichMemo - A cross-platform component designed as rich text editor and viewer.

Netzwerk

  • BeepFp - BEEP Protocol framework
  • Sockets - TCP/IP Sockets Komponenten
  • Hprose - Hprose IST eine leistungsstarke remote Objekt - Motor.Das ist eine schnelle serialisierung und RPC - Bibliothek für die FreePascal.
  • lNet - Netzwerkkomponenten für einfaches single-threaded ereignisgesteuertes Netzwerken; Suite mit Protokollen von TCP und UDP bis zu SMTP und HTTP. lNet wurde entworfen ohne Abhängigkeiten von externen Bibliotheken und ist extrem portabel.
  • FPC und Apache Module - Header-Dateien um Apache Module mit fpc zu erzeugen
  • Web Services Toolkit - Web Services erstellen und anbieten

Datenbanken

  • fb embedded2 Laz - Using embedded FireBird 3 with Lazarus
  • TPSQL - Komponenten für Verbindungen zu PostgreSQL Datenbankservern
  • tiOPF - TechInsite Object Persistent Framework (Ver. 2)
  • TParadoxDataSet - Eine TDataSet-Implementierung, mit der Paradox-Dateien bis Version 7 gelesen werden können.
  • ZeosDBO - Komponente für Verbindungen zu verschiedenen Datenbanken (Firebird, PostgreSQL, MySQL, Oracle)
  • SQLitePass - Komponenten für Verbindungen zu SQLite Datenbanken
  • MS Access - Procedure using TODBCConnection with FILEDSN

Dateiformate

  • CsvDocument - CSV-Dateihandling mittels Parser oder zellen-basierter API ähnlich zu der der StringGrid Komponente.

Container

  • StringHashMap - String -> Pointer associative map container. Fast and memory efficient.

System

  • EpikTimer - Eine Komponente für präzise Zeitmessung - speziell für Lazarus geschrieben
  • Manager Worker Threads System - Manager Worker Thread system to process simultaneous data objects in real-time.
  • TrayIcon - Eine plattformunabhängige System-Tray Komponente
  • TPopupNotifier - Wie benutzt man TPopupNotifier um 'balloon help' anzuzeigen.
  • MultiDoc - Eine Komponente, mit der sich Pseudo-MDI-Anwendungen mit Lazarus schreiben lassen.
  • MDButtonsBar - ButtonsBar-to-MultiDoc Komponente.
  • MPICH - Bindings for the MPI - Message Passing Interface. Distributed computing.
  • Bluetooth - Accessing Bluetooth devices.

Visuelle Komponenten

  • VirtualTreeview - Eine Lazarus-Portierung des schnellen virtual treeview von SoftGems
  • Turbopower Visual PlanIt - A port of the Planner Components
  • RingChart and AnalogWatch - Noch ein Elliptical Chart und eine analoge Uhr für Lazarus und FPC
  • ColorBox - Farbauswahl mit Vorschau
  • Spook's Panel Components - Eine Auswahl von 'panel'-Komponenten
  • HistoryFiles - A component for store the recent files list into an .ini file and show the result into a menu.
  • ColorPalette - A color palette grid with ability to use custom palette.
  • OrphPort - Subset of TurboPower's Orpheus controls.
  • TSubForm - A
  • FileMenuHandler - Handles Recent files list and Open, Save, Save As, Exit Commands.
  • THtmlPort - Lazarus port of Dave Baldwin's HTML Components (THtmlViewer, TFrameViewer, TFrameBrowser).
  • GeckoPort - Lazarus port of Takanori Ito's Gecko SDK for Delphi, including TGeckoBrowser.
  • ZVDateTimeControls Package - This package contains TZVDateTimePicker (the clone of Delphi's TDateTimePicker) and TDBZVDatePicker (a data aware version of TZVDateTimePicker).

Lazarus IDE Erweiterungen

  • Manual Docker - The extension allows Messages window to dock to the source editor.

Hardware-Zugriff

  • NIDAQmxBase - Unit for using National Instruments data acquisition devices through the NI DAQmx Base library (not the bigger NI DAQmx library).

Packages für FPC/Lazarus (externe Links)

  • 2007, Brain Patchwork DX, LLC. has ported their TCP/UDP Client and Server Components to Lazarus 0.9.22/FPC 2.0.4 - visual and non-visual implementation are supported (www.bpdx.com)
  • Starting with version 32, Lucas Gebauer's outstanding Synapse TCP/IP library is now compatible with Free Pascal and Lazarus. Lucas has also just released version 12 of his Synaser serial port communications suite that also runs under Free Pascal.
  • Indy
    • Original (now dormant) effort: Indy for Lazarus project 119 components Indy for FPC/Lazarus.
    • Newer attempt Indy with Lazarus (Both Indy9 and Indy10)
  • Castle Game Engine, a 3D game engine especially focused on VRML/X3D formats.
  • CUPS for Lazarus project Common UNIX Printing System for FPC/Lazarus.
  • Diagram eine Unit, die ein Diagram mit einem Model/Viewsystem anzeigt
  • DrawObjectsExtended a graphical component ported from Delphi to draw structured diagrams.
  • ExcelInterfaces, a component to interface FPC and Lazarus programs with the Excel spreadsheet tool. It also demonstrates the use of COM interfaces on the Windows platform
  • FIBL FreeIBComponents package porting for Lazarus.
  • ICU4PAS is an Object Pascal, cross platform, Direct Class Wrapper over the ICU libraries.
  • Internet Tools mit denen Internetseiten abgerufen und ausgewertet werden können. Sie enthalten: Einen html/xml-Parser mit SAX/DOM-ähnlichem Interface, einen XPath 2 Interpreter, einen CSS 3 Selektorparser, einen HTTP/S-Wrapper um Wininet+Synapse und eine Autoupdateklasse.
  • FreeImage is an Open Source library project which supports popular graphics image formats like PNG, BMP, JPEG, TIFF and others (works with Windows, Linux and Mac OS X). PicViewer is a Example Application (Windows only) and shows basic usage of this DLL.
  • mpg123.dll is a MPEG 1.0/2.0/2.5 decoder DLL for layers 1,2 and 3. The MPEG 1.0 layer 3 aka MP3 is most commonly tested. The Library itself is available for Linux, MacOSX, FreeBSD, SunOS4.1.3, Solaris 2.5, HPUX 9.x, SGI Irix and Cygwin or plain MS Windows. Cross-platform compatible source code should be possible in LAZARUS as soon as the wrapper file for portaudio.DLL is tested by Linux and Mac owners. The linked example code contains two wrapper files, tested under Windows 32bit only.
  • OptiVec ist eine Hochleistungs-Bibliothek von Vektor- und Matrix-Routinen: Lineare Algebra, FFT, Signalverarbeitung, Kurvenanpassung, Statistik, Analysis, vektorisierte Math-Funktionen etc. (nur Win64).
  • PascalSCADA is a set of components to make easy the development of HMI/SCADA applications (applications that needs interact with PLC's and others industrial devices).
  • PortAudio project is a portable cross-platform Audio API currently available for Windows, Macintosh OS X, Unix (OSS/ALSA), SGI, and BeOS. It allows cross-platform compatible source code also in LAZARUS. The Portaudio package contains the wrapper file that makes the C Library available and also example applications showing how to use the PortAudio DLL under Lazarus LCL / Windows. The wrapper file for portaudio.DLL is from the UltraStar Sourceforge project.
  • RackCtls a collection of components with an 'Hi-fi system' appearance.
  • Runge-Kutta a scientific component to integrate partial differential equations, using events.
  • TTreeListView ist eine Kombination von TTreeView und TListView, die Baumelemente mit zusätzlichen Spalteneinträgen zeigt
  • UltraStar Deluxe has headers for the following libraries for Windows, Linux and Mac OS X (with a few exceptions):
    • portaudio
    • bass
    • ffmpeg
    • SDL
    • libpng
    • FreeImage
    • freetype
    • JEDI-SDL
    • Lua
    • midi
    • pcre
    • portmixer
    • projectM
    • samplerate
    • SQLite
    • zlib
    • fft
  • lazarus-zlib - library, contains simple functions for work with zlib-archives (it uses the original zlib source, compiled in obj-files).

Beispielprogramme

Serial Port Component For Lazarus Log
  • SysRec - Video Capturing and Recording application, you can download it here.
  • Sudoku - EIn Programm, das Sudoku-Rätsel löst.
  • Libview - Views all exported function names of a given library.
  • Contacts Database - Eine erweiterte Version des Adressbuch-Beispiels mit Reports.
  • OpenGL Tutorial - Beispiel-Code des OpenGL-Tutorials
  • Robot - The Game/de - Einfaches Beispielprogramm für Einsteiger
  • Kaldemonia - Google Searcher shows simple threading, using Synapse networking library.
  • TSqlite3 Master Detail Example - Working Master Detail Example using 3 small tables and sqlite components.
  • JCSV (Jans CSV Components) - Working Example of TJansCSV Component Set
  • How To Use Interfaces - Working Example of Interfaces and generics.
  • LRS_Explorer - A little software to add some pictures, music, etc.. into a Lazarus resource (lrs) file.
  • Creating LCL Control From Libraries - Shows you how to create and manage LCL UI controls in an application from plug-ins (dll/so/dynlib).

RTL, FLC und LCL Anwendungsbeispiele

  • Manager Worker Threads System - An example of how to design a Manager Worker Thread Application.
  • Dialog Examples/de - nützliche Dialoge, die nicht in der Komponentenpalette zu finden sind
  • Howto Use TOpenDialog/de - Wie man den Dialog 'FileOpen' benutzt
  • Howto Use TSaveDialog/de - Wie man den Dialog 'FileSave' benutzt

Siehe auch

Retrieved from 'https://wiki.freepascal.org/index.php?title=Components_and_Code_examples/de&oldid=138450'

Deutsch (de)English (en)español (es)

This article applies to Arduino boards only.

See also: Multiplatform Programming Guide

Many Arduino projects have the need to send data to a PC running a program for data aquisition and visualisation. Lazarus is highly suitable for developing such programs, i.e. to build the PC-sided counterpart of an Arduino project.

For Lazarus developers Arduino opens a whole new world of smart physical sensors and actuators for monitoring, control and data acquisition.

The fpc compiler is even capable to compile programs for Arduino boards itself.


  • 2Communication between a Lazarus application and Arduino
    • 2.1One-way serial communication example using Synaser
      • 2.1.1Lazarus side serial application
      • 2.1.2Arduino side serial application
    • 2.2Bidirectional serial communication example using SDPO
    • 2.3Ethernet communication

Currently (2017) most Arduino boards carry microcontrollers of the AVR family (Atmega). An other popular arduino board carries a STM32 (ARM Cortex). For both microcontroller families there are fpc compilers available. Programming Arduino with FPC of course doesn't mean to use the arduino ecosystem with just a different language. Nevertheless arduino libs (C++) can be used in fpc programms, but mixing languages obviously is an advanced topic.While compilation the fpc creates a .hex-file (binary), this can be loaded to the microcontroller, arduino board respectively, using a programming software by choice. AVRDude e.g. also supports program upload using the Arduino bootloader.

There are further wiki pages for programing AVR microcontrollers:AVR, AVR Programming

There is also a tutorial on how to use Lazarus on a AtMega328p (Arduino Uno/Nano) in German language:AVR Embedded Tutorial/de


The following section describes how your Lazarus/FPC application can communicate with Arduino boards, no matter whether fpc or arduino is running on the arduino board.

One-way serial communication example using Synaser

Here we show how to communicate with your board through serial communication channel.

Lazarus side serial application

There are many ways for serial communication in Lazarus and FPC.

Minimal Lazarus Synaser serial example

We will use Synaser from Synapse library in this example. Create Lazarus application with one form and two buttons. Include Synaser unit and add Synapse package as a new requirement to your project (you do this in Project Inspector). In OnClick event of both buttons put something like this:

Arduino side serial application

You can program your Arduino in several languages.

Minimal Arduino C sketch serial example

You can follow this nice step by step tutorial. In short, you need to add a led with proper resistor to your input pin 13, compile this sketch in your Arduino IDE, and download it to your board:

Minimal Arduino mikroPascal serial example

mikroPascal for AVR can be used to develop Arduino programs. TBD.

Minimal Arduino E-Lab AvrCo serial example

E-Lab AvrCo Multitasking Pascal can be used to develop Arduino programs. TBD.

Minimal Arduino FPC serial example

Yes, your Arduino 8-bit AVR board can be programmed with FPC too. TBD.

Bidirectional serial communication example using SDPO

The single directional example is based on synaser, which is not a visual component. SDPO provides a visual wrapper around Synaser, and some people may find this method easier. The following example requires the SDPO package (currently 0.4.0) to be installed in Lazarus. There are other tutorials to show you how to install package. If you cannot find the SDPO component on your component palette, this example will not work.

Lazarus Side of Bidirectional SDPO serial example

Open a new project, and add the following to a form: (Names are the default names)

  1. the SDPO port (under the SDPO tab after you have installed it).
  2. four buttons. Caption as follows: Button1 SEND; Button2 CLEAR; Button3 UP; Button4 DOWN;
  3. a memo. Used to display what is sent and received.
  4. a panel. Used to display which number is being sent.

Configure the Sdposerial1 properties to match the Arduino with the object inspector.

  • Baudrate = br__9600;
  • Device = YourSerialPort ( mine is /dev/ttyUSB0 ). This is probably the same port you use to program your Arduino.
  • FlowControl = fcNone;
  • Parity = pNone;
  • StopBits = sbOne;
  • SynSer = (TBlockSerial); (notice this from the previous example?)
  • Tag = 0;

Using the code window, find the spot under var where it defines Form1: Tform; , and add the next three variables:

Add the following events (code is shown below)

  • OnCreate for Form1
  • OnDestroy for Form1
  • OnRxData for Sdposerial1
  • OnClick for each button (4 events)

In the empty code blocks for each event, add the following code.

Test the program, and verify that it compiles.

Arduino side of Bidirectional serial example application

The following code has been tested on a Arduino Mega 2560 clone board. Feel free to alter it as you see fit. It is provided as one block to avoid adding your own strings.

Compile and upload this code to your board. You should be able to test the program by opening the Serial Monitor in Arduino, and sending a number from 0 to 32 to the Arduino. It should respond by 'insulting' you with the appropriate numbered insult. No error checking is provided, so keep your requests in range.

Connecting the Two Sides

Serial Ports cannot be opened by more than one program at a time - particularly when a program grabs the port and hogs it like this simple example does. Make sure you close the Arduino Serial Monitor before attempting to run the Lazarus program. Your Arduino should be plugged in and powered up. If you are working under Linux, you may need to run the program as a superuser, or you may need to add your user to the dialout group. In any case, once the Arduino is up and running, you can run the program. It must be able to connect with the Arduino when it creates the main window, and it will hog the port until you properly close the application. Depending on your computer, sleeping or hibernating may mess up your communications.

Ethernet communication

Here we show how to communicate with your board through ethernet communication channel.

Lazarus Log Home Plans

Lazarus side ethernet application

Lazarus Log Home

TBD

Arduino side ethernet application

TBD

Wiki Resources

External Resources

Lazarus Program

Retrieved from 'https://wiki.lazarus.freepascal.org/index.php?title=Arduino&oldid=145037'