This post is co-written with Rejin Surendran from Wipro Enterprises Limited and Bakrudeen K from ShellKode.
In manufacturing environments, industrial automation engineers face a significant challenge: how to rapidly convert complex process requirements into Programmable Logic Controller (PLC) ladder text code. This traditional, manual process typically requires 3-4 days per query, creating bottlenecks in production workflows. The complexity stems from multiple factors: engineers must meticulously translate high-level requirements into precise machine instructions while managing multiple states and transitions, facilitate compliance with the international PLC programming standard IEC 61131-3, handle complex variable declarations, maintain detailed documentation for industrial compliance, and conduct thorough testing of safety protocols and execution paths.
Wipro PARI is one of the largest global automation companies with over 1,300 employees and three facilities worldwide, with its headquarters in Pune, India. Wipro PARI has the vision to utilize its expertise and resources to bring the best solutions in automation and robotics to its customers.
In this post, we share how Wipro implemented advanced prompt engineering techniques, custom validation logic, and automated code rectification to streamline the development of industrial automation code at scale using Amazon Bedrock. We walk through the architecture along with the key use cases, explain core components and workflows, and share real-world results that show the transformative impact on manufacturing operations.
Wipro PARI partnered with AWS and ShellKode to develop an innovative solution that transforms this time-intensive PLC code generation process using AI. Using Amazon Bedrock and Anthropic’s Claude models, we have developed a system that:
Wipro PARI selected Amazon Bedrock as the foundation for this PLC code generation solution due to its unique combination of enterprise capabilities that align with industrial automation requirements. With the broad model choice available in Amazon Bedrock, the team can use Anthropic’s Claude 3.5 Sonnet for complex code generation while maintaining flexibility to switch models as newer, more capable versions become available without infrastructure changes. The fully managed service reduces the operational overhead of hosting and scaling machine learning (ML) infrastructure, helping Wipro PARI’s engineers focus on domain-specific automation logic rather than model deployment.
Critically for industrial applications, Amazon Bedrock makes sure that the customer data—including proprietary control logic and manufacturing specifications—remains within the AWS environment and is not used to train underlying foundation models (FMs), thereby maintaining strict data privacy and intellectual property protection. This security posture, combined with the AWS compliance certifications, provides the enterprise-grade governance required for manufacturing environments handling sensitive operational data.
In this section, we present the solution architecture and user workflow of the Wipro PLC Code Generator. The following diagram illustrates the end-to-end architecture.

The architecture consists of the following key components:
The code generation workflow consists of the following steps:
IF (TEMP_SENSOR > 80) AND (PRESSURE_SENSOR < 5) THEN SET COOLING_PUMP = TRUEThe following GIF illustrates the complete user workflow from Excel upload to PLC code generation and download.

User authentication and authorization are managed through Amazon Cognito, which validates user credentials and enforces role-based access controls to make sure only authorized personnel can access PLC code generation capabilities and sensitive industrial automation data. Security is implemented through AWS Identity and Access Management (IAM) based access controls managing engineer permissions and service-to-service authentication for industrial data protection. Amazon GuardDuty provides continuous threat detection, and AWS CloudTrail maintains comprehensive audit logging of the code generation activities for industrial compliance requirements.
In the following sections, we break down each functionality in detail. The modules used in the solution are integrated through a streamlined workflow to maximize automation and accuracy.
The solution begins with processing the pseudo query inputs, as shown in the following diagram. This crucial first step transforms various input formats into a standardized structure that can be effectively processed by the language model.

The workflow follows these steps:
The following code is a sample intermediate pseudo query (the output from the data formatter module). The pseudo query implements a safety monitoring system for industrial machinery that makes sure the machine only operates when the safety conditions are met. It monitors safety doors and emergency buttons, and includes proper reset procedures after a safety violation. Each state network contains the state numbers, the transition variables, and the actions to be performed for each transition.
State Number: 25
Description: Machine Safety Check
State Name: MchSafetyCheck
Action:
Transitions:
- Condition: IF iSafetyDoorClosed & iEmergencyButtonReleased
- Goto State Number: 28
- Condition: IF !iSafetyDoorClosed | iEmergencyButtonPressed
- Goto State Number: 26
State Number: 26
Description: Machine Safety Violation
State Name: MchSafetyViolation
Action:
- SET oAlarmLight = TRUE
- SET oMachineStop = TRUE
Transitions:
- Condition: IF iAcknowledgeButton & iSafetyDoorClosed & iEmergencyButtonReleased
- Goto State Number: 27
To maximize the accuracy of ladder text generation, the solution employs sophisticated prompt engineering techniques and uses Anthropic’s Claude 3.5 Sonnet for code generation. The workflow steps for this part of the solution are shown in the following diagram.

The prompt creation process consists of the following steps:
We used a few-shot learning strategy to generate domain-specific outputs by providing relevant examples in the prompt context. Pseudo queries and related metadata including structural characteristics (state transitions, actions, control flow patterns) were indexed in a vector store. At inference, a hybrid retrieval strategy combines semantic similarity and lexical matching with the metadata to fetch the most relevant structurally aligned examples and their corresponding PLC code, which are then dynamically injected into the prompt. See the following code:
PLC_PROMPT = """You are expert in writing code in PLC text ladder code …
##DYNAMIC EXAMPLES
{retrieved_examples}
##DOMAIN VARIABLES
{business_specific_variables}
##USER INPUT
{user_pseudo_code}
##FUNCTIONAL GUIDELINES
{custom_instructions}
"""
The PLC code generation process consists of the following steps (as numbered in the preceding diagram):
The following code block shows a sample PLC code generated:
FUNCTION_BLOCK "Machine_Safety_Monitoring"
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
VAR_INPUT
iSafetyDoorClosed : Bool;
iEmergencyButtonReleased : Bool;
iEmergencyButtonPressed : Bool;
iAutoRunning : Bool;
iReset_fault : Bool;
END_VAR
VAR
s25_MchSafetyCheck : Bool;
s25_MchSafetyCheck_T1 : Bool;
s25_MchSafetyCheck_T2 : Bool;
SEQ01_ResetComplete : Bool;
sStWtResetRel_T1 : Bool;
END_VAR
NETWORK
TITLE = Transition for STATE Num:25 Machine Safety Check
A #s25_MchSafetyCheck;
AN #sStWtResetRel;
A #sSst;
A #iSafetyDoorClosed;
A #iEmergencyButtonReleased;
= #s25_MchSafetyCheck_T1;
A #s25_MchSafetyCheck;
AN #sStWtResetRel;
A #sSst;
AN #iSafetyDoorClosed;
O #iEmergencyButtonPressed;
= #s25_MchSafetyCheck_T2;
NETWORK
TITLE = STATE Num:25 Machine Safety Check
A(;
O #s25_MchSafetyCheck;
O #sStWtResetRel_T1;
);
AN #sStWtResetRel;
AN #s25_MchSafetyCheck_T1;
AN #s25_MchSafetyCheck_T2;
= %L1.0;
A %L1.0;
BLD 102;
= #s25_MchSafetyCheck;
A %L1.0;
JNB Label_25;
L 25;
T #StateNo;
Label_25: NOP 0;
Because PLC ladder logic is inherently complex, LLMs might miss critical functionalities during initial code generation. The solution incorporates a sophisticated rectification system to address these gaps and facilitate high-quality output. The rectification uses a hybrid approach of custom logic containing business guidelines and an FM to perform the rectification task.The following diagram illustrates the workflow.

The rectifier module performs the following steps to help enhance code accuracy:
After rectification, the code undergoes a comprehensive validation process:
The solution provides an intuitive UI that helps engineers interact with the system efficiently.The workflow for this part of the solution follows these steps:
The entire process from upload to validated code typically completes in 3–7 minutes, depending on the complexity of the input query.The following GIF demonstrates the settings interface where users can configure model parameters including temperature, Top-P, Top-K values, select different models, and customize prompt settings for various projects.

