Skip to main content

Python Package for Santec IL and PDL Swept Test System

Project description

santec

PySantec

Python wrapper for Santec Insertion Loss and Polarization Dependent Loss Swept Test System.

Python Versions License

[!NOTE] ⚠️ PySantec is currently under active development. Features and APIs may change without prior notice.


Overview

PySantec provides a high-level Python interface for controlling Santec instruments and NI DAQ devices, enabling automated optical measurements with ease. It simplifies:

  • Communication with TSL (Tunable Semiconductor Laser)
  • Management of MPM (Multi-Port Optical Power Meter)
  • Integration with NI DAQ devices
  • Execution of IL (Insertion Loss) and PDL (Polarization Dependent Loss) test routines

Installation

Install via pip:

pip install pysantec

You must also install pythonnet (used to interface with Santec DLLs):

pip install pythonnet

Platform & Requirements

  • OS: Windows 10+
  • Python: 3.10+
  • Santec DLLs: Installed via Santec Swept Test System (IL/PDL) software.
  • Download the latest version of the STS IL/PDL software here.
  • .NET: Framework 4.5.2+ (as required by Santec DLLs)

⚠️ PySantec relies on Santec’s .NET Framework DLLs and therefore does not support Linux or macOS.
Importing the package on non‑Windows platforms raises an error.

Other Dependencies

  • pythonnet (clr) — required for loading Santec DLLs
  • NI-488.2 for GPIB devices
  • NI-VISA for GPIB communication
  • NI-DAQmx for DAQ devices
  • Optional: NI-MAX for configuring/test-running connected devices

⚡ Quick Start

from pysantec import InstrumentManager

# Initialize instrument manager
manager = InstrumentManager()

# List available resources
resources = manager.list_resources()
print(resources)

# Connect to instruments
tsl = manager.connect_tsl('GPIB1::3::INSTR')        # Replace with your TSL GPIB address
mpm = manager.connect_mpm('GPIB1::17::INSTR')       # Replace with your MPM GPIB address
daq = manager.connect_daq('Dev1')       # Replace with your DAQ device name

# Basic laser operation
tsl.set_wavelength(1550.0)
tsl.set_power(2.0)

# Basic MPM operation
mpm.set_wavelength(1550.0)

# Basic DAQ operation
print(daq.is_sampling)

📁 Project Structure

pysantec/
├── drivers/                        # DLL management
│   └── dll_manager.py
│
├── instruments/                    # High-level instrument control
│   ├── instrument_manager.py
│   ├── base_instrument.py
│   ├── tsl_instrument.py
│   ├── mpm_instrument.py
│   ├── daq_instrument.py
│   └── wrapper/
│       ├── enumerations/
│       │   ├── connection_enums.py
│       │   ├── tsl_enums.py
│       │   └── mpm_enums.py
│       ├── exceptions.py
│       ├── santec_wrapper.py
│       ├── santec_communication_wrapper.py
│       └── instrument_wrapper.py
│
└── measurements/                    # Santec measurements
    └── single_measurement_operation.py     # SME mode operation

Examples

Example scripts are available in the examples/ directory:

🔹 Basic Usage

  • examples/basic_usage/list_resources.py
  • examples/basic_usage/connect_instruments.py
  • examples/basic_usage/tcpip_connect.py

🔹 Instrument Control

  • examples/instrument_control/tsl_control.py
  • examples/instrument_control/mpm_control.py
  • examples/instrument_control/daq_control.py

🔹 Instrument Logging

  • examples/instrument_logging/print_tsl_wavelength_logging_data.py
  • examples/instrument_logging/print_tsl_power_logging_data.py
  • examples/instrument_logging/print_mpm_channel_logging_data.py
  • examples/instrument_logging/print_mpm_module_logging_data.py

🔹 SME Operation

  • examples/sme_operation/sme_operation.py

For more information, read Examples.


Supported Instruments

Instrument Type Models
TSL (Laser) TSL-550, TSL-570, TSL-710, TSL-770
MPM (Power Meter) MPM-210, MPM-210H, MPM-220
DAQ (NI) Compatible with NI-DAQmx

Testing

To run the test suite:

pytest tests/

🤝 Contributing

We welcome contributions! To contribute:

  • Fork the repository
  • Create a feature branch
  • Commit your changes
  • Push to your fork
  • Create a Pull Request

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments

  • National Instruments – for NI-VISA, NI-488.2 and NI-DAQmx support

Documentation is under development — contributions are welcome!

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

pysantec-0.2.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

pysantec-0.2.0-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysantec-0.2.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pysantec-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b1a6ded7a7ab8c9e3dad9f34b3dd82df6cd86c00190eae982d1b916f42c41235
MD5 fc4264dac232e07dc930cec52fe32cb6
BLAKE2b-256 ec8945c4197e5b8f5e51d409c9ce287402388fca246f2f9beeb25eeff2794f31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysantec-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pysantec-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 073241daaf3ddb7e0abed5c3ad87dc38d16f2271da28401329a3bf189cb2d69e
MD5 b7bc93384e065a6cc31351f229ce6ef5
BLAKE2b-256 5e4606c05490c195e68f365dfc6b735919c69c192ef3f0c1c8c462e03e437939

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