DeepSeek Integration with InoProShop: A Complete Tutorial on AI-Generated PLC Code

DeepSeek V4 Flash integrates with InoProShop to auto-generate PLC function blocks from natural language.
This tutorial demonstrates how DeepSeek V4 Flash was integrated with Inovance's InoProShop IDE to create a complete pipeline from natural language requirements to PLC code generation and deployment. The demo showcases AI automatically creating a cylinder jitter function block, writing ST code with comments, replacing manual code in the project, and passing compilation — offering Chinese industrial engineers a practical, domestically-controlled AI programming solution.
When Industrial Programming Meets AI: The DeepSeek + InoProShop Solution
Engineers in the industrial automation field have long been exploring the best ways to combine AI with PLC programming. Since the ChatGPT explosion in 2023, Siemens has launched its Copilot and CODESYS has introduced MCP, but these solutions are either unavailable to Chinese users or come with various usage restrictions.
Siemens' Industrial Copilot, launched in 2024, is built on Microsoft Azure OpenAI services and can assist with PLC code generation within TIA Portal. However, since it relies on Azure cloud services and requires data transmission to overseas servers, users in mainland China face practical barriers regarding access and data compliance. CODESYS MCP (Model Context Protocol) is an AI integration protocol introduced by the CODESYS platform that allows large language models to interact with the CODESYS IDE through standardized interfaces. The MCP protocol was originally proposed by Anthropic to provide AI models with a unified standard for accessing external tools and data sources, but its ecosystem maturity and compatibility with domestic Chinese LLMs are still evolving.
A Bilibili content creator named Afan, while writing his new book SD Programming Guide, successfully established a complete pipeline for AI-generated code that writes directly into InoProShop projects, using DeepSeek V4 Flash — currently DeepSeek's most lightweight model. InoProShop is a PLC integrated development environment developed by Inovance, deeply customized on the CODESYS platform, supporting all five programming languages defined by the IEC 61131-3 standard. Notably, InoProShop's project file structure uses XML format for storage — a characteristic that enables external programs to automate project operations by parsing and modifying XML files, and one of the technical foundations that allows AI to "directly manipulate the IDE."
This solution truly achieves automated generation and deployment from natural language descriptions to PLC project code, providing domestic industrial engineers with a practical AI programming pathway.

Hands-On Demo: Describing Requirements in Natural Language, AI Auto-Generates Function Blocks
Requirement Description: Defining Functional Logic in Everyday Language
In his demonstration, Afan showcased a typical industrial programming scenario. Within a base project, he submitted the following request to the AI assistant in natural language:
Help me create a new function block whose main purpose is to encapsulate a cylinder's jitter action into a function block. The cylinder should allow external configuration of jitter time, including alarm time settings. After creation, please call it in my automatic program and replace the previously hand-written cylinder jitter code with the encapsulated jitter FB block.
This requirement description closely mirrors the everyday working language of engineers — no code writing needed, just a clear explanation of the functional logic and how it should be called.
The Function Block (FB) mentioned here is one of the most important Program Organization Units in the IEC 61131-3 standard. Unlike ordinary functions, FBs have their own instance data and can maintain internal state across multiple calls — this is critical for industrial control logic that needs to remember state (such as cylinder action sequences, timers, and alarm state machines). In real-world projects, encapsulating reusable control logic into FBs is a best practice in industrial programming, as it not only improves code reusability but also makes project maintenance and debugging more efficient.
Cylinder jitter (oscillation) itself is a common actuator motion pattern in industrial automation, referring to rapid reciprocating movement of a cylinder between its extended and retracted positions. This action is widely used in scenarios such as vibratory feeding, assembly alignment, and residue shaking. Key parameters for jitter control include single-step action duration, jitter count, total timeout, and alarm thresholds. Design considerations also include position detection, abnormal interruption handling, and safety interlocking.

AI Execution Process: From Creating FBs to Compilation Verification
After sending the requirements to the AI assistant, DeepSeek V4 Flash automatically performed the following tasks:
- Created the Function Block (FB): Automatically created a new cylinder jitter function block in the InoProShop project
- Wrote ST Code: Complete implementation including time triggers, forward/backward action sequences, and alarm logic
- Generated Chinese Comments: Automatically added comments to the code explaining each section's functionality
- Modified Call Logic: Located the previously hand-written cylinder jitter code in the automatic program and replaced it with the newly encapsulated FB block call
- Compilation Verification: Automatically completed compilation and code integrity verification
Throughout the process, real-time changes to the project structure were visible in the IDE's left panel — the new Jitter function block was automatically added to the project tree.

Analyzing the Results: How Good Is AI-Written PLC Code?
Based on the demo results, the cylinder jitter function block generated by DeepSeek V4 Flash was of quite impressive quality:
- Functionally Complete: Triggered by an execution signal, completing forward/backward action sequences according to specified counts and durations
- Configurable Parameters: Supports external configuration of single-step duration and total duration
- Alarm Mechanism: Includes alarm time settings with automatic alarm triggering on timeout
- Well-Commented: Clear Chinese comments on every key logic section
- Compilation Passed: Final compilation verification passed completely, confirming code integrity

