Skip to main content

Unofficial Python wrapper for the TYCMA ICON Interface HTTP TCPIP API for laser marking systems.

Project description

pyiconlaser

PyPI Python License

Unofficial Python wrapper for the TYKMA ICON Interface HTTP/TCP API used by industrial laser marking systems.

This library provides a simple Python API for controlling compatible laser marking systems through the ICON Interface software.

This project is community-maintained and is not affiliated with or endorsed by any hardware manufacturer.

This library was developed and tested against TYKMA ICON Interface software based on available API documentation and observed real-world behavior.


Features

  • Load marking jobs
  • Read available IDs and modify their values
  • Start and stop marking sequences
  • Enable or clear jobs
  • Control limits (tracing beam)
  • Retrieve machine status
  • Get template preview images

Requirements

This library requires the vendor software TYKMA ICON Interface to be installed and running on the target machine.

The HTTP/TCP API must also be enabled manually in the Config.xml configuration file.

Before using this library:

  • Install TYKMA ICON Interface software
    • Vendor contact may be required to obtain the software and API documentation
  • Enable HTTP/TCP communication in Config.xml
  • Verify the API is accessible (default port 5287)
  • Ensure the laser system is connected and recognized by ICON Interface

Installation

pip install pyiconlaser

Or install locally:

pip install .

Quick Start

from pyiconlaser import IconLaserClient

laser = IconLaserClient()

laser.prepare_job("test_job")

laser.set_id("SN", "123456")
laser.set_id("QR", "PRODUCT001")

laser.enable_job()
laser.start()

laser.clear_job()

Important Note

ICON Interface has undocumented behavior.

After loading a job:

laser.load_job("test_job")

the software automatically enables limits mode internally.

This causes:

all_ids -> empty response
set_id -> id_not_found

To fix this, limits must be disabled before modifying IDs:

laser.load_job("test_job")
laser.limits_off()

For convenience:

laser.prepare_job("test_job")

does both automatically.


python sdk laser industrial-automation automation hardware http-api wrapper

Basic Example

from pyiconlaser import IconLaserClient

laser = IconLaserClient()

print(laser.version())
print(laser.job_status())
print(laser.all_ids())

Supported API Methods

version()
job_status()
loaded_job()
state()

load_job()
prepare_job()
clear_job()
enable_job()

all_ids()
set_id()

start()
stop()

limits_on()
limits_off()

get_preview()

Tested Environment

  • Python 3.14.4
  • TYKMA ICON Interface 1.0.12.6 on Windows 11

Testing

Unit tests run without any hardware:

pytest

Integration tests communicate with a real laser running ICON Interface and are skipped by default. Enable them with the --run-integration flag:

pytest --run-integration

Configuration

The target hardware is configured through environment variables. You can set them in two ways:

Option 1: Using a .env file (recommended)

Copy .env.example to .env and update with your hardware details:

cp .env.example .env

Then edit .env and set your values:

ICON_LASER_HOST=192.168.0.10
ICON_LASER_PORT=5287
ICON_LASER_TIMEOUT=5
ICON_LASER_JOB=test_job
ICON_LASER_ID_NAME=SN
ICON_LASER_ID_VALUE=TEST123

The .env file is automatically loaded during testing and is not committed to git.

Option 2: Setting inline with the command

ICON_LASER_HOST=192.168.0.10 ICON_LASER_JOB=test_job pytest --run-integration

Environment Variables Reference

Variable Description Default
ICON_LASER_HOST ICON Interface host localhost
ICON_LASER_PORT ICON Interface port 5287
ICON_LASER_TIMEOUT Request timeout (seconds) 5
ICON_LASER_JOB Marking job to run (required)
ICON_LASER_ID_NAME ID field to set SN
ICON_LASER_ID_VALUE ID value to set TEST123

Integration tests will physically operate the laser. Only run them on a system that is safe to mark.


License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyiconlaser-0.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyiconlaser-0.2.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pyiconlaser-0.2.0.tar.gz.

File metadata

  • Download URL: pyiconlaser-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pyiconlaser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 258204cc3e94efff87c6c807347f3f625549f0e4354260f118be1c973a53b3f5
MD5 b5089d4bd2daae2e470601d3de11ff42
BLAKE2b-256 796e6d9c86fd4cad463b8205dca8ab18bf39304ca1704c32d478d4673d106642

See more details on using hashes here.

File details

Details for the file pyiconlaser-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyiconlaser-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pyiconlaser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21a8f46b37c699adc87dd0d80b62ad066e8dcd59dcdcb1202a8f243071b2a665
MD5 2cbac1f0eadceec69a52cee2546b2153
BLAKE2b-256 0d6abcfb9e79969899a751b51dd75229f319305772a661b7120a67f649d6e2fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page