Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

118 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PLCAutoPilot

AI-Powered PLC Programming Platform for Industrial Automation

Transform PLC specifications into production-ready ladder logic code in minutes, reducing development time by 80% while maintaining IEC 61508 safety standards.


🎯 Project Overview

PLCAutoPilot combines two powerful components:

  1. Next.js Web Application - Marketing website and AI assistant interface
  2. Python Desktop Automation - Automated PLC programming framework

🌐 Web Application

Modern Next.js application for PLCAutoPilot marketing and future AI assistant.

Tech Stack

  • Next.js 15.5.9
  • React 19.0.0
  • TypeScript 5
  • Tailwind CSS 3.4.1
  • Framer Motion 11.15.0

Quick Start

cd plcautopilot-nextjs
npm install
npm run dev

Open http://localhost:3000

Deployment

Deploy with Vercel


πŸ€– Python PLC Automation

NEW: Fast API-based automation (20-30x faster than PyAutoGUI)

Python automation framework supporting ALL major PLC platforms with two high-performance approaches:

  1. Schneider Python API - Official API wrapper (2-3s vs 60+s)
  2. PLCopen XML Generation - Universal format for Siemens, Rockwell, Mitsubishi, 500+ CODESYS brands

Performance Comparison

Method Time Reliability Platforms
Old (PyAutoGUI) 60-90s 60% Schneider only
New (Python API) 2-3s 99%+ Schneider
New (PLCopen XML) <1s 99%+ ALL (500+)

Features

  • Multi-Platform Support: Schneider, Siemens, Rockwell, Mitsubishi, CODESYS
  • Fast Automation: API-based (not screenshot-based)
  • Ladder Logic Programming: Automated motor start/stop circuits
  • PLCopen XML Export: Universal IEC 61131-3 format
  • Direct PLC Download: USB/Ethernet (Schneider)
  • Comprehensive Testing: 17 automated tests

Requirements

  • Python 3.7+ (no external dependencies for PLCopen XML)
  • Schneider EcoStruxure Machine Expert Basic (for Schneider automation)
  • Target PLC IDE for imports (TIA Portal, Studio 5000, GX Works, etc.)

Installation

No additional dependencies required. Package uses Python standard library only.

Quick Start

1. Schneider Electric (Fastest - Python API):

from plc_automation import PLCAutomation, Platform

automation = PLCAutomation(Platform.SCHNEIDER)
automation.create_project("MotorControl", "TM221CE24T")
automation.add_motor_startstop()
automation.compile_and_download()
# Time: 2-3 seconds

2. Siemens, Rockwell, Mitsubishi (Universal PLCopen XML):

from plc_automation import PLCAutomation, Platform

automation = PLCAutomation(Platform.SIEMENS)  # or ROCKWELL, MITSUBISHI
automation.create_project("MotorControl", "S7-1200")
automation.add_motor_startstop()
automation.export_xml("MotorControl_Siemens.xml")
# Time: <1 second, then import XML into TIA Portal

3. Run Fast Motor Start/Stop:

python program_motor_startstop_fast.py

4. Run Tests:

python plc_automation/tests.py

5. Complete Documentation: See plc_automation/README.md for full API reference


πŸ“š Documentation

File Description
README.md This file - Project overview
plc_automation/README.md Fast automation API reference (NEW)
AUTOMATION_APPROACHES.md Analysis of automation methods
COMPLETE_WORKFLOW_SUMMARY.md Complete automation workflow (546 lines)
MOTOR_STARTSTOP_README.md Motor start/stop program details
WIRING_AND_TESTING_GUIDE.md Hardware installation guide
VISION_AGENT_COMPLETE.md Vision agent summary (legacy)
VISION_AGENT_SETUP.md Vision setup instructions (legacy)
VISION_CAPABILITIES.md Vision features documentation (legacy)

πŸŽ›οΈ Supported Platforms

Schneider Electric (Python API)

  • TM221, TM241, TM251 series (Machine Expert Basic/Control)
  • M241, M251, M258 (Mid-range PLCs)
  • M580, M340 (High-performance PLCs)

Siemens (PLCopen XML)

  • S7-1200, S7-1500, S7-300 series
  • Import via TIA Portal

Rockwell Automation (PLCopen XML)

  • CompactLogix, ControlLogix
  • Import via Studio 5000

Mitsubishi (PLCopen XML)

  • FX5U, iQ-R, Q series
  • Import via GX Works

CODESYS (PLCopen XML)

  • 500+ brands supported
  • Universal IEC 61131-3 format

✨ Key Features

AI Assistant Capabilities

  1. Ladder Logic Expert: Relay logic, timers, counters, industrial patterns
  2. Safety First: Emergency stops, safety interlocks per IEC 61508
  3. Hardware Configuration: Auto-configures I/O modules
  4. HMI Integration: Variable tags for Vijeo Designer, Wonderware, FactoryTalk
  5. Code Review: Highlights safety-critical sections
  6. Documentation: Auto-generates I/O lists and commissioning guides

