• 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

  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Product
    • Design UI
    • Develop
    • Analyze and test
    • Deploy
    • Framework and toolbox
    • Compatibility
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - Simulator
  • Configuration Manual
  • 4.11.14

Examples CDPSim C++ Classes

Configuration Manual

This manual describes configuration options for CDP Simulator. See Getting Started for creating a Simulator project.

SimulatorManager

Most simulation options are configured within SimulatorManager component which is included by default in every simulator application. These options affect all DynamicSimComponents in the same application.

Integration

Sets the algorithm used to evaluate differential equations. If Integration table is left empty, RungeKutta4 algorithm is used.

It is possible to implement a custom algorithm by inheriting CDPSim::IntegrationBase but the following are provided with CDPSim:

  • Euler
  • Heun
  • RungeKutta4

Properties

PropertyDescription
fsSets the processing frequency for DynamicSimComponents in this applications. This is used to run component state machine and sync routed signal and property values. Therefore it should be at least as high as the highest fs of other components which route values to/from DynamicSimComponents.
TimeStepSets how frequently EvaluateDiffEquations() is executed. A high degree of accuracy is obtained by running the simulations at very small time steps, much smaller than the periodic processes of standard CDP components set by fs property. If the selected integration algorithm (for example RungeKutta4) uses adaptive time step, then this value will set the minimum time step.
AutostartIf false, simulation is started once Start message is received. Otherwise simulation will start automatically.

Note: When the component processing period (1 / fs) is not an exact multiple of TimeStep or if the selected integration algorithm (for example RungeKutta4) uses adaptive time step, then there can be slight inaccuracies in the values published by simulator. This is similar to real world control systems if CDP IOServer fs does not exactly match the actual sensor sampling frequency.

Alarms

AlarmDescription
NotRealTimeSet when simulator is not able to run simulation components in real-time. Increase TimeStep and restart the simulation.

Messages

MessageDescription
StartStarts simulation. Happens automatically if Autostart property is true.
StopStops simulation.
ResetCalls CDPSim::DynamicSimComponent::Reset for all simulator components in this application. That will reset all CDPSignal, CDPSim::SimSignal and CDPSim::StateVariable variables back to their initial values set by configuration XML (by default 0), and Init() is called on all operators.

Signals

The following are measured values describing the runtime performance of simulation. To configure expected values, modify the SimulatorManager properties.

SignalDescription
RunsPerScheduleMeasured simulator iterations per simulator period.
dtTime since previous run. Should equal T, but may not be exactly T because of scheduler imperfection.
TRequested simulation period. Starting with value of property TimeStep, but may change dynamically.

Initial Conditions

When simulating systems, it is important to set sensible initial values to every CDPSim::StateVariable, CDPSim::SimSignal and other objects the simulator is using. Initial conditions can be set from CDP Studio Configure mode by editing the Value attribute of a StateVariable, SimSignal, signal, parameter or property before running the system. When SimulatorManager starts up (in SimulatorManager::Activate()), and if SimulatorManager's TimeStep or fs is changed during runtime, SimulatorManager's message 'Reset' is automatically called.

Further Reading

See also CDPSim C++ Classes documentation for information how to configure and use other objects provided with CDPSim. If you click on a simulator application in the Project tree, and then expand CDPSim in the Resource tree, DynamicSimComponent and Integrator will appear. You may read more about them in DynamicSimComponent and Integrator.

Examples CDPSim C++ Classes

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

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

    © Copyright 2022 CDP Technologies. Privacy and cookie policy.

    Return to top