Getting started

STweep CLI is is the command line for STweep formatter for Structured Text. With the command line interface you can integrate automated code formatting procedures in your version controller or build server.

Requirements

The CLI interface can be installed on most windows based system with:

  • Windows 7 with .NET framework 4.6.1 or higher.
  • Windows 10 with .NET framework 4.6.1 or higher.
  • Windows server 2012 with .NET framework 4.6.1 or higher.

Installation

The latest STweep CLI installer can be downloaded from here.
After download execute the MSI and follow the installation wizard.

After installation STweep is ready for usage. The installer automatically creates a path variable “STweep.CLI” to the STweep.CLI.exe location. Which is by default:

PROGRAMFILES(X86)%\GeBa Engineering\STweep CLI

 

STweep.CLI <command> [command-options] 

Pro tip: If you are running on a system with GUI you can use the command line interface or PowerShell to install STweep CLI:
msiexec.exe /i STweep.CLI.Installer.msi /quiet

Basic commissioning

After installation STweep can be used with the command line interface of your choice. The next examples are based on Command Prompt and powershell

First step is activating your copy of STweep CLI:

STweep.CLI license-activate –key <your key> –accepteula

STweep.CLI license-activate –key <your key> –accepteula

On a system with a GUI the license wizard could also be used to activate your copy of STweep CLI.

STweep.CLI license-open-manager

STweep.CLI license-open-manager

After licensing export a STweep settings file with your preferred settings to the hard disk from for example STweep for TwinCAT. If you don’t have any other STweep programs installed you can use the stand alone settings editor which is delivered with STweep CLI. The settings can be opened with the command:

STweep.CLI open-settings-editor

STweep.CLI open-settings-editor

To format Structured Text use STweep.CLI format command. Use the –path argument to specify the files and folders you want to format. When the specified path is a file, STweep file attempt to format this file. If the path is a folder STweep will recursively search the folder for known files extensions like TcPou and TcGVL. 

STweep.CLI format –path C:/Repos/MyTwinCATProjectFolder –settingsFile C:/MyCustomSettings.STweep

STweep.CLI format –path C:/Repos/MyTwinCATProjectFolder –settingsFile C:/MyCustomSettings.STweep

Alternatively the format command accepts direct code input with the –code argument. The formatted code is returned to the command window. 

STweep.CLI format –code Invoke(a,b,c); –settingsFile C:/MyCustomSettings.STweep

STweep.CLI format –code Invoke(a,b,c); –settingsFile C:/MyCustomSettings.STweep

Next Commands