127 Sets High-Precision CNC Lathes
15 Years of Experience

Hongji dry information | Teach you step by step PLC programming via CODESYS V3

Mastering Industrial Automation: A Comprehensive Guide to PLC Programming with CODESYS V3 The rise of Industry 4.0 has propelled Programmable Logic Controllers (PLCs) to the forefront of industrial automation. These ruggedized computers are the backbone of modern manufacturing, robotics, and process control systems, enabling seamless communication between machines and human operators. Among the tools available […]

CNC Content Navigation

Mastering Industrial Automation: A Comprehensive Guide to PLC Programming with CODESYS V3

The rise of Industry 4.0 has propelled Programmable Logic Controllers (PLCs) to the forefront of industrial automation. These ruggedized computers are the backbone of modern manufacturing, robotics, and process control systems, enabling seamless communication between machines and human operators. Among the tools available for PLC programming, CODESYS V3 stands out as a versatile, platform-independent solution trusted by engineers worldwide.

This guide will take you from foundational concepts to advanced programming techniques, equipping you with the skills to design robust, scalable, and efficient automation systems.


Why CODESYS V3?

CODESYS (Controller Development System) is more than just an IDE—it’s a complete ecosystem for PLC programming. Its V3 iteration elevates automation development with:

  • Multi-Vendor Compatibility: Write code once and deploy it across PLCs from brands like Beckhoff, WAGO, and Schneider Electric.
  • Support for IEC 61131-3 Standards: Utilize all five PLC programming languages (LD, FBD, ST, SFC, IL) within a single environment.
  • Advanced Debugging & Simulation: Test programs in a virtual PLC (SoftPLC) before deploying to hardware.
  • Built-in Libraries & Add-Ons: Accelerate development with pre-tested functions for motion control, IoT, and safety.

Step 1: Setting Up Your CODESYS Environment

1.1 Installation

Download the latest CODESYS Development System from the official website. Opt for the “Full Installation” to access all libraries and tools.

1.2 Creating Your First Project

  1. Launch CODESYS and select File > New Project.
  2. Choose Standard Project and assign a name (e.g., “PumpControl”).
  3. Select the target device (or CODESYS Control Win V3 for simulation).

1.3 Device Configuration

  • Navigate to Device > Device Configuration to set up I/O modules and communication protocols (e.g., EtherCAT, Modbus).
  • Define symbolic addressing for inputs (e.g., iStartButton) and outputs (e.g., oPumpMotor) for clarity.

Step 2: Writing Your First Program

2.1 Ladder Logic (LD) Basics

Let’s create a simple motor starter circuit:

  1. Open the POUs folder and add a new Program using Ladder Diagram.
  2. Drag contacts (inputs) and coils (outputs) onto the rungs.
    plaintext
    |—-[iStartButton]—-[oMotor]—-|
    |—-[iStopButton]—-/————|

This mimics a relay circuit: pressing iStartButton energizes oMotor, which stays latched until iStopButton breaks the circuit.

2.2 Structured Text (ST) for Complex Logic

For mathematical operations or loops, Structured Text shines:
iecst
IF iTemperature > 100 THEN
oCoolingFan := TRUE;
nFanSpeed := (iTemperature – 100) * 50;
ELSE
oCoolingFan := FALSE;
END_IF

2.3 Function Block Diagrams (FBD)

Build reusable logic blocks, such as a PID controller or timer, by wiring function blocks together.


Step 3: Advanced Programming Techniques

3.1 Object-Oriented Programming (OOP)

CODESYS V3 supports OOP principles, enabling modular and reusable code:
iecst
FUNCTION_BLOCK ValveControl
VAR_INPUT
bOpenCmd: BOOL;
bCloseCmd: BOOL;
END_VAR
VAR_OUTPUT
bIsOpen: BOOL;
END_VAR
METHOD HandleValve: BOOL
// Logic to manage valve state

3.2 Leveraging Libraries

