Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kazoo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
kazoo
Commits
f93aca60
Commit
f93aca60
authored
Sep 05, 2019
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use an enumerated type for the floor
parent
085858a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
80 deletions
+82
-80
test/Demo_ABB/DataView.asn
test/Demo_ABB/DataView.asn
+4
-2
test/Demo_ABB/controller/controller.pr
test/Demo_ABB/controller/controller.pr
+78
-78
No files found.
test/Demo_ABB/DataView.asn
View file @
f93aca60
...
@@ -5,14 +5,16 @@ UpDown ::= ENUMERATED { up (1), down (0) }
...
@@ -5,14 +5,16 @@ UpDown ::= ENUMERATED { up (1), down (0) }
OnOff ::= ENUMERATED { on (1), off (0) }
OnOff ::= ENUMERATED { on (1), off (0) }
OpenClose ::= ENUMERATED { door-open (1), door-close (0) }
OpenClose ::= ENUMERATED { door-open (1), door-close (0) }
Position ::= REAL (-100 .. 100.0)
Position ::= REAL (-100 .. 100.0)
Floors ::= INTEGER {
-- don't use an integer, because the GUI needs to have real floor names
Floors ::= ENUMERATED {
floor-0 (0),
floor-0 (0),
floor-1 (10),
floor-1 (10),
floor-2 (20),
floor-2 (20),
floor-3 (30),
floor-3 (30),
floor-4 (40),
floor-4 (40),
floor-5 (50)
floor-5 (50)
}
(0 | 10 | 20 | 30 | 40 | 50)
}
-- Types used for the interfacing with the Simulink model
-- Types used for the interfacing with the Simulink model
...
...
test/Demo_ABB/controller/controller.pr
View file @
f93aca60
...
@@ -43,7 +43,7 @@ counter := forever : false
...
@@ -43,7 +43,7 @@ counter := forever : false
brake
on
brake
on
},
},
door
:=
door_open
;
door
:=
door_open
;
/*
CIF
NEXTSTATE
(
281
1
,
438
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
281
0
,
438
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
/*
CIF
ANSWER
(
3104
,
254
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
3104
,
254
),
(
70
,
24
)
*/
(
false
):
(
false
):
...
@@ -60,7 +60,7 @@ door := door_open;
...
@@ -60,7 +60,7 @@ door := door_open;
};
};
/*
CIF
ANSWER
(
3184
,
366
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
3184
,
366
),
(
70
,
24
)
*/
(
false
):
(
false
):
/*
CIF
task
(
313
9
,
410
),
(
161
,
120
)
*/
/*
CIF
task
(
313
8
,
410
),
(
161
,
120
)
*/
task
cmd
:=
{
task
cmd
:=
{
direction
down
,
direction
down
,
motor
on
,
motor
on
,
...
@@ -73,59 +73,59 @@ door := door_open;
...
@@ -73,59 +73,59 @@ door := door_open;
enddecision
;
enddecision
;
/*
CIF
End
Label
*/
/*
CIF
End
Label
*/
endconnection
;
endconnection
;
/*
CIF
state
(
171
8
,
76
),
(
74
,
35
)
*/
/*
CIF
state
(
171
7
,
76
),
(
74
,
35
)
*/
state
Stopped
;
state
Stopped
;
/*
CIF
input
(
127
8
,
131
),
(
196
,
35
)
*/
/*
CIF
input
(
127
7
,
131
),
(
196
,
35
)
*/
input
Floor_Command
(
floor_cmd
)
input
Floor_Command
(
floor_cmd
)
/*
CIF
comment
(
1495
,
131
),
(
270
,
32
)
*/
/*
CIF
comment
(
1495
,
131
),
(
270
,
32
)
*/
comment
'Someone at floor F pressed UP or DOWN'
;
comment
'Someone at floor F pressed UP or DOWN'
;
/*
CIF
decision
(
120
9
,
186
),
(
336
,
56
)
*/
/*
CIF
decision
(
120
8
,
186
),
(
336
,
56
)
*/
decision
floor_cmd
=
{
direction
up
,
floor
floor_5
}
decision
floor_cmd
=
{
direction
up
,
floor
floor_5
}
or
floor_cmd
=
{
direction
down
,
floor
floor_0
}
or
floor_cmd
=
{
direction
down
,
floor
floor_0
}
/*
CIF
comment
(
1565
,
196
),
(
204
,
35
)
*/
/*
CIF
comment
(
1565
,
196
),
(
204
,
35
)
*/
comment
'Discard impossible commands'
;
comment
'Discard impossible commands'
;
/*
CIF
ANSWER
(
11
57
,
262
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
11
39
,
262
),
(
70
,
24
)
*/
(
true
):
(
true
):
/*
CIF
NEXTSTATE
(
11
55
,
306
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
11
37
,
306
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
/*
CIF
ANSWER
(
1547
,
262
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
1547
,
262
),
(
70
,
24
)
*/
(
false
):
(
false
):
/*
CIF
task
(
14
61
,
306
),
(
241
,
35
)
*/
/*
CIF
task
(
14
43
,
306
),
(
276
,
35
)
*/
task
target_pos
:=
float
(
floor_cmd
.
floor
);
task
target_pos
:=
float
(
num
(
floor_cmd
.
floor
)
);
/*
CIF
decision
(
1506
,
356
),
(
151
,
50
)
*/
/*
CIF
decision
(
1506
,
356
),
(
151
,
50
)
*/
decision
round
(
sensors
.
pos_x
);
decision
round
(
sensors
.
pos_x
);
/*
CIF
ANSWER
(
12
39
,
426
),
(
166
,
24
)
*/
/*
CIF
ANSWER
(
12
21
,
426
),
(
201
,
24
)
*/
(=
float
(
floor_cmd
.
floor
)):
(=
float
(
num
(
floor_cmd
.
floor
)
)):
/*
CIF
task
(
124
1
,
470
),
(
163
,
24
)
*/
/*
CIF
task
(
124
0
,
470
),
(
163
,
24
)
*/
task
cmd
.
door
:=
door_open
task
cmd
.
door
:=
door_open
/*
CIF
comment
(
1425
,
464
),
(
138
,
40
)
*/
/*
CIF
comment
(
1425
,
464
),
(
138
,
40
)
*/
comment
'Lift is there
comment
'Lift is there
Just open the door'
;
Just open the door'
;
/*
CIF
task
(
125
5
,
514
),
(
134
,
35
)
*/
/*
CIF
task
(
125
4
,
514
),
(
134
,
35
)
*/
task
door
:=
door_open
;
task
door
:=
door_open
;
/*
CIF
NEXTSTATE
(
128
5
,
564
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
128
4
,
564
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
/*
CIF
ANSWER
(
167
6
,
426
),
(
54
,
40
)
*/
/*
CIF
ANSWER
(
167
5
,
426
),
(
54
,
40
)
*/
ELSE
:
ELSE
:
/*
CIF
task
(
163
6
,
486
),
(
134
,
35
)
*/
/*
CIF
task
(
163
5
,
486
),
(
134
,
35
)
*/
task
door
:=
door_close
;
task
door
:=
door_close
;
/*
CIF
join
(
168
6
,
541
),
(
35
,
35
)
*/
/*
CIF
join
(
168
5
,
541
),
(
35
,
35
)
*/
join
move
;
join
move
;
enddecision
;
enddecision
;
enddecision
;
enddecision
;
/*
CIF
input
(
200
7
,
132
),
(
200
,
35
)
*/
/*
CIF
input
(
200
6
,
132
),
(
200
,
35
)
*/
input
Cabin_Command
(
cabin_cmd
)
input
Cabin_Command
(
cabin_cmd
)
/*
CIF
comment
(
2230
,
132
),
(
239
,
56
)
*/
/*
CIF
comment
(
2230
,
132
),
(
239
,
56
)
*/
comment
'Someone selected a target floor
comment
'Someone selected a target floor
from inside the cabin, or someone
from inside the cabin, or someone
pressed the emergency stop button'
;
pressed the emergency stop button'
;
/*
CIF
decision
(
203
5
,
187
),
(
145
,
50
)
*/
/*
CIF
decision
(
203
4
,
187
),
(
145
,
50
)
*/
decision
present
(
cabin_cmd
);
decision
present
(
cabin_cmd
);
/*
CIF
ANSWER
(
1975
,
257
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
1975
,
257
),
(
70
,
24
)
*/
(
floor
):
(
floor
):
/*
CIF
decision
(
1896
,
301
),
(
227
,
71
)
*/
/*
CIF
decision
(
1896
,
301
),
(
227
,
71
)
*/
decision
round
(
sensors
.
pos_x
)
decision
round
(
sensors
.
pos_x
)
=
float
(
cabin_cmd
.
floor
);
=
float
(
num
(
cabin_cmd
.
floor
)
);
/*
CIF
ANSWER
(
1869
,
396
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
1869
,
396
),
(
70
,
24
)
*/
(
true
):
(
true
):
/*
CIF
task
(
1822
,
435
),
(
163
,
24
)
*/
/*
CIF
task
(
1822
,
435
),
(
163
,
24
)
*/
...
@@ -135,23 +135,23 @@ pressed the emergency stop button';
...
@@ -135,23 +135,23 @@ pressed the emergency stop button';
Just open the door'
;
Just open the door'
;
/*
CIF
task
(
1836
,
479
),
(
134
,
35
)
*/
/*
CIF
task
(
1836
,
479
),
(
134
,
35
)
*/
task
door
:=
door_open
;
task
door
:=
door_open
;
/*
CIF
NEXTSTATE
(
186
7
,
534
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
186
6
,
534
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
/*
CIF
ANSWER
(
2267
,
396
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
2267
,
396
),
(
70
,
24
)
*/
(
false
):
(
false
):
/*
CIF
task
(
2234
,
440
),
(
134
,
35
)
*/
/*
CIF
task
(
2234
,
440
),
(
134
,
35
)
*/
task
door
:=
door_close
;
task
door
:=
door_close
;
/*
CIF
task
(
21
80
,
490
),
(
243
,
35
)
*/
/*
CIF
task
(
21
62
,
490
),
(
279
,
35
)
*/
task
target_pos
:=
float
(
cabin_cmd
.
floor
);
task
target_pos
:=
float
(
num
(
cabin_cmd
.
floor
)
);
/*
CIF
join
(
2284
,
545
),
(
35
,
35
)
*/
/*
CIF
join
(
2284
,
545
),
(
35
,
35
)
*/
join
move
;
join
move
;
enddecision
;
enddecision
;
/*
CIF
ANSWER
(
24
37
,
257
),
(
123
,
24
)
*/
/*
CIF
ANSWER
(
24
54
,
257
),
(
123
,
24
)
*/
(
emergency_stop
):
(
emergency_stop
):
/*
CIF
task
(
24
34
,
301
),
(
129
,
43
)
*/
/*
CIF
task
(
24
51
,
301
),
(
129
,
43
)
*/
task
cmd
.
motor
:=
off
,
task
cmd
.
motor
:=
off
,
cmd
.
brake
:=
on
;
cmd
.
brake
:=
on
;
/*
CIF
NEXTSTATE
(
24
61
,
364
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
24
79
,
364
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
enddecision
;
enddecision
;
/*
CIF
input
(
846
,
131
),
(
70
,
35
)
*/
/*
CIF
input
(
846
,
131
),
(
70
,
35
)
*/
...
@@ -173,12 +173,12 @@ command';
...
@@ -173,12 +173,12 @@ command';
(
forever
):
(
forever
):
/*
CIF
NEXTSTATE
(
750
,
470
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
750
,
470
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
/*
CIF
ANSWER
(
92
2
,
426
),
(
94
,
24
)
*/
/*
CIF
ANSWER
(
92
1
,
426
),
(
94
,
24
)
*/
(
nb_of_cycle
):
(
nb_of_cycle
):
/*
CIF
task
(
88
2
,
470
),
(
175
,
40
)
*/
/*
CIF
task
(
88
1
,
470
),
(
175
,
40
)
*/
task
counter
:=
nb_of_cycle
:
task
counter
:=
nb_of_cycle
:
counter
.
nb_of_cycle
-
1
;
counter
.
nb_of_cycle
-
1
;
/*
CIF
decision
(
88
7
,
530
),
(
165
,
50
)
*/
/*
CIF
decision
(
88
6
,
530
),
(
165
,
50
)
*/
decision
counter
.
nb_of_cycle
>
0
;
decision
counter
.
nb_of_cycle
>
0
;
/*
CIF
ANSWER
(
891
,
600
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
891
,
600
),
(
70
,
24
)
*/
(
true
):
(
true
):
...
@@ -191,18 +191,56 @@ counter.nb_of_cycle - 1;
...
@@ -191,18 +191,56 @@ counter.nb_of_cycle - 1;
enddecision
;
enddecision
;
enddecision
;
enddecision
;
endstate
;
endstate
;
/*
CIF
state
(
317
,
394
),
(
91
,
56
)
*/
/*
CIF
state
(
3593
,
92
),
(
70
,
35
)
*/
state
Moving
;
/*
CIF
input
(
3594
,
147
),
(
67
,
35
)
*/
input
Pulse
;
/*
CIF
PROCEDURECALL
(
3572
,
202
),
(
109
,
40
)
*/
call
Operate_Lift
(
cmd
,
sensors
)
/*
CIF
comment
(
3691
,
198
),
(
123
,
40
)
*/
comment
'Call the Simulink
model'
;
/*
CIF
task
(
3529
,
262
),
(
197
,
35
)
*/
task
hk
:=
{
lift
sensors
,
door
door
};
/*
CIF
output
(
3559
,
317
),
(
135
,
40
)
*/
output
Housekeeping
(
hk
);
/*
CIF
decision
(
3533
,
377
),
(
189
,
50
)
*/
decision
present
(
counter
);
/*
CIF
ANSWER
(
3500
,
447
),
(
68
,
24
)
*/
(
forever
):
/*
CIF
join
(
3517
,
491
),
(
35
,
35
)
*/
join
move
;
/*
CIF
ANSWER
(
3668
,
447
),
(
94
,
24
)
*/
(
nb_of_cycle
):
/*
CIF
task
(
3628
,
491
),
(
175
,
40
)
*/
task
counter
:=
nb_of_cycle
:
counter
.
nb_of_cycle
-
1
;
/*
CIF
decision
(
3633
,
551
),
(
165
,
50
)
*/
decision
counter
.
nb_of_cycle
>
0
;
/*
CIF
ANSWER
(
3633
,
621
),
(
70
,
24
)
*/
(
true
):
/*
CIF
join
(
3650
,
665
),
(
35
,
35
)
*/
join
move
;
/*
CIF
ANSWER
(
3723
,
621
),
(
70
,
24
)
*/
(
false
):
/*
CIF
NEXTSTATE
(
3712
,
665
),
(
90
,
35
)
*/
NEXTSTATE
Power_Off
;
enddecision
;
enddecision
;
endstate
;
/*
CIF
state
(
316
,
394
),
(
91
,
56
)
*/
state
Power_Off
,
state
Power_Off
,
Stopped
,
Stopped
,
Moving
;
Moving
;
/*
CIF
input
(
15
2
,
470
),
(
122
,
40
)
*/
/*
CIF
input
(
15
1
,
470
),
(
122
,
40
)
*/
input
Start_Controller
input
Start_Controller
(
counter
);
(
counter
);
/*
CIF
decision
(
14
9
,
530
),
(
128
,
50
)
*/
/*
CIF
decision
(
14
8
,
530
),
(
128
,
50
)
*/
decision
present
(
counter
);
decision
present
(
counter
);
/*
CIF
ANSWER
(
98
,
600
),
(
73
,
24
)
*/
/*
CIF
ANSWER
(
98
,
600
),
(
73
,
24
)
*/
(
forever
):
(
forever
):
/*
CIF
decision
(
7
6
,
644
),
(
118
,
50
)
*/
/*
CIF
decision
(
7
5
,
644
),
(
118
,
50
)
*/
decision
counter
.
forever
;
decision
counter
.
forever
;
/*
CIF
ANSWER
(
56
,
714
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
56
,
714
),
(
70
,
24
)
*/
(
true
):
(
true
):
...
@@ -214,17 +252,17 @@ Moving;
...
@@ -214,17 +252,17 @@ Moving;
NEXTSTATE
Moving
;
NEXTSTATE
Moving
;
/*
CIF
ANSWER
(
101
,
828
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
101
,
828
),
(
70
,
24
)
*/
(
off
):
(
off
):
/*
CIF
NEXTSTATE
(
9
9
,
872
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
9
8
,
872
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
enddecision
;
enddecision
;
/*
CIF
ANSWER
(
191
,
714
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
191
,
714
),
(
70
,
24
)
*/
(
false
):
(
false
):
/*
CIF
NEXTSTATE
(
18
1
,
758
),
(
90
,
35
)
*/
/*
CIF
NEXTSTATE
(
18
0
,
758
),
(
90
,
35
)
*/
NEXTSTATE
Power_Off
;
NEXTSTATE
Power_Off
;
enddecision
;
enddecision
;
/*
CIF
ANSWER
(
31
2
,
600
),
(
94
,
24
)
*/
/*
CIF
ANSWER
(
31
1
,
600
),
(
94
,
24
)
*/
(
nb_of_cycle
):
(
nb_of_cycle
):
/*
CIF
decision
(
31
4
,
644
),
(
90
,
50
)
*/
/*
CIF
decision
(
31
3
,
644
),
(
90
,
50
)
*/
decision
cmd
.
motor
;
decision
cmd
.
motor
;
/*
CIF
ANSWER
(
281
,
714
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
281
,
714
),
(
70
,
24
)
*/
(
on
):
(
on
):
...
@@ -232,52 +270,14 @@ Moving;
...
@@ -232,52 +270,14 @@ Moving;
NEXTSTATE
Moving
;
NEXTSTATE
Moving
;
/*
CIF
ANSWER
(
371
,
714
),
(
70
,
24
)
*/
/*
CIF
ANSWER
(
371
,
714
),
(
70
,
24
)
*/
(
off
):
(
off
):
/*
CIF
NEXTSTATE
(
36
9
,
758
),
(
74
,
35
)
*/
/*
CIF
NEXTSTATE
(
36
8
,
758
),
(
74
,
35
)
*/
NEXTSTATE
Stopped
;
NEXTSTATE
Stopped
;
enddecision
;
enddecision
;
enddecision
;
enddecision
;
/*
CIF
input
(
45
3
,
470
),
(
119
,
40
)
*/
/*
CIF
input
(
45
2
,
470
),
(
119
,
40
)
*/
input
Manual_Control
input
Manual_Control
(
cmd
);
(
cmd
);
/*
CIF
NEXTSTATE
(
47
8
,
530
),
(
70
,
35
)
*/
/*
CIF
NEXTSTATE
(
47
7
,
530
),
(
70
,
35
)
*/
NEXTSTATE
-;
NEXTSTATE
-;
endstate
;
endstate
;
/*
CIF
state
(
3593
,
92
),
(
70
,
35
)
*/
state
Moving
;
/*
CIF
input
(
3594
,
147
),
(
67
,
35
)
*/
input
Pulse
;
/*
CIF
PROCEDURECALL
(
3573
,
202
),
(
109
,
40
)
*/
call
Operate_Lift
(
cmd
,
sensors
)
/*
CIF
comment
(
3691
,
198
),
(
123
,
40
)
*/
comment
'Call the Simulink
model'
;
/*
CIF
task
(
3529
,
262
),
(
197
,
35
)
*/
task
hk
:=
{
lift
sensors
,
door
door
};
/*
CIF
output
(
3560
,
317
),
(
135
,
40
)
*/
output
Housekeeping
(
hk
);
/*
CIF
decision
(
3533
,
377
),
(
189
,
50
)
*/
decision
present
(
counter
);
/*
CIF
ANSWER
(
3501
,
447
),
(
68
,
24
)
*/
(
forever
):
/*
CIF
join
(
3518
,
491
),
(
35
,
35
)
*/
join
move
;
/*
CIF
ANSWER
(
3669
,
447
),
(
94
,
24
)
*/
(
nb_of_cycle
):
/*
CIF
task
(
3629
,
491
),
(
175
,
40
)
*/
task
counter
:=
nb_of_cycle
:
counter
.
nb_of_cycle
-
1
;
/*
CIF
decision
(
3633
,
551
),
(
165
,
50
)
*/
decision
counter
.
nb_of_cycle
>
0
;
/*
CIF
ANSWER
(
3633
,
621
),
(
70
,
24
)
*/
(
true
):
/*
CIF
join
(
3651
,
665
),
(
35
,
35
)
*/
join
move
;
/*
CIF
ANSWER
(
3723
,
621
),
(
70
,
24
)
*/
(
false
):
/*
CIF
NEXTSTATE
(
3713
,
665
),
(
90
,
35
)
*/
NEXTSTATE
Power_Off
;
enddecision
;
enddecision
;
endstate
;
endprocess
Controller
;
endprocess
Controller
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment