• 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

  • Framework - Sequencer
  • JSONEncode

JSONEncode

JSONEncode

The JSONEncode block is an operator, that allows to encode input arguments as attributes to JavaScript Object Notation (JSON) formatted string.

Arguments

NameAppearanceDescription
JSON attribute name to encodeAny number of user-configurable input argumentsArgument name will be encoded to output as JSON attribute name, and argument current value will be encoded as this JSON attribute value.
OutPredefined output argumentThe JSON-formatted string

Note: The arguments are encoded to the output JSON in the order they appear in the JSONEncode block. So if you prefer having them in different order you can re-order the arguments in the JSONEncode block.

Example

The following block diagram shows how to encode a JSON string like this:

{
  "name": "temp",
  "value": 25.6
}

For that, 2 input arguments were added to the JSONEncode block (named name and value). Then, these arguments current values (and as for all operators, the argument values can be routed from any value object in CDP) will be used to encode and output the JSON string, as can be seen in the block diagram:

See also JSONEncoder, JSONDecode, and Argument.

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