Skip to main content

Using PLC Shell to Query Information

The "PLC Shell" in CODESYS is a text-based controller monitor on a tab of the device editor. There you can enter commands to query specific information, as well as perform actions such as starting, stopping or loading applications. You can also get a description of the meaning and syntax of the possible commands directly from the PLC shell.

The possible commands depend on the manufacturer. The range of commands can be extended by means of the PLC Shell Command Handler either in a C component in the runtime system, or as a function block in an IEC library or a project.

The response from the PLC is displayed on the tab as a string in a result window.

Querying of information about the application on the controller

Requirement: Your project is connected to a controller (example: CODESYS Control Win) on which an App1 application is running.

  1. Double-click the CODESYS Control Win object to open the device editor in the device tree, and select the PLC Shell tab.

    The tab is displayed with an empty window. Below that is a command line.

  2. Click the _cds_icon_button_threedots.png button.

    The Insert Standard Command dialog opens with a list of commands.

  3. Select the ? command and click the Execute button.

    The dialog closes and a list of available commands with possible parameters is displayed in the output window. It shows the syntax of the command input in each case.

  4. Click _cds_icon_button_threedots.png again and select the pid command. Add the following to the input line: pid App1. Press the Enter key.

    The following is displayed in the output window (GUIDs as examples only):

    pid App1

    Project Identification

    Application: App1

    Code GUID:0x08a893c0

    Data GUID:0x762d0e90

  5. Press the _cds_icon_arrow_down.png button in the command input line.

    The pid App1 command is included in the history of entered commands.