This “How to” guide explains how to execute a Python script as an external process from a CODESYS application running on a WAGO Edge Computer 752-94xx. It assumes that the script is already installed on the computer along with the necessary packages.
-
Modify the CODESYS Control Configuration File:
• Save the file and exit the editor.
• Access the Edge Computer via SSH using a program like PuTTY.
• Edit the “/etc/CODESYSControl.cfg” file with a text editor such as Nano.
• Add the following lines to permit the execution of external commands:
• Restart the CODESYS runtime if it is already running. -
Open the CODESYS application and add the “SysProcess” library to the project.
-
Call your Python script using the “SysProcess_Implementation.SysProcessExecuteCommand2” function block. For example: