How Wipro PARI accelerates PLC code generation using Amazon Bedrock

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.

Nov 21, 2025 - 17:00
How Wipro PARI accelerates PLC code generation using Amazon Bedrock

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.

Why Wipro PARI chose Amazon Bedrock?

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:

  • Reduces PLC code generation time from 3–4 days to approximately 10 minutes per requirement
  • Improves code accuracy up to 85%
  • Automates validation against industry standards
  • Handles complex state management and transition logic automatically
  • Facilitates proper variable declarations and naming conventions
  • Maintains compliance documentation and audit trails
  • Provides a user-friendly interface for industrial engineers

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.

Solution overview

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.

Solution Architecture

Architecture components

The architecture consists of the following key components:

  • Frontend client layer – The frontend client layer consists of a React-based, responsive web application that makes it possible for industrial engineers to upload control logic spreadsheets, configure generation settings, and verify generated ladder code with full traceability.
  • Backend application services layer – The WIPRO PARI solution implements a React and FastAPI microservices architecture with over 30 specialized APIs deployed on load-balanced Amazon Elastic Compute Cloud (Amazon EC2) instances within a secure virtual private cloud (VPC) environment for industrial automation PLC code generation, with plans to migrate to Amazon Elastic Container Service (Amazon ECS) in future iterations. The VPC configuration includes public and private subnet isolation with bastion server access control for secure remote management of the industrial control system development service. The backend application services layer is organized into distinct components, including controllers for request handling, core services for business logic, authentication modules for user management, file processing engines for spreadsheet handling, and spreadsheet parsers for extracting control logic specifications from industrial automation documentation.
  • AI/ML processing layer – The solution includes a dedicated AI/ML processing layer that integrates with Amazon Bedrock and uses multiple Anthropic Claude models depending on task complexity and requirements. The large language model (LLM) integration services transform control logic requirements into intermediate structured pseudo queries, which are then converted into standardized PLC ladder text code through multi-iteration processing. The system handles complex industrial automation scenarios, including parallel execution paths, fork/defork logic, and Boolean expressions commonly found in manufacturing control systems.
  • Data and storage layer – The generated PLC code undergoes intelligent rectification to fix syntax and logical errors specific to ladder logic programming, followed by systematic validation against predefined industrial guidelines to facilitate code quality and safety compliance. Amazon Simple Storage Service (Amazon S3) buckets store generated code artifacts, templates, and version history for industrial project management. The system uses Amazon Relational Database Service (Amazon RDS) for PostgreSQL databases for persistent state management, project tracking, and maintaining relationships between control logic specifications and generated code.

User workflow

The code generation workflow consists of the following steps:

  • User input and authentication – An industrial engineer logs in to the React web application, authenticates through role-based access controls, and uploads Excel spreadsheets.
  • Data processing and transformation – The system processes the uploaded spreadsheets containing control logic specifications for PLC programming requirements through Excel parsers. It extracts the control logic data, validates input specifications against industrial standards, and transforms raw data into structured format suitable for AI processing.
  • AI-powered code generation – LLM integration services send structured requirements to Amazon Bedrock using Anthropic’s Claude 3.5 Sonnet, which generates intermediate pseudo queries, converts them into standardized PLC ladder text code, and handles complex industrial automation scenarios including parallel execution paths and Boolean expressions. A pseudo query is an intermediate structured representation that translates human-readable control logic requirements from Excel spreadsheets into a standardized format that can be processed by AI models to generate PLC code.
    • Example specification – When temperature > 80°C AND pressure < 5 bar, turn on cooling pump
    • Pseudo queryIF (TEMP_SENSOR > 80) AND (PRESSURE_SENSOR < 5) THEN SET COOLING_PUMP = TRUE
  • Validation and storage – The generated PLC code undergoes automated quality validation against IEC 61131-3 standards, intelligent rectification fixes syntax and logical errors, and validated code artifacts are stored in Amazon S3 with version control and traceability.
  • Engineer review – The industrial engineer reviews the generated ladder code through the web interface, verifies code quality and safety compliance, downloads validated PLC code for deployment, and maintains project history with a full audit trail for industrial compliance requirements.

The following GIF illustrates the complete user workflow from Excel upload to PLC code generation and download.

Security and compliance

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.

Data formatter

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.

Data Formatter

The workflow follows these steps:

  1. Users upload the control logic available in a spreadsheet as inputs through the UI interface.
  2. From the uploaded spreadsheet, the formatter intelligently extracts state definitions, transition numbers, associated actions, and forking/de-forking path relationships. This extracted information is useful in the downstream process to validate the PLC code.
  3. The extracted information is stored in S3 buckets for persistence and future reference.
  4. The data formatter constructs a comprehensive prompt containing the original spreadsheet data and specific processing instructions.
  5. This prompt is sent to Anthropic’s Claude 3.5 Sonnet to convert the control logic into a structured pseudo query format. Lengthy descriptions are abbreviated to 20 characters to conform to PLC variable naming conventions.
  6. The data formatter then passes control to the PLC code generator module.

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

PLC code generator

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.

PLC Code Generator

