The PLCnext CLI (PLCnext Command Line Interface) provides an entire toolchain for C++ and C# programming on the PLCnext Technology platform as well as a template system for creating projects.

  • Based on the C++ specific templates, you can develop your applications.
  • Use the PLCnext CLI to unpack and manage the SDKs.
  • CMake is contained as the build environment, and each SDK has its own configuration.
  • A parser integrated in PLCnext CLI creates the metadata required for PLCnext Engineer to inform it about data types, components, programs and ports.
  • The LibraryBuilder contained in PLCnext CLI creates a PLCnext Engineer library from the project.

From IDE Add-ins/Extensions, the PLCnext CLI is called to perform some steps by means of that IDE. So if you're working with Eclipse® and the PLCnext Technology Add-in, or with or Visual Studio® and the PLCnext Technology extension you might not need the PLCnext CLI commands described below.

Note: While the SDKs are specific for firmware versions, the PLCnext CLI itself doesn't change that often. There are two releases per year in and January and July. Just use the newest PLCnext CLI version available for download.


PLCnext CLI command structure

  • Use the Command Line Interface to call functions by means of simple commands.
  • Activate the PLCnext CLI by calling the plcncli.exe via the shell, e.g.:
    C:\Program Files\PHOENIX CONTACT\PLCnCLI 2020.0 LTS\plcncli.exe.

If you added the plcncli.exe to your  PATH system variable, you can simply use plcncli as a command in the console. There is a long and a short form for the commands, which you can use as you like:

Long form for the commands

To add the parameters, use prefix --, e.g.:

C:\Workspace>plcncli new project --name MyProject1
Successfully created template 'project' in C:\Workspace\MyProject1

Short form for the commands

To add the parameters, use prefix -, e.g.:

C:\Workspace>plcncli new project -n MyProject1
Successfully created template 'project' in C:\Workspace\MyProject1

Command details

The functions are structured hierarchically. For each command, there is another level of commands that specifies the desired function in more detail. Use the --help command to call a description of the individual functions. E.g.: plcncli new project --help

If you do not specify all the parameters, the system will also display the help or use default parameters. The values will be displayed after the command was executed.
For example, if you do not specify a directory path via the --output option for a new project, a subfolder is created and used in the current directory.

PLCnext CLI command overview

The PLCnext CLI provides the following commands, which you can use to execute the corresponding functions.

Command Meaning
build Compile a project
generate Generate configuration and code files
get Query information about projects, controllers, settings, etc.
set Change settings, e.g. set a project controller
update Update of controllers in the current project
install Install an SDK
show-log Opens the location of the CLI log files.
migrate-old-cli Migrates all caches and user settings from an old CLI installation. NoteNoteUse this command, if you had a previous installation of the PLCnCLI and your settings or already installed SDKs are missing after an update of the PLCnCLI.
new Create new files/projects
deploy Deploy files for production.
help Call additional information about a specific command
version Show version information

Each command can be specified using additional parameters. Commands consist of the fol­lowing:

PLCnext CLI call

Level 1

Level 2

Level 3




-n or --name

If you require information on parameters or additional command levels, you can request them for each level by means of the --help command.

CLI template system

With the plcncli new command it is possible to add new files or start new projects. These are based on templates, and they are adapted to the current project or pre-configured by additional parameters.

First, there is the PLM program project template (viaplcncli new project) which can be extended by additional programs (via plcncli new program) and components (via plcncli new component). For more information about the PLM program project type, refer to the Structure of a C++ program.

A second option is the ACF project template (via plcncli new acfproject), and additional ACF components can be added via plcncli new acfcomponents. To distinguish the core differences between PLM and ACF projects, refer to their PLM and ACF delimitation.

From firmware releases 2021.0 LTS or newer, the third option is a template for a Shared library (via plcncli new consumablelibrary) which can be used in other PLCnext C++ projects. For more on this useful template type, see the Consumable library description.

How to

The following example shows an option of how to configure a project up to the complete PLCnext library using the PLCnext CLI:

  1. Open a project folder of your choice:
    e.g., C:\Users\<username>\Documents\CLI Projects.

  2. Generate a new project with the project name Project1:
    plcncli new project –n Project1

  3. Go to the Project1 project folder:
    cd Project1

  4. Select the desired controller for the project (e.g., AXC F 2152):
    plcncli set target --add -n AXCF2152

  5. Generate metafiles and code files:
    plcncli generate all
    Generate metafiles and code files separatelyGenerate metafiles and code files separately

    Use the following command to generate only the necessary metafiles for the project:
    plcncli generate config

    Use the following command to generate only the necessary code files for the project:
    plcncli generate code

  6. Compile the project.:
    plcncli build

  7. Generate a library for PLCnext Engineer:
    plcncli deploy
    → The library and the .so files are located in the bin folder of the project.
  8. Import the generated library into PLCnext Engineer ( click here for instructions on how to do that).





•  Web browser recommendation: Chrome/Edge 88 or newer, Firefox ESR 90 or neweror Safari • 
• Published/reviewed: 2022-09-14 • Revision 046 •