Import pre-built libraries like Util, OS, or third-party tools for tasks such as:

  • JSON parsing for IoT integration.
  • Safety-rated function blocks (e.g., safe torque off for motors).

3.3 State Machines with SFC

Use Sequential Function Charts (SFC) to model complex workflows, like a bottling plant’s operation:
plaintext
INIT STEP Start -> Action: InitializeConveyor
TRANSITION T1: When iBottlePresent -> STEP FillBottle


Step 4: Simulation & Debugging

4.1 Virtual PLC Testing

  1. Select Online > Login to start the built-in PLC runtime.
  2. Monitor variables in real-time using Watch Tables.
  3. Force I/O values to simulate edge cases (e.g., sensor failures).

4.2 Trace & Oscilloscope

Visualize signal behavior over time with the Trace tool—ideal for troubleshooting timing issues in high-speed applications.


Step 5: Deploying to Hardware

  1. Connect your PLC via Ethernet or USB.
  2. Compile the project (Project > Build).
  3. Download the program to the PLC (Online > Download).
  4. Validate functionality with physical I/O.

Case Study: Traffic Light Control System

Objective: Automate a 4-way intersection with pedestrian crossings.
Solution:

  1. Program Structure:
    • Use SFC to manage light states (Green → Yellow → Red).
    • Implement ST for pedestrian button logic with debounce timers.
  2. Simulation: Test timing sequences in CODESYS Control Win.
  3. Deployment: Connect to a Raspberry Pi running CODESYS Runtime.

Best Practices for Professional PLC Programming

  1. Documentation: Add comments to POUs and variables. Generate HTML documentation via Tools > Documentation Generator.
  2. Version Control: Integrate CODESYS with Git for collaborative development.
  3. Security: Enable user authentication and encrypt communications (SSL/TLS).
  4. Performance Optimization: Minimize scan time by using VAR_TEMP for non-persistent data.

Conclusion: The Future of PLC Programming

CODESYS V3 bridges traditional automation with emerging technologies like digital twins and edge computing. By mastering its tools, you position yourself at the intersection of industrial reliability and Industry 4.0 innovation.

Whether you’re automating a small conveyor belt or a smart factory, CODESYS empowers you to turn logic into motion—one rung, function block, or state at a time.


Ready to level up? Experiment with CODESYS’s IoT features—like MQTT or OPC UA—to connect your PLCs to cloud platforms and unlock predictive maintenance capabilities. The factory of tomorrow starts with the code you write today.

CNC Experts

Picture of JinShui Chen

JinShui Chen

Rapid Prototyping & Rapid Manufacturing Expert

Specialize in CNC machining, 3D printing, urethane casting, rapid tooling, injection molding, metal casting, sheet metal and extrusion

CNC Recent Posts

CNC News

Common CNC Machining Products

Welcome to GreatLight Metal,Maximum Processing Size 4,000 mm

Precision Machining CNC Quote Online

Loading file

Upload Click here to upload or drag and drop your model to the canvas.

The model is too large and has been resized to fit in the printer's build tray. [Hide]

The model is too large to fit in the printer's build tray. [Hide]

The model is too large, a fitting printer is selected. [Hide]

The model is too small and has been upscaled. [Hide]

Warning: The selected printer can not print in full color [Hide]

Warning: obj models with multiple meshes are not yet supported [Hide]

Warning: Unsupported DXF entity  [Hide]

Warning: could not arrange models [Hide]


File Unit:      
Scale:
%
L × W × H:
X: × Y: × Z:  cm 
Rotation:
X: ° Y: °  

	
⚡ Instant Quote for Precision Manufacturing

Submit your design files (STEP/IGES/DWG) and receive a competitive quote within 1 hour, backed by ISO 9001-certified quality assurance.

