-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLoop.csp
34 lines (28 loc) · 1.62 KB
/
Loop.csp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
-- Loop.csp
--
-- AUTHORS: Dusko S. Jovanovic
-- DATE: 2006
-- PUBLISHED: Designing dependable process-oriented software: a CSP-based approach.
-- Centre for Telematics and Information Technology (CTIT).
-- University of Twente. Netherlands.
-- CTIT Ph.D.-thesis series No. 06-82, pp. 114-117, 2006.
-- DESCRIPTION
-- This example describes a basic closed loop system. The loop controller manages
-- on basis of the setpoint reference from a sequence controller and feedback signal
-- from a controlled object the steering values to the controlled object.
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
-- SOURCE CODE (adapted version)
-----------------------------------------------------------------------------------------
datatype Double = step_val | p_val | x_val
channel steering : Double
channel reference : Double
channel state : Double
MAIN = ParClosedLoop
ParClosedLoop = LoopConProcess [|{|reference, steering, state|}|] (SeqConProcess ||| PlantDynProcess)
SeqConProcess = reference!step_val -> SeqConProcess
LoopConProcess = reference?sp -> state?mv -> steering!p_val -> LoopConProcess
PlantDynProcess = state!x_val -> steering?u -> PlantDynProcess