• 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 - Automation
  • MessageTransform
  • 5.0.0

MessageTransform Class

(Automation::MessageTransform)

The MessageTransform can be used to transform CM_TEXTCOMMAND text messages using POSIX regular expressions. More...

Header: #include <MessageTransform>
Inherits: CDPOperator<bool>
  • List of all members, including inherited members

Additional Inherited Members

  • 18 public functions inherited from CDPOperator
  • 17 public functions inherited from CDPOperatorBase
  • 49 public functions inherited from CDPBaseObject
  • 27 public functions inherited from CDP::StudioAPI::CDPNode
  • 22 public functions inherited from CDP::StudioAPI::ICDPNode
  • 1 public variable inherited from CDPOperatorBase
  • 1 static public member inherited from CDPBaseObject
  • 1 protected function inherited from CDP::StudioAPI::CDPNode
  • 8 protected variables inherited from CDPOperator
  • 5 protected variables inherited from CDPOperatorBase
  • 10 protected variables inherited from CDPBaseObject

Detailed Description

The MessageTransform can be used to transform CM_TEXTCOMMAND text messages using POSIX regular expressions.

MessageTransform is similar to the MessageProxy operator allowing to forward CM_TEXTCOMMAND text messages from input arguments to one or multiple output arguments. Only difference is that every CM_TEXTCOMMAND text message is transformed using POSIX regular expression search and replace transform on the message and then forwards it to the configured output arguments.

The MessageTransform argument has the following properties:

PropertyDescription
SearchPOSIX regular expression search pattern with search groups to find from incoming messages.
ReplaceText to replace matched pattern with (with numbered references to the POSIX regular expression matchs groups like $1, $2 etc).

Note: The message will be forwarded unchanged when the Search pattern is not matching with the message at all.

For example, the following Search and Replace patterns can be used to change a parameter name ValueName to SomeOtherName in between other parameters in the text message:

PropertyDescription
Search(.*);ValueName=(*.)
Replace$1;SomeOtherName=$2
  • It is possible to convert incoming CM_TEXTCOMMAND messages to other CM_TEXTCOMMAND commands by setting the received and sent TextCommand property on the (input and/or) output MessageArgument.

Note: It is important to keep in mind that MessageTransform will replace the Origin of the message and for that reason is not suitable for forwarding messages that require ACK handling or response

Below is a table with the most useful special characters in patterns:

(...)Specifies a block (regex group). Anything that is matched inside parenthesis can be references using $1 $2 etc in the Replace field.
.Matches any character
\.Matches . character (dot)
\sMatches any whitespace character (space, tab or newline)
\SMatches any non-whitespace character (any character except space, tab and newline)
\dMatches any digit character
\DMatches any non-digit character
\wMatches any alphanumeric character (letter, number or underscore)
\WMatches any non-letter character (so it is not a letter, number nor underscore)
+Indicates one or more occurrences of the preceding elements. For example, S+ causes to match one or more sequential non-whitespace characters.
*Indicates zero or more occurrences of the preceding elements. For example, S* causes to match any number (or zero) sequential non-whitespace characters.

You can learn more about regex expression possibilities, at:

  • Boost regex page
  • Boost format syntax
  • Wikipedia regex page

See also MessageArgument.

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