Author Topic: Lib for working with weighing devices (serial ports)  (Read 116 times)

Renat.Su

  • Sr. Member
  • ****
  • Posts: 269
    • Renat.Su
Lib for working with weighing devices (serial ports)
« on: September 01, 2026, 12:04:56 pm »
https://github.com/Al-Muhandis/TensoMLib
Library in Free Pascal / Lazarus for working with weighing devices (RS-232 / RS-485).
Features
  • Low-level codec of device protocol frames (encoding of speed, length, CRC-8, byte-staffing FF→FF FE)
  • Hierarchy of exceptions by error semantics (transport, timeout, CRC, frame, device, protocol)
  • Modular transport layer: ITensoMTransport interface, IOC TMockTransport for testing, TSerialTransport implementation for COM port (LazSynaSer+ WinAPI DCB fallback for non-standard USB-COM drivers)
  • A high-level TTensoMDevice client with automatic retries, configurable replay policy, frame logging, and automatic CRC mode detection
  • Full set of protocol commands: weight, calibration, configuration, serial number, digital inputs/outputs, indicators, counters, calibration, dosing, initiative transmission
  • Scan functions for available COM ports (Windows: QueryDosDeviceA, Linux: /dev/ttyS*, /dev/ttyUSB*, /dev/ttyACM*)
  • Unit tests via FPCUnit (CRC, BCD, frames, transport, client — including retries, logging, exception hierarchy)
  • Integration test utility with XML report
  • Lazarus Runtime Package (tensom_rt.lpk)
  • Extensible Architecture
Dependencies

  • Free Pascal Compiler >= 3.2
  • Lazarus >= 3.0
  • The LazSerial package (LazZerialPort) is only for working with a real COM port. All units except transport_serial are available without it, and tests work via TMockTransport

 

TinyPortal © 2005-2018