This section walks you through creating a complete device module for PLESTY. You'll learn how to scaffold a new device, implement the base class, define schemas, set up a TCP server, and pass the device API pipeline (gate d1).
What is a device module?
A device module is a Python package that provides a hardware interface for a specific lab instrument. It communicates with the hardware over TCP/IP using ZeroMQ and exposes a standard API that experiments can use.
Sections
| Page | Description |
|---|---|
| Scaffold | Generate the module skeleton with plesty init device |
| Base Class | Implement BaseDeviceSyncModel mandatory methods |
| Schemas | Define parameter and operation schemas |
| Implementation | Write the actual device logic |
| TCP Server | Serve the device over the network |
| Gate d1 | Pass the device API pipeline |
The device lifecycle
- Scaffold — generate the module structure
- Implement — write the device class with schemas
- Test — run the mock pipeline (gate d1)
- Serve — expose over TCP
- Publish — pass all quality gates and release
Reference device
For a complete example, see the Thorlabs device module at repos/hub/devices/thorlabs/. This is the canonical reference that follows all current PLESTY standards.
Next steps
Start by scaffolding your device.