- Reorganized project: codesys/, docs/codesys|redesign|integration|reference/, scripts/ - CODESYS project and exports in codesys/ - Documentation index in docs/README.md - Redesign and light naming configuration - Water boiler control and safety design Co-authored-by: Cursor <cursoragent@cursor.com>
4.0 KiB
4.0 KiB
CODESYS Project Export Guide
Overview
CODESYS projects can be exported to readable XML formats that allow for better analysis, documentation, and version control. The binary .project file format is proprietary and not human-readable, but CODESYS provides export options that create XML files.
Export Formats
1. CODESYS XML Format (*.export)
Best for: Full project export, version control, complete documentation
- Format: Fully compatible CODESYS XML format
- Content: Complete project structure in machine-parsable XML
- Compatibility: 100% compatible with CODESYS
- Use Cases:
- Full project backup
- Version control systems
- Automated analysis and documentation
- Project migration
How to Export:
- Open your project in CODESYS IDE
- Go to Project → Export
- Select the objects you want to export (or select all)
- Choose CODESYS XML Format (*.export) as the file type
- Save the file (e.g.,
Home_Automation.export)
2. PLCopen XML Format (*.xml)
Best for: Interoperability, documentation tools, program structure
- Format: PLCopen XML standard
- Content: Subset of CODESYS elements (programs, function blocks, variables)
- Compatibility: May not include all CODESYS-specific features
- Use Cases:
- Documentation generation
- Integration with other tools
- Program structure analysis
- Cross-platform compatibility
How to Export:
- Open your project in CODESYS IDE
- Go to Project → Export PLCopenXML
- Select the objects to export
- Save the file (e.g.,
Home_Automation.xml)
What Information Can Be Extracted
From exported XML files, we can extract:
Project Structure
- Program Organization Units (POUs)
- Function blocks and functions
- Libraries and dependencies
- Project hierarchy
Network Variables
- Variable names
- Data types
- Initial values
- Network variable declarations
- Direction (input/output)
I/O Configuration
- EtherCAT device configuration
- I/O channel mappings
- Device parameters
- Scan rates
Control Logic
- Program code structure
- Variable declarations
- Function block instances
- Logic flow
Hardware Configuration
- Device configurations
- Network settings
- Communication parameters
Recommended Export Process
For comprehensive documentation, export both formats:
-
Full Export (CODESYS XML):
File: Home_Automation.export - Complete project structure - All configurations - Network variables - I/O mappings -
Program Export (PLCopen XML):
File: Home_Automation.xml - Program structure - Variable declarations - Logic organization
After Export
Once you have the exported XML files:
- Share the files - The XML files can be analyzed and documented
- Version control - XML files are text-based and work well with Git
- Documentation - Information can be extracted and added to the docs
- Analysis - Scripts can parse the XML to extract specific information
Next Steps
After exporting:
- Place exported files in the project directory
- Update
.gitignoreif needed (or commit the exports) - Use the exported files to:
- Document network variables
- Map I/O configurations
- Understand control logic
- Complete the documentation templates
Example Export Workflow
# In CODESYS IDE:
1. File → Open → "Home_Automation (1).project"
2. Project → Export
- Select: All objects
- Format: CODESYS XML (*.export)
- Save as: "Home_Automation.export"
3. Project → Export PLCopenXML
- Select: Programs, POUs
- Save as: "Home_Automation.xml"
Notes
- Export files are typically much larger than binary project files
- XML exports are human-readable and can be opened in any text editor
- Some CODESYS-specific features may not be fully represented in PLCopen XML
- Exported files can be re-imported into CODESYS if needed
Status: Ready for export - follow the steps above to create readable project files