📋 How It Works

  1. Upload & SpecifyShare your 3D model and select materials (Aluminum/Stainless Steel/Titanium/PEEK), tolerances (±0.002mm), and surface treatments.

  2. AI-Powered AnalysisOur system calculates optimal machining strategy and cost based on 10+ years of automotive/aerospace data.

  3. Review & ConfirmGet a detailed breakdown including:
    - Volume pricing tiers (1-10,000+ units)
    - Lead time (3-7 days standard)
    - DFM feedback for cost optimization

Unit Price: 

Loading price
5 Axis CNC Machining Equipment
4 Axis CNC Machining Equipment
3 Axis CNC Machining Equipment
CNC Milling & Turning Equipment
Prototype and Short-Run Injection Moldings Exact plastic material as final design
Volume Metal Die Casting Services - Precision Cast Parts
Bridge the Gap From Prototype to Production – Global delivery in 10 days or less
Custom high-precision sheet metal prototypes and parts, as fast as 5 days.
Custom Online 3D Printing Services
Custom Online 3D Printing Services
Custom Online 3D Printing Services
Design Best Processing Method According To 3D Drawings
Alloys Aluminum 6061, 6061-T6 Aluminum 2024 Aluminum 5052 Aluminum 5083 Aluminum 6063 Aluminum 6082 Aluminum 7075, 7075-T6 Aluminum ADC12 (A380)
Alloys Brass C27400 Brass C28000 Brass C36000
Alloys Stainless Steel SUS201 Stainless Steel SUS303 Stainless Steel SUS 304 Stainless Steel SUS316 Stainless Steel SUS316L Stainless Steel SUS420 Stainless Steel SUS430 Stainless Steel SUS431 Stainless Steel SUS440C Stainless Steel SUS630/17-4PH Stainless Steel AISI 304
Inconel718
Carbon Fiber
Tool Steel
Mold Steel
Alloys Titanium Alloy TA1 Titanium Alloy TA2 Titanium Alloy TC4/Ti-6Al 4V
Alloys Steel 1018, 1020, 1025, 1045, 1215, 4130, 4140, 4340, 5140, A36 Die steel Alloy steel Chisel tool steel Spring steel High speed steel Cold rolled steel Bearing steel SPCC
Alloys Copper C101(T2) Copper C103(T1) Copper C103(TU2) Copper C110(TU0) Beryllium Copper
Alloys Magnesium Alloy AZ31B Magnesium Alloy AZ91D
Low Carbon Steel
Alloys Magnesium Alloy AZ31B Magnesium Alloy AZ91D
ABS Beige(Natural) ABS Black ABS Black Antistatic ABS Milky White ABS+PC Black ABS+PC White
PC Black PC Transparent PC White PC Yellowish White PC+GF30 Black
PMMA Black PMMA Transparent PMMA White
PA(Nylon) Blue PA6 (Nylon)+GF15 Black PA6 (Nylon)+GF30 Black PA66 (Nylon) Beige(Natural) PA66 (Nylon) Black
PE Black PE White
PEEK Beige(Natural) PEEK Black
PP Black PP White PP+GF30 Black
HDPE Black HDPE White
HIPS Board White
LDPE White
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
No coating required, product’s natural color!
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
This finishing option with the shortest turnaround time. Parts have visible tool marks and potentially sharp edges and burrs, which can be removed upon request.
Sand blasting uses pressurized sand or other media to clean and texture the surface, creating a uniform, matte finish.
Polishing is the process of creating a smooth and shiny surface by rubbing it or by applying a chemical treatmen
A brushed finish creates a unidirectional satin texture, reducing the visibility of marks and scratches on the surface.
Anodizing increases corrosion resistance and wear properties, while allowing for color dyeing, ideal for aluminum parts.
Black oxide is a conversion coating that is used on steels to improve corrosion resistance and minimize light reflection.
Electroplating bonds a thin metal layer onto parts, improving wear resistance, corrosion resistance, and surface conductivity.
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
Please provide additional text description for other surface treatment requirements!
Material
Material
  • CNC Metals
    • Aluminum
    • Brass
    • Stainless steel
    • Inconel718
    • Carbon Fiber
    • Tool Steel
    • Mold Steel
    • Titanium
    • Alloy Steel
    • Copper
    • Bronze
    • Low Carbon Steel
    • Magnesium
  • CNC Plastics
    • ABS
    • PC
    • PMMA (Acrylic)
    • PA (Nylon)
    • PE
    • PEEK
    • PP
    • HDPE
    • HIPS
    • LDPE
