• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Protocols - ExternalControl I/O
  • LocalCommandRun
  • 5.0.0

Sub-requests HTTPRequest

LocalCommandRun

LocalCommandRun

LocalCommandRun allows CDP to invoke any OS command locally on the same controller CDP system is running on.

LocalCommandRun shares common properties with other Requests, but has the following specific configuration properties and elements:

Property / ElementDescription
CommandLine<string>Command line (i.e. command with all parameters) to invoke for each request. CommandLine platform-dependent (Linux or Windows) parts can be hidden from other platform, like this:
  • Parts between tags [LINUX: and :] will only be included when system is run on Linux
  • parts between tags [WINDOWS: and :] will only be included when system is run on Windows

For example, to run 2 commands sequentially using one CommandLine on both platforms you can use CommandLine:

CommandOne [LINUX:;:][WINDOWS:&:] CommandTwo

Note: CommandLine property will be processed by FormatTranslator before invoking, so you can use any request channel value in here, that can be useful for using values as part of CommandLine (note that values can also be ValueMap translated to any string).

UseShell<bool>When set, command is executed via operating system shell (sh in Linux and cmd in Windows). Default is to use shell.
WorkingDirectory<string>Working directory to run the command in. If left empty, CDP application folder is used.
ClearEnvironment<string>When set, all system environment variables are cleared before request is run. Default is not to clear existing variables.

Note: You can set specific Environment variables for the command using Environment elements (see below).

GetResponseFromSpecifies what will be used as request response stream, as input for response translator. Choose between options:
  • StdoutAndStderr - both command standard output (stdout) and standard error (stderr) will be used
  • OnlyStdout - only command standard output (stdout) will be used (i.e. stderr will be filtered out)
  • OnlyStderr - only command standard error (stderr) will be used (i.e. stdout will be filtered out)
  • File - file content will be used as command output (instead of stdout and/or stderr). File name has to be specified by ResponseFile property.
ResponseFile<string>File name to get response body from when GetResponseFrom=File. File name can be either with absolute (full) path or relative to CDP application folder.
Environment elementsUnlimited number of Name and Value pairs that will be set as command environment before each request invoked.

Note: Environment Name and Value properties will be processed by FormatTranslator before setting, so you can use any request channel value in here (can be useful for setting environment variables based on channel values).

LocalCommandRun state can be observed via these read-only properties:

PropertyDescription
LastRunTimeTime stamp of the last command run
LastReturnCodeReturn (exit) code of the last command run

See also shared common properties with other Requests (including the properties controlling what events cause the LocalCommandRun to be launched).

Note: LocalCommandRun will be invoking commands under the same user and privileges as CDP application is run. For security reasons, there is no property or option to escalate privileges for the command.

Sub-requests HTTPRequest

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top