This document explains the recommended team workflow for PLC development using cds-text-sync.
The workflow is designed to combine the robustness of CODESYS for hardware configuration and HMI development with Git-based review of the XML-first exported view tree.
The steps below use the CODESYS-side Project_*.py entrypoints. The same
export / compare / import / build actions can also be driven from a shell with
the cts CLI once Project_daemon.py is running inside CODESYS (see
cds_text_sync/CLI.md).
Before the team can start working, the project must be prepared:
- Set the project folder: Run
Project_directory.pyand select the sync folder for the open project. The default profile exports all supported.stand.csvtext projections. - Choose advanced options if needed: Run
Project_options.pyon the empty sync folder only when you need to change XML-first/text-first mode, layout, profile, or text-export selection. The mode is fixed once the first export runs; switching later requires a new empty sync folder. - Extract Project: The initial state of the CODESYS project is exported using
Project_export.py. This writes the current native snapshot to.dump/IDE.xmland refreshes the editableproject-view/tree for review. - Choose Git Scope: For team review, track
project-view/intentionally and ignore volatile.dumpfiles such as snapshots, reports, and generated patches. - Initialize Repository: A Git repository is created, and the chosen exported view files (and optionally the
.projectbinary using LFS) are pushed to a remote server (e.g., GitHub, GitLab).
In text-first mode the tracked surface is intentionally text:
- Tracked:
project-view/**/*.st(and.csvprojections), the native.xmlof kinds kept in the view viaxml_in_view_kinds(default: visualizations), andcds-text-sync.json. - Not tracked: everything in
.dump/, including the tool-owned.dump/xml/structural mirror. A teammate's fresh clone has no.dump/at all —Project_import.pystill applies the.stfiles by overlaying them on a fresh IDE baseline, and objects missing from the IDE are recreated from their text. - Local
.stedits are protected: export skips (or, interactively, asks before overwriting) any file changed on disk that has not been imported yet.
- Role: Acts as the gatekeeper of the project.
- Responsibilities:
- Maintains the integrity of the Hardware Configuration and HMI.
- Manages the
mainbranch. - Reviews incoming Pull Requests from developers.
- Ensures that merged logic is compatible with the physical hardware.
- Role: Implement features and fix bugs.
- Responsibilities:
- Clone the project to their local machines.
- Develop logic using external editors or CODESYS.
- Sync changes and submit them for review via Pull Requests.
For every new task (Feature or Bug Fix), developers follow these steps:
- Clone / Sync: Clone the repository or
git pullthe latest changes frommain. - Make Changes: Open the CODESYS project and implement the required logic.
- Extract to Disk: Run
Project_export.pyto updateproject-view/with the latest CODESYS state before committing. - Compare When Needed: Run
Project_compare_ui.pybefore committing to see what differs as a CODESYS dialog with full import/export actions; it also writes the machine-readable.dump/compare_report.json. From a shell or in CI,cts comparegives the same report without a dialog. - Commit & Push: Use Git to commit the updated view files and push them to a dedicated feature branch.
- Create Pull Request: Open a Pull Request (PR) to merge the feature branch into
main.
- Review: The Main Branch Owner reviews the code changes.
- Approval:
- Yes: If the code is correct and follows standards, it is merged into
main. - No: If revisions are needed, feedback is provided, and the developer returns to the "Make Changes" step in the development cycle.
- Yes: If the code is correct and follows standards, it is merged into
- Team Sync: Once merged, all other team members can pull the updated
mainbranch into their local environments.