Access to the PLC Shell
The Extension API enables external access to the PLC shell. For this function, a "Unix Domain Socket" is used, which the runtime system uses to receive incoming commands and send the corresponding response. The corresponding socket file is: /var/run/codesysextension/plcshell.sock
For this function, the runtime system needs to have the "Anonymous user" allowed. Allowing anonymous login is done by means of the Communication Settings of the device in the Change Communication Policy dialog (1): Allow anonymous login option (2).


Examples
Requirements
The runtime system has allowed the "Anonymous user".
You have logged in to the Linux system.
Your user is assigned to the
codesysuser
group.
Run the following command.
$ socat - UNIX-CLIENT:/var/run/codesysextension/plcshell.sock
Now you can execute the commands of the PLC shell in the terminal
Copy
plcshell.py
from the provided examples to the Linux system.Run the script.
The Python script sequentially executes a series of commands using the PLC shell and demonstrates the use of the PLC shell in Python.
For more information, see: Tab: <device name> PLC Shell
Usage of the interface only as a member of the Linux | Yes |
Process separation | Yes |