An advanced Pick-to-Light (PTL) system implementation using IEC 61131-3 structured text programming with MQTT integration for industrial automation applications.
- Real-time control of 4 PTL stations with color-coded feedback
- MQTT-based communication for distributed system integration
- Automated error detection and recovery system
- Color-coded visual feedback system:
- Green: Active pick location
- Red: Error indication (wrong pick)
- Timer-based state management
- Comprehensive debug monitoring
- Industrial I/O interface integration
- CODESYS Development System V3.5 or later
- CODESYS MQTT Library
- Network connectivity for MQTT communication
-
PLC/Controller compatible with CODESYS Runtime (TBEN-S2-2COM-4DXP Controller from Turck)
-
4 PTL110S-FF100TD3-QPS150 devices from Bannerengineering.
-
PLC supporting IEC 61131-3 Structured Text
-
MQTT Broker (tested with broker running at port 1883)
-
Digital I/O capabilities for PTL hardware interface
-
Network connectivity for MQTT communication
- Install CODESYS Development System
- Install MQTT Library:
- Download the library from CODESYS-MQTT Repository
- In CODESYS, go to Tools → Library Repository
- Install the downloaded library
- Add library reference to your project
├── src/
│ ├── PLC_PRG.st # Main program file
│ ├── FirstPublish.st # MQTT publishing function block
│ └── FirstSubscription.st # MQTT subscription function block
├── docs/
│ └── hardware_setup.md # Hardware configuration guide
└── README.md
- Publish:
Test/PTL_touch
- Reports touch events - Subscribe:
Test/PTL_1
- Receives control commands
- Simple integer-based protocol
- Values 1-4 correspond to PTL stations
- 0: Off
- 1: Red (Error)
- 2: Green (Active)
- Real-time touch detection
- Automatic error state recovery (1-second timeout)
- Persistent state tracking
- MQTT state synchronization
- Clone this repository
- Configure your PLC development environment
- Set up MQTT broker (default: broker.emqx.io:1883)
- Upload the program to your PLC
- Configure I/O mapping according to your hardware setup
Update the following parameters in PLC_PRG.st
:
URL := 'broker.emqx.io:1883' // MQTT broker address
Topic := ADR('Test/PTL_touch') // MQTT publish topic
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support, please open an issue or contact the maintainers:
- Email: [email protected]
- LinkedIn: armanruet
Made with ❤️ by Arman