Upgrading to 4.0¶
4.0 is a new cds-text-sync: cts.exe and an agent DLL running inside CODESYS replace the Python package and the Project_*.py scripts. It is tested on the versions listed under Known limits, and the last 3.x release, 3.4.1, stays one menu choice away. cts --version prints the version and the build commit; please include both in reports.
Install, update and go back¶
Close CODESYS, then run in PowerShell:
irm https://raw.githubusercontent.com/ArthurkaX/cds-text-sync/main/irm/setup.ps1 | iex
Enter (L, the main branch) installs the latest 4.x; running the same line again updates it. The numbered entries are the stable releases (v4.0.0 and on, then 3.4.1), for staying on one of them; the T entries are the tagged betas.
To go back to 3.4.1, run the same line and pick 3.4.1 in the stable list (2, below v4.0.0). A release up to 3.4.1 has its own installer: this one takes the agent out of the menu folder, starts that installer, and you pick 3.4.1 again in its menu. The sync folder each project remembers (projects.json) is kept for a later update. Running the 3.4.1 installer directly instead leaves the 4.0 agent folder in the menu folder, reports it as a problem, and forgets projects.json.
A build handed over as a *-setup.zip installs without GitHub: unzip it and run install.cmd.
What changes on upgrade¶
- A 3.x sync folder is not taken over: start in a new folder. Open the project, run
cts set-sync-folder PATHwith a new folder (it refuses one with.dump/manifest.json), thencts exportandcts commit. - Git is required; each sync folder is a git repository and commands use its history and sync base.
- The CODESYS menu has one
cds-text-syncentry, and the installer puts its button on the Standard toolbar. The oldProject_*.pyscripts stay where 3.x put them: the installer deletes nothing of yours in ScriptDir, it names each one it finds (note: an older release's script ...; delete it: PATH). They are still listed under Tools > Scripting but no longer work; delete them. - The old Python
ctspackage is replaced bycts.exe. The installer offers to remove the old pip command if it takes precedence. cts visu-lintis replaced bycts visu check --screen NAME.cts install-menuandcts whereare replaced bycts install.- The former
cts ui,cts config ui,cts daemon start|stop,cts snapshot, andcts last-resultcommands are removed. Use the quick window,cts status, andcts read-logwhere applicable. - Analysis settings now live in the
analyzesection ofcds-text-sync.json; suppressions are in.cts-analyze/suppressions.json. cts docs --output DIRis nowcts docs --out DIR, and socts plc-log --output PATH,cts plc get FILE --output PATHandcts test --output PATHtake--out PATH:--outputis only the answer's format (short,json,text);cts analyze --format sarifis nowcts analyze --sarif FILE.cts verify --probe-timeoutis removed.cts merge --merge-toolandcts project update --merge-toolare removed: branches, and a pull that meets the same lines changed on both sides, are merged in your git program (cts openopens the sync folder in it).- Whole-project import options
--wholeand--no-refreshare removed.cts fsmreplacesfsm ide|scan|show; SVG and PlantUML FSM renderings are removed.
What is new¶
- The toolbar button or the menu entry starts the in-IDE agent and opens the quick window; Alt+Q opens it afterwards.
cts set-sync-folderworks on a brand-new project. The sync folder is a git repository;cts statusreports its branch, commit, and uncommitted changes.cts exportwrites a POU or interface, including its methods, properties, actions, and accessors, as one.stfile.cts synccarries non-overlapping edits in both directions, labels each changedisk -> IDEorIDE -> disk(mergedfor a merge), andcts import --dry-runpreviews changes and conflicts.- Compare reports IDE and disk changes separately. Branch and commit workflows are available in the quick window and CLI.
- A colleague can leave the task configuration, the alarms or a device to the project's owner: list them in the clone's
.git/info/exclude(**/Task Configuration/), and export, import and compare leave those files as they are (Working as a team). cts analyzeandcts fsmrun insidects.exe: a large project is analyzed in seconds, with far fewer false findings.cts fmtlays out the IDE's ST (indentation in editor columns, aligned declarations), or with--diskthe sync folder's files, and changes it only with--write;cts newwrites a new POU, GVL, DUT or member as a.stfile forcts import.- If a command is stopped by an open IDE dialog, it exits with code 3 and prints the ready
cts dialog answer ...command.
Known limits¶
- Tested on CODESYS V3.5 SP22 (x64), and V3.5 SP16 Patch 9 (x86).
- A project saved by a newer CODESYS may open in an older one with objects marked
[incomplete]. Thencts exportandcts comparerefuse to run and write nothing. Use a project saved in the oldest CODESYS version that will open it. - On a machine with both SP16 and SP22, check that the menu appears in both CODESYS versions. SP16 uses the legacy machine-wide ScriptDir; newer versions use the user ScriptDir.
Reporting a problem¶
Include:
- The exact command line and its full output, including errors,
[WARN]and[INFO]lines. - The output of
cts --version(including its commit),cts agent list(the agent's build) andcts status. - The agent log at
%TEMP%\cts-agent.log.