Skip to main content

Bridge utility for CodeSys and SE Machine Expert projects - text export and transformation, version control tools

Project description

CodeSys Text Export

This tool exports Structured Text (ST) source code from a CodeSys/Machine Expert project with these key features:

  1. Creates a directory structure matching the project structure
  2. Each ST element (Programs, Function Blocks, Functions, etc.) gets exported to .st files
  3. For Function Blocks and Interfaces, all their sub-elements (methods, actions, properties) are kept together in the same file

For example, a Function Block called FB_Motor with methods and actions would be exported to a single FB_Motor.st file like this:

FUNCTION_BLOCK FB_Motor
VAR_INPUT
    Enable : BOOL;
    Speed : REAL;
END_VAR

VAR
    isRunning : BOOL;
    currentSpeed : REAL;
END_VAR

    METHOD Start
    VAR_INPUT
        acceleration : REAL;
    END_VAR
        isRunning := TRUE;
        currentSpeed := Speed * acceleration;
    END_METHOD

    METHOD Stop
        isRunning := FALSE;
        currentSpeed := 0;
    END_METHOD

    ACTION Update
        IF isRunning THEN
            // Update motor logic
            currentSpeed := Speed;
        END_IF
    END_ACTION

END_FUNCTION_BLOCK

Installation

  1. If your Windows doesn't have python3.9 or higher installed, install it from Microsoft Store/python.org or any other source.

  2. Open Command Prompt or PowerShell as administrator

    • Right-click on Command Prompt/PowerShell and select "Run as administrator"
    • Windows UAC prompt will appear for confirmation
  3. Install the CodeSys Bridge package:

    pip install codesys-bridge
    
  4. Run the bridge installation:

    codesys-bridge
    

The installer will:

  • Install into the CodeSys Script Commands directory
  • Automatically detect all installed SE Machine Expert V2.x versions
  • Create or update the configuration files

You have to restart CodeSys/ME after installation for the script icon to appear. "Text Export" should become visible in Tools -> Scripting menu.

What Gets Installed

The installer adds the following to each installation:

  • Updates to config.json - Adds or updates the CodeSys Bridge Script entry
  • Reference to cs_export.py - The main bridge script

Surfacing icon for Text Export

After that you should look for the new icon and add it to your toolbar.

Go to Tools -> Customize -> Add Command -> ScriptEngine Commands -> Text Export

image

image

image

Requirements

  • Windows operating system
  • Python 3.9 or higher
  • Administrator privileges (for SE Machine Expert installations)
  • EcoStruxure Machine Expert V2.x and/or CodeSys 3.5.x installed

Notes

  • The script will automatically install to all detected V2.x versions
  • Existing installations will be updated if already present
  • The installation is non-destructive and will preserve other script commands

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codesys_bridge-0.1.5.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codesys_bridge-0.1.5-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file codesys_bridge-0.1.5.tar.gz.

File metadata

  • Download URL: codesys_bridge-0.1.5.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.25

File hashes

Hashes for codesys_bridge-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e1e8c0b2aa16c9b5ded227602de3ad04e4de09c75bfa62f33489eed16ea9cbbd
MD5 9577ed697e63adcdc4c2b3c06ad0075f
BLAKE2b-256 320484b4e98f074b2b8b90b03cc40bfb41884c7dbf940b0394674aab7a5f3e43

See more details on using hashes here.

File details

Details for the file codesys_bridge-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for codesys_bridge-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3e8a2b0a77fe72e8373b7d5de769ec0ec057583c773b734ce0fa41e4dce1094a
MD5 398895df4d7832397350e5779dc07291
BLAKE2b-256 e0a37e83e9796377af2c7269cb5aa6c00dbaea41f247539ce5b0c5c3f81df87e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page