ST Code Converter
- Note: ST code conversion is limited to 5 times.
🖥️ ST Code Converter
A tool that converts ST (Structured Text) code used in PLCs into ST code for different vendors, or into higher‑level languages such as C++.
v1.2603.0120
⚙️ Key Features
- Compiler‑style architecture using a Lexer and Parser to generate an Abstract Syntax Tree (AST), rather than relying on simple regular‑expression‑based string replacement.
- AST‑based generators enable output to multiple PLC vendors’ ST dialects as well as languages such as C++ and C#.
- Vendor‑specific constructs are normalized during syntactic analysis to improve cross‑vendor compatibility.
- Conversion is performed as an interpretive translation, not a literal word‑for‑word transformation.
- When a vendor’s ST specification is publicly available, the converter follows that specification. For vendors without published specifications, conversion is based on the IEC standard.
- Perfect conversion is not guaranteed. When conversion is not possible, the tool inserts markers so that the affected sections produce compile‑time errors in the output code.
📝 Notes on Vendor‑Specific ST Specifications
Due to differences in proprietary ST language specifications, converting from a complex ST dialect to a simpler one may be limited in certain cases
(e.g., converting Siemens or Rockwell ST to IEC‑standard ST).
📦 Requirements
To use this tool, the following software must be installed:
- Python
- Microsoft Visual C++ Redistributable
🚀 Getting Started
How to Use
- Run the included start_server.bat file to launch a lightweight Python web server.
- Open index.html in your preferred web browser.
How to Close
- Close the ST Code Converter page in your browser.
- Close the Command Prompt window running the Python web server.
⚙️ Specifications
- Scope of Conversion: Processes ST code at the function level.
- Unsupported Features: ST code that defines data types (used by certain vendors) is not supported and will not be converted.
- System Calls: Vendor‑specific system calls are preserved using their original function names. A comment is automatically appended to indicate that the feature requires manual re‑implementation in the target environment.
- Processing Limit: Exactly one function can be converted per execution.
- Language‑Spec Limitations: Conversions from vendors with rich ST specifications (e.g., Siemens, Rockwell, Omron) to vendors with more limited specifications (e.g., Mitsubishi, IEC Standard) may fail due to missing equivalent language features.
đź”— Additional Information
GitHub: ST Code Converter