summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/rouge-4.5.2/lib/rouge/demos/iecst
blob: 16a0371a1fa8c53dfd087f201aca73ca6b3e43e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// first-order lag derivative term
(*
  Parameter K must be set to T / (T + T1)
*)
FUNCTION_BLOCK DT2

VAR_INPUT
  IN : REAL;
  K : REAL;
END_VAR
VAR_OUTPUT
  Q : REAL;
END_VAR
VAR
  H : REAL := 0.0;
END_VAR

BEGIN
  Q := IN - H;
  H := H + K * Q;
END_FUNCTION_BLOCK