Desktop Automation Capabilities

  1. Software Launch: Automated opening of EcoStruxure
  2. Project Creation: Create and configure PLC projects
  3. Ladder Programming: Automated ladder logic programming
  4. Compilation: Compile and save projects
  5. PLC Download: Download programs via USB
  6. Vision Support: OCR text reading and image matching

πŸš€ Usage Examples

Fast API Automation (NEW - Recommended)

from plc_automation import PLCAutomation, Platform

# Schneider - 2-3 seconds
automation = PLCAutomation(Platform.SCHNEIDER)
automation.create_project("MyProject", "TM221CE24T")
automation.add_motor_startstop()
automation.compile_and_download()

# Siemens - <1 second
automation = PLCAutomation(Platform.SIEMENS)
automation.create_project("MyProject", "S7-1200")
automation.add_motor_startstop()
automation.export_xml("MyProject.xml")  # Import into TIA Portal

Legacy Desktop Automation (PyAutoGUI)

from desktop_ai_agent import DesktopAIAgent

agent = DesktopAIAgent()
agent.open_software_via_search("EcoStruxure", wait_time=3)
agent.type_text("Hello World!")

πŸ“ Project Structure

plcautopilot.com/
β”œβ”€β”€ Fast PLC Automation (NEW)
β”‚   β”œβ”€β”€ plc_automation/
β”‚   β”‚   β”œβ”€β”€ __init__.py              # Package exports
β”‚   β”‚   β”œβ”€β”€ ecostruxure_api.py       # Schneider API wrapper
β”‚   β”‚   β”œβ”€β”€ plcopen_xml.py           # Universal PLCopen XML
β”‚   β”‚   β”œβ”€β”€ unified_interface.py     # Platform dispatcher
β”‚   β”‚   β”œβ”€β”€ tests.py                 # Test suite (17 tests)
β”‚   β”‚   └── README.md                # Full API documentation
β”‚   β”œβ”€β”€ program_motor_startstop_fast.py  # Fast demo (2-3s)
β”‚   └── AUTOMATION_APPROACHES.md     # Technical analysis
β”‚
β”œβ”€β”€ Legacy Python Scripts (PyAutoGUI)
β”‚   β”œβ”€β”€ desktop_ai_agent.py         # Core automation agent
β”‚   β”œβ”€β”€ vision_agent.py             # Vision-enabled agent
β”‚   β”œβ”€β”€ program_motor_startstop.py  # Motor control (60s)
β”‚   └── auto_download_plc.py        # PLC download
β”‚
β”œβ”€β”€ Documentation
β”‚   β”œβ”€β”€ COMPLETE_WORKFLOW_SUMMARY.md
β”‚   β”œβ”€β”€ MOTOR_STARTSTOP_README.md
β”‚   └── WIRING_AND_TESTING_GUIDE.md
β”‚
β”œβ”€β”€ Next.js Web App
β”‚   └── plcautopilot-nextjs/        # Web application
β”‚
└── Configuration
    β”œβ”€β”€ config.json                  # Software configuration
    └── requirements.txt             # Legacy dependencies

βš™οΈ Configuration

Edit config.json to customize software settings:

{
  "software_list": [
    {
      "name": "EcoStruxure Machine Expert Basic",
      "search_term": "Machine Expert",
      "method": "search"
    }
  ],
  "settings": {
    "default_wait_time": 2,
    "typing_interval": 0.1,
    "failsafe": true
  }
}

πŸ”’ Safety Features

  1. Failsafe Abort: Move mouse to top-left corner (0,0) to stop
  2. Logging: All actions logged for debugging
  3. Safety Standards: IEC 61131-3 and IEC 61508 compliant
  4. Code Review: Mandatory human verification of safety sections

⚠️ Safety Notice

PLCAutoPilot is a code drafting tool designed to accelerate development. All generated code must be reviewed, tested, and validated by certified engineers before deployment to production systems.

Always:

  • Follow local electrical codes
  • Test thoroughly before production
  • Maintain proper documentation
  • Train operators properly

πŸ“Š Statistics

  • Lines of Code: 2,900+ Python automation
  • Fast Automation Package: 1,400+ lines (4 modules)
  • Test Coverage: 17 automated tests (100% pass)
  • Documentation: 150+ pages
  • React Components: 22 TSX files
  • Automation Coverage: Motor start/stop 100% complete
  • Speed Improvement: 20-30x faster (verified 119.6x in tests)
  • Platform Support: Schneider + 500+ brands via PLCopen XML
  • Time Savings: 80% reduction in PLC development

πŸ› οΈ Troubleshooting

Software doesn't open

  • Increase wait_time parameter
  • Verify software is installed
  • Check software name in Windows Search

Vision features not working

PLC download fails

  • Verify USB connection
  • Check PLC is powered ON
  • Ensure PLC is in STOP mode

πŸ“„ License

Copyright Β© 2025 PLCAutoPilot - Dr.M Hope Softwares. All rights reserved.

Disclaimer: Not affiliated with Schneider Electric. EcoStruxure and Modicon are registered trademarks of Schneider Electric SE.


🀝 Support

For issues or questions:


Created by: Dr. Murali BK Publisher: Dr.M Hope Softwares Website: https://plcautopilot.com

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages