ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
Controller.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#include "Controller.h"
5
6/*
7 * This example is explained as part of the \ref conceptualOverview. Please refere there for step-by-step explanations.
8 * Reading the full example might not be a good starting point for learning ApplicationCore as it can be overwelming
9 * and lacks important background information.
10 *
11 * Please ignore all comments of the format "//! [some name]", those are used for Doxygen to include code snippets in
12 * the documentation pages.
13 */
14
15/**********************************************************************************************************************/
16
18void Controller::mainLoop() {
19 const float gain = 100.0F;
20 while(true) {
21 heatingCurrent = gain * (temperatureSetpoint - temperatureReadback);
22 writeAll(); // writes any outputs
23
24 readAll(); // waits until temperatureReadback updated, then reads temperatureSetpoint
25 }
26}
28
29/**********************************************************************************************************************/
void readAll(bool includeReturnChannels=false)
Read all readable variables in the group.
Definition Module.cc:72
void writeAll(bool includeReturnChannels=false)
Just call write() on all writable variables in the group.
Definition Module.cc:157