plcopen
Parser for PLCopen TC6 XML files - the IEC 61131-3 standard exchange format for PLC programs.
Features
- Type-safe parsing using quick-xml and serde
- Generated types from the official PLCopen TC6 XML schema (v2.01)
- ST (Structured Text) extraction and parsing via
iec61131
Installation
Or add to your Cargo.toml:
[]
= "0.3"
Usage
use Project;
// Parse PLCopen XML file
let xml = read_to_string?;
let project: Project = from_str?;
println!;
ST Code Extraction
use ;
let xml = read_to_string?;
// Extract all ST code blocks from POUs
for in extract_all_st_from_xml
PLCopen TC6 XML Format
PLCopen TC6 is an XML-based exchange format defined by the PLCopen organization for transferring PLC programs between different development environments.
This parser handles:
- Program Organization Units (POUs): Programs, Functions, Function Blocks
- Data Types: Elementary types (BOOL, INT, REAL, etc.) and user-defined types
- Variables: Input, Output, InOut, Local, Global, External
- ST Code Extraction: Extracts and parses Structured Text (ST) code using
iec61131
Note: The XML format supports all 5 IEC 61131-3 languages (ST, IL, LD, FBD, SFC), but this parser currently only extracts and parses ST (Structured Text) code
License
MIT