Printer
Printer
  • CNC Metals
    • 5 Axis CNC Machining
    • 4 Axis CNC Machining
    • 3 Axis CNC Machining
    • CNC Milling & Turning
    • Rapid Tooling
    • Metal Die Casting
    • Vacuum Casting
    • Sheet Metal Fabrication
    • SLA 3D Printing
    • SLS 3D Printing
    • SLM 3D Printing
  • Rapid Prototyping
    • Design Best Processing Method According To 3D Drawings
Post-processing
Post-processing
  • As Machined(Product’s natural color)
  • Sand Blasting
  • Polishing
  • Brushed Finish
  • Anodizing
  • Black Oxide
  • Electroplating
  • Paint Coating
  • Powder Coating
  • Other surface treatment requirements
Finalize
The world's first CNC machining center that dares to provide free samples!

Free for first product valued at less than $200. (Background check required)

precision machining cnc quote online

15 Years CNC Machining Services

When you’re ready to start your next project, simply upload your 3D CAD design files, and our engineers will get back to you with a quote as soon as possible.
Scroll to Top

ISO 9001 Certificate

ISO 9001 is defined as the internationally recognized standard for Quality Management Systems (QMS). It is by far the most mature quality framework in the world. More than 1 million certificates were issued to organizations in 178 countries. ISO 9001 sets standards not only for the quality management system, but also for the overall management system. It helps organizations achieve success by improving customer satisfaction, employee motivation, and continuous improvement. * The ISO certificate is issued in the name of FS.com LIMITED and applied to all the products sold on FS website.

greatlight metal iso 9001 certification successfully renewed
GB T 19001-2016 IS09001-2015
✅ iso 9001:2015
greatlight metal iso 9001 certification successfully renewed zh

IATF 16949 certificate

IATF 16949 is an internationally recognized Quality Management System (QMS) standard specifically for the automotive industry and engine hardware parts production quality management system certification. It is based on ISO 9001 and adds specific requirements related to the production and service of automotive and engine hardware parts. Its goal is to improve quality, streamline processes, and reduce variation and waste in the automotive and engine hardware parts supply chain.

automotive industry quality management system certification 01
Certification of Production Quality Management System for Engine Hardware Parts Engine Hardware Associated Parts
automotive industry quality management system certification 00
发动机五金零配件的生产质量管理体系认证

ISO 27001 certificate

ISO/IEC 27001 is an international standard for managing and processing information security. This standard is jointly developed by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC). It sets out requirements for establishing, implementing, maintaining, and continually improving an information security management system (ISMS). Ensuring the confidentiality, integrity, and availability of organizational information assets, obtaining an ISO 27001 certificate means that the enterprise has passed the audit conducted by a certification body, proving that its information security management system has met the requirements of the international standard.

greatlight metal technology co., ltd has obtained multiple certifications (1)
greatlight metal technology co., ltd has obtained multiple certifications (2)

ISO 13485 certificate

ISO 13485 is an internationally recognized standard for Quality Management Systems (QMS) specifically tailored for the medical device industry. It outlines the requirements for organizations involved in the design, development, production, installation, and servicing of medical devices, ensuring they consistently meet regulatory requirements and customer needs. Essentially, it's a framework for medical device companies to build and maintain robust QMS processes, ultimately enhancing patient safety and device quality.

greatlight metal technology co., ltd has obtained multiple certifications (3)
greatlight metal technology co., ltd has obtained multiple certifications (4)

Get The Best Price

Send drawings and detailed requirements via Email:info@glcncmachining.com
Or Fill Out The Contact Form Below:

All uploads are secure and confidential.