The solution improves upon Wipro PARI’s previous approach, demonstrating consistent performance across various test cases:
This automation approach has transformed Wipro PARI’s PLC programming workflow, delivering measurable business impact including 5,000 work-hours saved across projects while minimizing manual coding errors. The solution helped their 200 engineers focus on high-value tasks like code design and application development while accelerating the code generation process. It also helped Wipro PARI win over key automotive clients and create a competitive advantage for complex automation projects. They plan to expand to other major PLC systems, including Rockwell Automation, Schneider Electric, and ABB in the future, helping Wipro PARI to scale their automotive industry expertise.
In this post, we explored how AWS collaborated with Wipro PARI to develop an AI-powered PLC Code Generator that transforms the time-intensive process of creating ladder text code from a given control logic. By using Amazon Bedrock with multiple Anthropic Claude models and a custom validation framework, the solution achieves an average accuracy of 85% while reducing code generation time from 3–4 days to approximately 10 minutes per query.
The Wipro PLC Code Generator represents a milestone in industrial automation programming, directly addressing the productivity challenges faced by Wipro PARI’s engineering consultants. The solution’s approach—combining prompt engineering, iterative code generation, automated rectification, and systematic validation—creates a robust framework that can be applied across various PLC programming scenarios.
Building on the current implementation, Wipro PARI is planning to expand the solution’s capabilities using additional Amazon Bedrock features. The team will implement Amazon Bedrock Guardrails to help enforce content filtering policies that help prevent generation of unsafe control logic and facilitate compliance with IEC 61131-3 standards at the model output level. The roadmap includes building multi-agent workflows using AWS Strands Agents, an open source SDK designed for autonomous AI agents, where specialized agents will handle distinct tasks: one agent for requirements analysis, another for code generation, and a third for automated documentation generation. To scale these agents in production, Wipro PARI will use Amazon Bedrock AgentCore, which provides serverless infrastructure for deploying and scaling agents with enterprise-grade security, session isolation, and built-in identity management. Amazon Bedrock AgentCore Memory will enable the system to maintain context across engineering sessions, allowing agents to remember previous interactions and build upon prior work, and an Amazon Bedrock AgentCore gateway will help securely connect agents to existing PLC validation tools and internal automation systems. Wipro PARI intends to build agents for automated testing, security scanning and automated document generation. In addition, Wipro PARI plans to expand this solution by incorporating additional validation rules, helping enhance the UI, and adding support for complex sequence types and integration with SIEMENS software for direct code deployment.
As industrial automation continues to evolve with increasing complexity, AI-assisted programming tools like the Wipro PLC Code Generator help accelerate development cycles and improve code quality. By reducing the manual burden of code generation and validation, engineers can focus on higher-value tasks such as system optimization and innovation, ultimately contributing to more efficient and reliable manufacturing operations across industries.
To learn more about the resources used in this solution, refer to the following additional resources:
Aparajithan Vaidyanathan is a Principal Enterprise Solutions Architect at AWS. He supports enterprise customers migrate and modernize their workloads on AWS cloud. He is a Cloud Architect with 25+ years of experience designing and developing enterprise, large-scale and distributed software systems. He specializes in Generative AI & Machine Learning with focus on moving Enterprise GenAI/ML applications to production, at scale.
Charu Dixit is a Solutions Architect at Amazon Web Services (AWS), helping GSI customers with cloud transformation strategies and solution design, focusing on containers, networking, and generative AI. With over 8 years of experience at AWS, she specializes in Amazon EKS and ELB, guiding customers through building and modernizing containerized applications at scale. Outside of work, Charu enjoys traveling, drawing and painting, and spending quality time with her family.
Debasish Mishra is a Senior Data Scientist at the AWS Generative AI Innovation Center, where he helps customers leverage AWS AI/ML services to solve complex business challenges through generative AI solutions. With experience spanning fintech, healthcare, sports, automotive, retail, manufacturing, he brings cross-industry expertise to diverse use cases. His specializations include code generation, AI agent frameworks, fine-tuning vision language models and robot foundation models, RAG systems, and multimodal applications. Debasish is passionate about enabling organizations to implement practical, impactful AI solutions.
Divakaran Ullampuzha Mana is the Head of Solution Architecture for Global Service Integrators (GSI) & IT/ITeS at AWS India. He leads solution architects who advise enterprise customers on cloud transformation strategies, with expertise in cloud computing, AI/ML, Generative AI, and digital transformation. Prior to AWS, he held executive leadership positions at Kyndryl and IBM, where he established and scaled cloud migration practices. He is an active thought leader, regularly speaking at industry events and mentoring technologists.
Rejin Surendran is the Global CIO at Wipro Enterprises Limited, where he leads digital transformation initiatives across the enterprise. With over 25 years of experience in technology leadership, he has driven large-scale transformation projects across commercial, supply chain, people, and finance functions. He holds a Master of Management from IIT Bombay and a B.Tech in Electrical & Electronics Engineering from NIT Warangal.
Bakrudeen K is an AWS Ambassador and leads the AI/ML practice at ShellKode, driving innovation in Generative and Agentic AI. He builds advanced AI solutions and Agentic Assistants that enable enterprises to scale intelligent systems responsibly. In 2025, he became the first-ever recipient of the AWS Ambassador Golden Jacket for Agentic AI, a global first within the AWS Ambassador Program.
Manuel Rioux est fièrement propulsé par WordPress