Prompt creation

The prompt creation process consists of the following steps:

  1. The intermediate pseudo query from the data formatter is passed to the PLC code generator module, which initiates the prompt creation process.
  2. The prompt builder builds a detailed task prompt to generate the initial batch of PLC code and the subsequent batches as well. It includes:
    1. PLC programming domain knowledge (state/transition variable naming conventions, network creation patterns for forking/de-forking, condition network structures) .
    2. Few-shot examples demonstrating pseudo query to ladder text conversion.
    3. Explicit instructions for handling state transitions, variable declarations, and complex Boolean expressions.
  3. The prompt builder also creates a continuation prompt that instructs the FM to continue generating the PLC code from where it has left off in the previous iteration.

Few-shot sampling

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}
"""

PLC code generation

The PLC code generation process consists of the following steps (as numbered in the preceding diagram):

  1. The task prompt is passed to Anthropic’s Claude 3.5 Sonnet, which processes the prompt to generate the initial ladder text code containing up to 4,096 tokens (the maximum output tokens limit for the FM).
  2. Because ladder text typically exceeds this limit, our solution implements an iterative generation approach with specialized continuation prompting. The system checks if generation is complete and requests additional continuation prompts as needed.
  3. This continuation method maintains context between sequential generations, facilitating consistency throughout the entire code base.
  4. The process continues iteratively until the PLC ladder code is fully generated. The completed code segments are then consolidated and passed to the code rectifier module for further processing.

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;

Code rectifier

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.

PLC Code Rectifier

The rectifier module performs the following steps to help enhance code accuracy:

  1. PLC code generated by the generator module is transferred to the rectifier module for enhancement.
  2. The module facilitates proper handling of parallel execution paths, where sequences split into multiple branches and later re-converge, maintaining proper logic flow throughout the PLC program. This is done by invoking Anthropic’s Claude 3.7 Sonnet, which provides enhanced reasoning capabilities required for complex parallel execution path corrections, with a specialized prompt and the generated PLC code. Node/network mapping scripts are used to track state transitions and sequence tracking.
  3. The module uses data extracted by the formatter (including transition variables’ source and destination states stored in Amazon S3) through the following phases:
    1. Identification phase – Uses specialized Python algorithms to analyze the PLC code structure and cross-references transition variables against their declared source and destination states, flagging incorrect connections.
    2. Remediation phase – Employs targeted Python routines to systematically remove incorrect connections while preserving the overall logic structure integrity.
    3. Reconstruction phase – Implements custom Python logic to establish proper connections between states following correct sequential execution patterns.
  4. The generated code might contain syntax errors, undeclared variables, or non-compliant naming. Using Anthropic’s Claude 3.5 Sonnet and custom logic, this process involves:
    1. Identifying missing variables that are used within the code but not declared.
    2. Adding missing variables to the declaration section.
    3. Standardizing variable names to make sure the variables follow the Siemens S7-1517 PLC naming conventions.
  5. The rectified PLC code and associated metadata are stored in Amazon S3.

Code evaluator

After rectification, the code undergoes a comprehensive validation process:

  1. The validator module analyzes the rectified ladder text against the critical guidelines:
    1. Unique state flags – Verifies that each state has a unique identifier with no duplicates.
    2. Unique transition flags – Confirms the transition identifiers are unique throughout the code.
    3. Proper connection verification – Validates that each transition connects to the correct destination state.
    4. Input transition completeness – Makes sure every state has at least one input transition condition to trigger state changes.
    5. Mutually exclusive conditions – Checks that transition variables within the same state are mutually exclusive to help prevent logic conflicts.
  2. For each validation check, the system generates a detailed pass/fail result with specific information about the issues detected.
  3. A comprehensive validation report is compiled, highlighting remaining issues that might require manual attention from engineers, with clear indicators of their location and nature in the code.
  4. This multi-layered rectification and validation approach significantly helps improve the quality of the generated ladder text, reducing the need for manual intervention and accelerating the overall code development process.

UI and user interaction

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:

  1. Users access the web-based interface to upload control logic spreadsheets or structured text inputs.
  2. The interface provides options to select different models and adjust parameters to optimize generation.
  3. Advanced users can edit the prompts directly to customize the generation process.
  4. The system displays the generated ladder text, pseudo query, and validation report, allowing engineers to quickly assess the output quality.

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.

Results and business impact

The solution improves upon Wipro PARI’s previous approach, demonstrating consistent performance across various test cases:

  • Average validation completion percentage across test cases was 85%
  • Processing time reduced from 3–4 days to approximately 10 minutes per query
  • Cost per query generation was approximately $0.40–$0.60
  • Perfect (100%) validation scores achieved on less complex queries such as “Conveyor controls”
  • Even complex queries with multiple state transitions achieved validation scores of 70–90%

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.

Conclusion

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:


About the authors

AparAparajithan 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.

DivaDivakaran 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.

RejinRejin 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.

Jat AI Stay informed with the latest in artificial intelligence. Jat AI News Portal is your go-to source for AI trends, breakthroughs, and industry analysis. Connect with the community of technologists and business professionals shaping the future.