You might not have noticed, but the AI didn't just generate the function block itself — it also completed the call replacement in the automatic program. This means it understood the context of the existing InoProShop project and could make code modifications at the correct locations — far more complex than simple code generation. From a technical implementation perspective, this requires the AI to be capable of parsing project XML file structures and understanding the calling relationships between program organization units, rather than merely generating an isolated code snippet.
Technical Approach: Why DeepSeek V4 Flash?
Afan chose DeepSeek V4 Flash as the underlying LLM for this solution, a choice with several noteworthy considerations.
Practical Advantages of a Lightweight Model
DeepSeek V4 Flash is a lightweight inference model released by DeepSeek in 2025, an efficient version within the DeepSeek V4 series. DeepSeek's MoE (Mixture of Experts) architecture is the key technology enabling its balance of high performance and low cost — while the model has a massive total parameter count, only a small subset of expert networks is activated during each inference, dramatically reducing computational overhead. The Flash version further optimizes inference speed and resource consumption on top of this, offering clear advantages in industrial programming scenarios:
- Faster Response Times: Engineers in industrial settings don't want to wait too long; the Flash version's inference latency is significantly lower than the full version
- Lower Deployment Costs: Potential for local or edge deployment, meeting industrial enterprises' security requirements for keeping data on-premises
- Lower API Call Costs: Flash version call costs are typically a fraction of the full version's, making it more economical for engineering scenarios requiring frequent interaction and iterative debugging
The Practical Significance of Domestic LLM Solutions
Afan explicitly mentioned in his video that solutions like Siemens Copilot and CODESYS MCP have openness or restriction issues for Chinese users. Choosing a domestic LLM like DeepSeek not only solves the availability problem but also provides a self-controlled technology pathway for AI applications in the industrial control sector. In industrial control — a field involving national critical infrastructure — the importance of technological self-reliance is self-evident. PLC programs often contain a company's core process parameters and production logic, and using domestic LLMs effectively avoids compliance risks associated with cross-border transmission of sensitive data.
Industry Reflections: Future Trends in AI + Industrial Programming
While this case is a demonstration, it reveals several important development directions in the industrial programming field:
From "assisting with code writing" to "directly operating the IDE." Traditional AI programming assistants only give you code snippets in a chat window, and engineers still need to manually copy and paste. The DeepSeek-InoProShop solution achieves direct AI modification of project files — a qualitative leap. This model depends on the development of standardized protocols like MCP, and as more industrial IDEs support similar open interfaces in the future, deep integration between AI and development environments will become an industry standard.
The way industry experience is encapsulated is changing. Afan mentioned that when building his Base Project, he encapsulates past industry experience into libraries for readers to use. In the future, this kind of experience encapsulation may no longer require manual effort — engineers will only need to describe requirements in natural language, and AI can automatically generate standardized PLC function blocks based on accumulated industry knowledge. A well-designed FB library is often a core technical asset for automation companies, and AI's involvement could dramatically lower the barrier to building such assets while also raising higher demands for standardization and structuring of industry knowledge.
ST language is naturally suited for AI generation. Compared to graphical programming languages like Ladder Diagram, ST (Structured Text) language's text-based nature makes it much easier for large language models to understand and generate — an important reason why AI is landing faster in the ST programming domain. ST language syntax is heavily influenced by Pascal and C, supporting standard control structures like IF-THEN-ELSE, CASE, FOR, and WHILE. Since LLM training corpora contain massive amounts of programming language text, ST language's syntactic similarity to mainstream programming languages means models can fully leverage transfer learning capabilities. In contrast, Ladder Diagram requires conversion to graphical element coordinates and connection relationships — a type of structured data generation that is far more challenging for current LLMs. It's foreseeable that the proliferation of AI will further drive ST language adoption in the industrial control field.
Conclusion: Feasibility and Prospects of AI-Generated PLC Code
Afan's practice provides a viable reference solution for AI applications in the industrial control field. Although it's still in the early stages and the generation process requires some waiting time, the results — functionally complete, compilation passed, well-commented — already meet the basic requirements for practical engineering applications.
As domestic LLMs like DeepSeek continue to improve in capability, and as training data in the industrial control domain continues to accumulate, the quality and efficiency of AI-generated PLC code will further improve. For industrial engineers, mastering AI-assisted programming tools will become an important skill for boosting productivity. It's worth noting that this trend does not mean industrial engineers will be replaced by AI — quite the opposite. AI-generated code still requires engineers with deep industry experience to review, debug, and optimize, especially in scenarios involving safety interlocking, real-time requirements, and complex process logic, where human engineering judgment remains irreplaceable.
Related articles

Nobel Laureate John Jumper Leaves DeepMind to Join Anthropic
Nobel Chemistry laureate and AlphaFold lead John Jumper leaves Google DeepMind for Anthropic, signaling an intensifying AI talent war and reshaping the AI for Science landscape.

6 Must-Have MCPs for Claude Code: Upgrade It to a Full AI Development Workstation
6 essential MCPs for Claude Code: Playwright, File System, Sequential Thinking, Context7, GitHub, and Memos — upgrade your AI coding assistant into a complete development workstation.

DeepSeek++ Plugin: Adding Memory and Automation to the DeepSeek Web Interface
DeepSeek++ browser plugin adds long-term memory, Skill automation, and sidebar chat to the DeepSeek web interface — no API setup required. Full feature guide and installation tutorial.