• 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
  • WaveformGenerator
  • 5.0.0

WaveformGenerator Class

(Automation::WaveformGenerator)

The WaveformGenerator component is a multi-functional waveform signal generator. It can be used to generate sine, triangle, square or sawtooth waveforms. More...

Header: #include <WaveformGenerator>
Inherits: CDPComponent
  • List of all members, including inherited members

Protected Functions

double CalculateSine()
double CalculateSquare()
double CalculateTriangle()
int MessageRestart(void *message)
double PhaseShiftInSec()

Reimplemented Protected Functions

virtual void Create(const char *fullName) override
virtual void CreateModel() override
virtual void ProcessNull() override
  • 12 protected functions inherited from CDPComponent
  • 15 protected functions inherited from CDPObject
  • 1 protected function inherited from CDP::StudioAPI::CDPNode

Additional Inherited Members

  • 92 public functions inherited from CDPComponent
  • 39 public functions inherited from CDPObject
  • 49 public functions inherited from CDPBaseObject
  • 27 public functions inherited from CDP::StudioAPI::CDPNode
  • 22 public functions inherited from CDP::StudioAPI::ICDPNode
  • 2 static public members inherited from CDPComponent
  • 6 static public members inherited from CDPObject
  • 1 static public member inherited from CDPBaseObject
  • 42 protected variables inherited from CDPComponent
  • 9 protected variables inherited from CDPObject
  • 10 protected variables inherited from CDPBaseObject

Detailed Description

The WaveformGenerator component is a multi-functional waveform signal generator. It can be used to generate sine, triangle, square or sawtooth waveforms.

Properties

PropertyDescription
WaveTypeWaveform type to generate. Select between:
  • Sine

  • Triangle

  • Square

Note: Digital pulses (values changing between 0 and 1) can be generated using Square and setting Amplitude=0.5 and Offset=0.5

Note: More complex waveform types can be generated by combining two or more WaveformGenerators outputs together using Mul or Add operators. Also, noise can be added to signal using AddRandom operator added to the output.

UseHwClockSet to true to use more accurate (but slower) hardware time source
fsGenerator running frequency (affects the waveform granularity)

Parameters

ParameterDescription
AmplitudeAmplitude of the generated waveform
FrequencyThe frequency [Hz] of the generated waveform
SymmetryWaveform rise/slope symmetry [%]
  • 50% - symmetrical waveforms (default)
  • 0% with Sine or Triangle - sloping sawtooth waveform

  • 100% with Sine or Triangle - rising sawtooth waveform

  • 0% with Square - rising edge pulse waveform

  • 100% with Square - falling edge pulse waveform

  • Values less than 50% mean that the rising slope of the waveform is shorter than the falling slope, generating waveforms like this:

  • Values higher than 50% mean that the rising slope of the waveform is longer than the falling slope, generating waveforms like this:

OffsetThe offset of the generated waveform
PhaseShiftThe phase shift of the generated waveform (in rad degrees)

Signals

SignalDescription
OutputGenerator output (generated waveform)
TimeTime in seconds since generator start or restart

Messages

MessageDescription
CM_SUSPENDSuspend waveform generation. The last generated value will be held in the output.
CM_ACTIVATEResume waveform generation.
RestartRestart the waveform generation (and zero the Time signal)

Member Function Documentation

[protected] double WaveformGenerator::CalculateSine()

[protected] double WaveformGenerator::CalculateSquare()

[protected] double WaveformGenerator::CalculateTriangle()

[override virtual protected] void WaveformGenerator::Create(const char *fullName)

[override virtual protected] void WaveformGenerator::CreateModel()

[protected] int WaveformGenerator::MessageRestart(void *message)

[protected] double WaveformGenerator::PhaseShiftInSec()

[override virtual protected] void WaveformGenerator::ProcessNull()

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