| 1 | within Modelica.Blocks; |
|---|
| 2 | package Interfaces |
|---|
| 3 | "Library of connectors and partial models for input/output blocks" |
|---|
| 4 | import Modelica.SIunits; |
|---|
| 5 | extends Modelica.Icons.Library; |
|---|
| 6 | |
|---|
| 7 | annotation(preferedView="info", |
|---|
| 8 | Coordsys( |
|---|
| 9 | extent=[0, 0; 733, 491], |
|---|
| 10 | grid=[2, 2], |
|---|
| 11 | component=[20, 20]), |
|---|
| 12 | Window( |
|---|
| 13 | x=0.05, |
|---|
| 14 | y=0.09, |
|---|
| 15 | width=0.72, |
|---|
| 16 | height=0.71, |
|---|
| 17 | library=1, |
|---|
| 18 | autolayout=1), |
|---|
| 19 | Documentation(info="<HTML> |
|---|
| 20 | <p> |
|---|
| 21 | This package contains interface definitions for |
|---|
| 22 | <b>continuous</b> input/output blocks with Real, |
|---|
| 23 | Integer and Boolean signals. Furthermore, it contains |
|---|
| 24 | partial models for continuous and discrete blocks. |
|---|
| 25 | </p> |
|---|
| 26 | |
|---|
| 27 | </HTML> |
|---|
| 28 | ", revisions="<html> |
|---|
| 29 | <ul> |
|---|
| 30 | <li><i>Oct. 21, 2002</i> |
|---|
| 31 | by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> |
|---|
| 32 | and <a href=\"http://www.robotic.dlr.de/Christian.Schweiger/\">Christian Schweiger</a>:<br> |
|---|
| 33 | Added several new interfaces. <a href=\"../Documentation/ChangeNotes1.5.html\">Detailed description</a> available. |
|---|
| 34 | <li><i>Oct. 24, 1999</i> |
|---|
| 35 | by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br> |
|---|
| 36 | RealInputSignal renamed to RealInput. RealOutputSignal renamed to |
|---|
| 37 | output RealOutput. GraphBlock renamed to BlockIcon. SISOreal renamed to |
|---|
| 38 | SISO. SOreal renamed to SO. I2SOreal renamed to M2SO. |
|---|
| 39 | SignalGenerator renamed to SignalSource. Introduced the following |
|---|
| 40 | new models: MIMO, MIMOs, SVcontrol, MVcontrol, DiscreteBlockIcon, |
|---|
| 41 | DiscreteBlock, DiscreteSISO, DiscreteMIMO, DiscreteMIMOs, |
|---|
| 42 | BooleanBlockIcon, BooleanSISO, BooleanSignalSource, MI2BooleanMOs.</li> |
|---|
| 43 | <li><i>June 30, 1999</i> |
|---|
| 44 | by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br> |
|---|
| 45 | Realized a first version, based on an existing Dymola library |
|---|
| 46 | of Dieter Moormann and Hilding Elmqvist.</li> |
|---|
| 47 | </ul> |
|---|
| 48 | </html> |
|---|
| 49 | ")); |
|---|
| 50 | |
|---|
| 51 | connector RealSignal "Real port (both input/output possible)" |
|---|
| 52 | replaceable type SignalType = Real; |
|---|
| 53 | |
|---|
| 54 | extends SignalType; |
|---|
| 55 | |
|---|
| 56 | annotation (Documentation(info="<html> |
|---|
| 57 | <p> |
|---|
| 58 | Connector with one signal of type Real (no icon, no input/output prefix). |
|---|
| 59 | </p> |
|---|
| 60 | </html>")); |
|---|
| 61 | end RealSignal; |
|---|
| 62 | |
|---|
| 63 | connector BooleanSignal = Boolean "Boolean port (both input/output possible)" |
|---|
| 64 | annotation (Documentation(info="<html> |
|---|
| 65 | <p> |
|---|
| 66 | Connector with one signal of type Boolean (no icon, no input/output prefix). |
|---|
| 67 | </p> |
|---|
| 68 | </html>")); |
|---|
| 69 | connector IntegerSignal = Integer "Integer port (both input/output possible)" |
|---|
| 70 | annotation (Documentation(info="<html> |
|---|
| 71 | <p> |
|---|
| 72 | Connector with one signal of type Icon (no icon, no input/output prefix). |
|---|
| 73 | </p> |
|---|
| 74 | </html>")); |
|---|
| 75 | |
|---|
| 76 | connector RealInput = input RealSignal "'input Real' as connector" |
|---|
| 77 | annotation (defaultComponentName="u", |
|---|
| 78 | Coordsys(extent=[-100, -100; 100, 100], |
|---|
| 79 | grid=[1,1], |
|---|
| 80 | component=[20,20], |
|---|
| 81 | scale=0.2), |
|---|
| 82 | Icon(coordinateSystem(extent=[-100,-100; 100,100]), |
|---|
| 83 | Polygon(points=[-100,100; 100,0; -100,-100; -100,100], style( |
|---|
| 84 | color=74, |
|---|
| 85 | rgbcolor={0,0,127}, |
|---|
| 86 | fillColor=74, |
|---|
| 87 | rgbfillColor={0,0,127}))), |
|---|
| 88 | Diagram(Polygon(points=[0,50; 100,0; 0,-50; 0,50], style( |
|---|
| 89 | color=74, |
|---|
| 90 | rgbcolor={0,0,127}, |
|---|
| 91 | fillColor=74, |
|---|
| 92 | rgbfillColor={0,0,127})), |
|---|
| 93 | Text( |
|---|
| 94 | extent=[-120,105; 100,60], |
|---|
| 95 | string="%name", |
|---|
| 96 | style(color=74, rgbcolor={0,0,127}))), |
|---|
| 97 | Documentation(info="<html> |
|---|
| 98 | <p> |
|---|
| 99 | Connector with one input signal of type Real. |
|---|
| 100 | </p> |
|---|
| 101 | </html>")); |
|---|
| 102 | |
|---|
| 103 | connector RealOutput = output RealSignal "'output Real' as connector" |
|---|
| 104 | annotation (defaultComponentName="y", |
|---|
| 105 | Coordsys(extent=[-100, -100; 100, 100], |
|---|
| 106 | grid=[1,1], |
|---|
| 107 | component=[20,20]), |
|---|
| 108 | Icon(Polygon(points=[-100, 100; 100, 0; -100, -100; -100, 100], style( |
|---|
| 109 | color=74, |
|---|
| 110 | rgbcolor={0,0,127}, |
|---|
| 111 | fillColor=7, |
|---|
| 112 | rgbfillColor={255,255,255}))), |
|---|
| 113 | Diagram(Polygon(points=[-100,50; 0,0; -100,-50; -100,50], style( |
|---|
| 114 | color=74, |
|---|
| 115 | rgbcolor={0,0,127}, |
|---|
| 116 | fillColor=7, |
|---|
| 117 | rgbfillColor={255,255,255})), |
|---|
| 118 | Text( |
|---|
| 119 | extent=[-100,140; 130,60], |
|---|
| 120 | string="%name", |
|---|
| 121 | style(color=74, rgbcolor={0,0,127}))), |
|---|
| 122 | Documentation(info="<html> |
|---|
| 123 | <p> |
|---|
| 124 | Connector with one output signal of type Real. |
|---|
| 125 | </p> |
|---|
| 126 | </html>")); |
|---|
| 127 | |
|---|
| 128 | connector BooleanInput = input BooleanSignal "'input Boolean' as connector" |
|---|
| 129 | annotation (defaultComponentName="u", |
|---|
| 130 | Icon(coordinateSystem(extent=[-100,-100; 100,100]), |
|---|
| 131 | Polygon(points=[-100, 100; 100, 0; -100, -100; -100, 100], |
|---|
| 132 | style(color=5, fillColor=5))), Diagram(Polygon(points=[0,50; 100,0; |
|---|
| 133 | 0,-50; 0,50], style(color=5, fillColor=5)), |
|---|
| 134 | Text( |
|---|
| 135 | extent=[-120,105; 100,60], |
|---|
| 136 | string="%name", |
|---|
| 137 | style(color=5))), |
|---|
| 138 | Coordsys(grid=[1,1], component=[20,20], |
|---|
| 139 | scale=0.2), |
|---|
| 140 | Documentation(info="<html> |
|---|
| 141 | <p> |
|---|
| 142 | Connector with one input signal of type Boolean. |
|---|
| 143 | </p> |
|---|
| 144 | </html>")); |
|---|
| 145 | |
|---|
| 146 | connector BooleanOutput = output BooleanSignal "'output Boolean' as connector" |
|---|
| 147 | annotation (defaultComponentName="y", |
|---|
| 148 | Coordsys(extent=[-100, -100; 100, 100], |
|---|
| 149 | grid=[1,1], |
|---|
| 150 | component=[20,20]), |
|---|
| 151 | Icon(Polygon(points=[-100, 100; 100, 0; -100, -100; -100, 100], style(color= |
|---|
| 152 | 5, fillColor=7))), |
|---|
| 153 | Diagram(Polygon(points=[-100,50; 0,0; -100,-50; -100,50], style( |
|---|
| 154 | color=5, fillColor=7)), Text( |
|---|
| 155 | extent=[-100,140; 130,60], |
|---|
| 156 | string="%name", |
|---|
| 157 | style(color=5))), |
|---|
| 158 | Documentation(info="<html> |
|---|
| 159 | <p> |
|---|
| 160 | Connector with one output signal of type Boolean. |
|---|
| 161 | </p> |
|---|
| 162 | </html>")); |
|---|
| 163 | |
|---|
| 164 | connector IntegerInput = input IntegerSignal "'input Integer' as connector" |
|---|
| 165 | annotation (defaultComponentName="u", |
|---|
| 166 | Coordsys( |
|---|
| 167 | extent=[-100, -100; 100, 100], |
|---|
| 168 | grid=[1,1], |
|---|
| 169 | component=[20,20], |
|---|
| 170 | scale=0.2), |
|---|
| 171 | Icon(coordinateSystem(extent=[-100,-100; 100,100]), |
|---|
| 172 | Polygon(points=[-100, 100; 100, 0; -100, -100; -100, 100], style(color= |
|---|
| 173 | 45, fillColor=45))), |
|---|
| 174 | Diagram(Polygon(points=[0,50; 100,0; 0,-50; 0,50], style( |
|---|
| 175 | color=45, fillColor=45)), Text( |
|---|
| 176 | extent=[-120,105; 100,60], |
|---|
| 177 | style(color=45), |
|---|
| 178 | string="%name")), |
|---|
| 179 | Documentation(info="<html> |
|---|
| 180 | <p> |
|---|
| 181 | Connector with one input signal of type Integer. |
|---|
| 182 | </p> |
|---|
| 183 | </html>")); |
|---|
| 184 | |
|---|
| 185 | connector IntegerOutput = output IntegerSignal "'output Integer' as connector" |
|---|
| 186 | annotation (defaultComponentName="y", |
|---|
| 187 | Coordsys( |
|---|
| 188 | extent=[-100, -100; 100, 100], |
|---|
| 189 | grid=[1,1], |
|---|
| 190 | component=[20,20]), |
|---|
| 191 | Icon(Polygon(points=[-100, 100; 100, 0; -100, -100; -100, 100], style(color= |
|---|
| 192 | 45, fillColor=7))), |
|---|
| 193 | Diagram(Polygon(points=[-100,50; 0,0; -100,-50; -100,50], style( |
|---|
| 194 | color=45, fillColor=7)), Text( |
|---|
| 195 | extent=[-100,140; 130,60], |
|---|
| 196 | style(color=45), |
|---|
| 197 | string="%name")), |
|---|
| 198 | Documentation(info="<html> |
|---|
| 199 | <p> |
|---|
| 200 | Connector with one output signal of type Integer. |
|---|
| 201 | </p> |
|---|
| 202 | </html>")); |
|---|
| 203 | |
|---|
| 204 | partial block BlockIcon "Basic graphical layout of input/output block" |
|---|
| 205 | |
|---|
| 206 | annotation ( |
|---|
| 207 | Coordsys(extent=[-100, -100; 100, 100]), |
|---|
| 208 | Window( |
|---|
| 209 | x=0, |
|---|
| 210 | y=0, |
|---|
| 211 | width=0.6, |
|---|
| 212 | height=0.6), |
|---|
| 213 | Icon(Rectangle(extent=[-100, -100; 100, 100], style( |
|---|
| 214 | color=74, |
|---|
| 215 | rgbcolor={0,0,127}, |
|---|
| 216 | fillColor=7, |
|---|
| 217 | rgbfillColor={255,255,255})), |
|---|
| 218 | Text(extent=[-150, 150; 150, 110], string= |
|---|
| 219 | "%name")), |
|---|
| 220 | Documentation(info="<html> |
|---|
| 221 | <p> |
|---|
| 222 | Block that has only the basic icon for an input/output |
|---|
| 223 | block (no declarations, no equations). Most blocks |
|---|
| 224 | of package Modelica.Blocks inherit directly or indirectly |
|---|
| 225 | from this block. |
|---|
| 226 | </p> |
|---|
| 227 | </html>")); |
|---|
| 228 | equation |
|---|
| 229 | |
|---|
| 230 | end BlockIcon; |
|---|
| 231 | |
|---|
| 232 | partial block SO "Single Output continuous control block" |
|---|
| 233 | extends BlockIcon; |
|---|
| 234 | |
|---|
| 235 | RealOutput y "Connector of Real output signal" |
|---|
| 236 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 237 | annotation ( |
|---|
| 238 | Coordsys( |
|---|
| 239 | extent=[-100, -100; 100, 100], |
|---|
| 240 | grid=[2, 2], |
|---|
| 241 | component=[20, 20]), |
|---|
| 242 | Window( |
|---|
| 243 | x=0.25, |
|---|
| 244 | y=0.02, |
|---|
| 245 | width=0.6, |
|---|
| 246 | height=0.6), |
|---|
| 247 | Diagram, |
|---|
| 248 | Documentation(info="<html> |
|---|
| 249 | <p> |
|---|
| 250 | Block has one continuous Real output signal. |
|---|
| 251 | </p> |
|---|
| 252 | </html>")); |
|---|
| 253 | end SO; |
|---|
| 254 | |
|---|
| 255 | partial block MO "Multiple Output continuous control block" |
|---|
| 256 | extends BlockIcon; |
|---|
| 257 | |
|---|
| 258 | parameter Integer nout(min=1) = 1 "Number of outputs"; |
|---|
| 259 | RealOutput y[nout] "Connector of Real output signals" |
|---|
| 260 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 261 | annotation ( |
|---|
| 262 | Coordsys( |
|---|
| 263 | extent=[-100, -100; 100, 100], |
|---|
| 264 | grid=[2, 2], |
|---|
| 265 | component=[20, 20]), |
|---|
| 266 | Window( |
|---|
| 267 | x=0.13, |
|---|
| 268 | y=0.03, |
|---|
| 269 | width=0.6, |
|---|
| 270 | height=0.6), |
|---|
| 271 | Documentation(info="<html> |
|---|
| 272 | <p> |
|---|
| 273 | Block has one continuous Real output signal vector. |
|---|
| 274 | </p> |
|---|
| 275 | </html>")); |
|---|
| 276 | end MO; |
|---|
| 277 | |
|---|
| 278 | partial block SISO "Single Input Single Output continuous control block" |
|---|
| 279 | extends BlockIcon; |
|---|
| 280 | |
|---|
| 281 | RealInput u "Connector of Real input signal" |
|---|
| 282 | annotation (extent=[-140, -20; -100, 20]); |
|---|
| 283 | RealOutput y "Connector of Real output signal" |
|---|
| 284 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 285 | annotation (Coordsys( |
|---|
| 286 | extent=[-100, -100; 100, 100], |
|---|
| 287 | grid=[2, 2], |
|---|
| 288 | component=[20, 20]), Window( |
|---|
| 289 | x=0.32, |
|---|
| 290 | y=0.07, |
|---|
| 291 | width=0.6, |
|---|
| 292 | height=0.6), |
|---|
| 293 | Documentation(info="<html> |
|---|
| 294 | <p> |
|---|
| 295 | Block has one continuous Real input and one continuous Real output signal. |
|---|
| 296 | </p> |
|---|
| 297 | </html>")); |
|---|
| 298 | end SISO; |
|---|
| 299 | |
|---|
| 300 | partial block SI2SO |
|---|
| 301 | "2 Single Input / 1 Single Output continuous control block" |
|---|
| 302 | extends BlockIcon; |
|---|
| 303 | |
|---|
| 304 | RealInput u1 "Connector of Real input signal 1" |
|---|
| 305 | annotation (extent=[-140, 40; -100, 80]); |
|---|
| 306 | RealInput u2 "Connector of Real input signal 2" |
|---|
| 307 | annotation (extent=[-140, -80; -100, -40]); |
|---|
| 308 | RealOutput y "Connector of Real output signal" |
|---|
| 309 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 310 | |
|---|
| 311 | annotation ( |
|---|
| 312 | Coordsys( |
|---|
| 313 | extent=[-100, -100; 100, 100], |
|---|
| 314 | grid=[2, 2], |
|---|
| 315 | component=[20, 20]), |
|---|
| 316 | Window( |
|---|
| 317 | x=0.31, |
|---|
| 318 | y=0.07, |
|---|
| 319 | width=0.6, |
|---|
| 320 | height=0.6), |
|---|
| 321 | Documentation(info="<html> |
|---|
| 322 | <p> |
|---|
| 323 | Block has two continuous Real input signals u1 and u2 and one |
|---|
| 324 | continuous Real output signal y. |
|---|
| 325 | </p> |
|---|
| 326 | </html>"), |
|---|
| 327 | Diagram); |
|---|
| 328 | end SI2SO; |
|---|
| 329 | |
|---|
| 330 | partial block SIMO "Single Input Multiple Output continuous control block" |
|---|
| 331 | extends BlockIcon; |
|---|
| 332 | parameter Integer nout=1 "Number of outputs"; |
|---|
| 333 | RealInput u "Connector of Real input signal" |
|---|
| 334 | annotation (extent=[-140, -20; -100, 20]); |
|---|
| 335 | RealOutput y[nout] "Connector of Real output signals" |
|---|
| 336 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 337 | |
|---|
| 338 | annotation (Documentation(info="<HTML> |
|---|
| 339 | <p> Block has one continuous Real input signal and a |
|---|
| 340 | vector of continuous Real output signals.</p> |
|---|
| 341 | |
|---|
| 342 | </HTML> |
|---|
| 343 | ")); |
|---|
| 344 | end SIMO; |
|---|
| 345 | |
|---|
| 346 | partial block MISO "Multiple Input Single Output continuous control block" |
|---|
| 347 | |
|---|
| 348 | extends BlockIcon; |
|---|
| 349 | parameter Integer nin=1 "Number of inputs"; |
|---|
| 350 | RealInput u[nin] "Connector of Real input signals" |
|---|
| 351 | annotation (extent=[-140, -20; -100, 20]); |
|---|
| 352 | RealOutput y "Connector of Real output signal" |
|---|
| 353 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 354 | annotation (Documentation(info="<HTML> |
|---|
| 355 | <p> |
|---|
| 356 | Block has a vector of continuous Real input signals and |
|---|
| 357 | one continuous Real output signal. |
|---|
| 358 | </p> |
|---|
| 359 | </HTML> |
|---|
| 360 | ")); |
|---|
| 361 | end MISO; |
|---|
| 362 | |
|---|
| 363 | partial block MIMO |
|---|
| 364 | "Multiple Input Multiple Output continuous control block" |
|---|
| 365 | |
|---|
| 366 | extends BlockIcon; |
|---|
| 367 | parameter Integer nin=1 "Number of inputs"; |
|---|
| 368 | parameter Integer nout=1 "Number of outputs"; |
|---|
| 369 | RealInput u[nin] "Connector of Real input signals" |
|---|
| 370 | annotation (extent=[-140, -20; -100, 20]); |
|---|
| 371 | RealOutput y[nout] "Connector of Real output signals" |
|---|
| 372 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 373 | annotation (Documentation(info="<HTML> |
|---|
| 374 | <p> |
|---|
| 375 | Block has a continuous Real input and a continuous Real output signal vector. |
|---|
| 376 | The signal sizes of the input and output vector may be different. |
|---|
| 377 | </p> |
|---|
| 378 | </HTML> |
|---|
| 379 | ")); |
|---|
| 380 | end MIMO; |
|---|
| 381 | |
|---|
| 382 | partial block MIMOs |
|---|
| 383 | "Multiple Input Multiple Output continuous control block with same number of inputs and outputs" |
|---|
| 384 | |
|---|
| 385 | extends BlockIcon; |
|---|
| 386 | parameter Integer n=1 "Number of inputs (= number of outputs)"; |
|---|
| 387 | RealInput u[n] "Connector of Real input signals" |
|---|
| 388 | annotation (extent=[-140, -20; -100, 20]); |
|---|
| 389 | RealOutput y[n] "Connector of Real output signals" |
|---|
| 390 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 391 | annotation ( |
|---|
| 392 | Documentation(info="<HTML> |
|---|
| 393 | <p> |
|---|
| 394 | Block has a continuous Real input and a continuous Real output signal vector |
|---|
| 395 | where the signal sizes of the input and output vector are identical. |
|---|
| 396 | </p> |
|---|
| 397 | </HTML> |
|---|
| 398 | "), Coordsys( |
|---|
| 399 | extent=[-100, -100; 100, 100], |
|---|
| 400 | grid=[2, 2], |
|---|
| 401 | component=[20, 20]), |
|---|
| 402 | Window( |
|---|
| 403 | x=0.28, |
|---|
| 404 | y=0.16, |
|---|
| 405 | width=0.6, |
|---|
| 406 | height=0.6)); |
|---|
| 407 | end MIMOs; |
|---|
| 408 | |
|---|
| 409 | partial block MI2MO |
|---|
| 410 | "2 Multiple Input / Multiple Output continuous control block" |
|---|
| 411 | extends BlockIcon; |
|---|
| 412 | |
|---|
| 413 | parameter Integer n=1 "Dimension of input and output vectors."; |
|---|
| 414 | |
|---|
| 415 | RealInput u1[n] "Connector 1 of Real input signals" |
|---|
| 416 | annotation (extent=[-140, 40; -100, 80]); |
|---|
| 417 | RealInput u2[n] "Connector 2 of Real input signals" |
|---|
| 418 | annotation (extent=[-140, -80; -100, -40]); |
|---|
| 419 | RealOutput y[n] "Connector of Real output signals" |
|---|
| 420 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 421 | annotation ( |
|---|
| 422 | Coordsys( |
|---|
| 423 | extent=[-100, -100; 100, 100], |
|---|
| 424 | grid=[2, 2], |
|---|
| 425 | component=[20, 20]), |
|---|
| 426 | Window( |
|---|
| 427 | x=0.31, |
|---|
| 428 | y=0.07, |
|---|
| 429 | width=0.6, |
|---|
| 430 | height=0.6), |
|---|
| 431 | Documentation(info="<html> |
|---|
| 432 | <p> |
|---|
| 433 | Block has two continuous Real input vectors u1 and u2 and one |
|---|
| 434 | continuous Real output vector y. |
|---|
| 435 | All vectors have the same number of elements. |
|---|
| 436 | </p> |
|---|
| 437 | </html>"), |
|---|
| 438 | Diagram); |
|---|
| 439 | end MI2MO; |
|---|
| 440 | |
|---|
| 441 | partial block SignalSource "Base class for continuous signal source" |
|---|
| 442 | extends SO; |
|---|
| 443 | parameter Real offset=0 "Offset of output signal y"; |
|---|
| 444 | parameter SIunits.Time startTime=0 |
|---|
| 445 | "Output y = offset for time < startTime"; |
|---|
| 446 | annotation (Documentation(info="<html> |
|---|
| 447 | <p> |
|---|
| 448 | Basic block for Real sources of package Blocks.Sources. |
|---|
| 449 | This component has one continuous Real output signal y |
|---|
| 450 | and two parameters (offset, startTime) to shift the |
|---|
| 451 | generated signal. |
|---|
| 452 | </p> |
|---|
| 453 | </html>")); |
|---|
| 454 | end SignalSource; |
|---|
| 455 | |
|---|
| 456 | partial block SVcontrol "Single-Variable continuous controller" |
|---|
| 457 | extends BlockIcon; |
|---|
| 458 | |
|---|
| 459 | RealInput u_s "Connector of setpoint input signal" |
|---|
| 460 | annotation (extent=[-140, -20; -100, 20]); |
|---|
| 461 | RealInput u_m "Connector of measurement input signal" |
|---|
| 462 | annotation (extent=[20, -100; -20, -140], rotation=-90); |
|---|
| 463 | RealOutput y "Connector of actuator output signal" |
|---|
| 464 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 465 | annotation ( |
|---|
| 466 | Diagram( |
|---|
| 467 | Text(extent=[-102, 34; -142, 24], string="(setpoint)"), |
|---|
| 468 | Text(extent=[100, 24; 140, 14], string="(actuator)"), |
|---|
| 469 | Text(extent=[-83, -112; -33, -102], string=" (measurement)")), |
|---|
| 470 | Coordsys( |
|---|
| 471 | extent=[-100, -100; 100, 100], |
|---|
| 472 | grid=[2, 2], |
|---|
| 473 | component=[20, 20]), |
|---|
| 474 | Window( |
|---|
| 475 | x=0.19, |
|---|
| 476 | y=0.21, |
|---|
| 477 | width=0.6, |
|---|
| 478 | height=0.46), |
|---|
| 479 | Documentation(info="<html> |
|---|
| 480 | <p> |
|---|
| 481 | Block has two continuous Real input signals and one |
|---|
| 482 | continuous Real output signal. The block is designed |
|---|
| 483 | to be used as base class for a corresponding controller. |
|---|
| 484 | </p> |
|---|
| 485 | </html>")); |
|---|
| 486 | end SVcontrol; |
|---|
| 487 | |
|---|
| 488 | partial block MVcontrol "Multi-Variable continuous controller" |
|---|
| 489 | extends BlockIcon; |
|---|
| 490 | |
|---|
| 491 | parameter Integer nu_s=1 "Number of setpoint inputs"; |
|---|
| 492 | parameter Integer nu_m=1 "Number of measurement inputs"; |
|---|
| 493 | parameter Integer ny=1 "Number of actuator outputs"; |
|---|
| 494 | RealInput u_s[nu_s] "Connector of setpoint input signals" |
|---|
| 495 | annotation (extent=[-140, -20; -100, 20]); |
|---|
| 496 | RealInput u_m[nu_m] "Connector of measurement input signals" |
|---|
| 497 | annotation (extent=[20, -100; -20, -140], rotation=-90); |
|---|
| 498 | RealOutput y[ny] "Connector of actuator output signals" |
|---|
| 499 | annotation (extent=[100, -10; 120, 10]); |
|---|
| 500 | annotation ( |
|---|
| 501 | Diagram( |
|---|
| 502 | Text(extent=[-100, 36; -140, 26], string="(setpoint)"), |
|---|
| 503 | Text(extent=[102, 24; 142, 14], string="(actuator)"), |
|---|
| 504 | Text(extent=[-75, -108; -25, -98], string=" (measurement)")), |
|---|
| 505 | Coordsys( |
|---|
| 506 | extent=[-100, -100; 100, 100], |
|---|
| 507 | grid=[2, 2], |
|---|
| 508 | component=[20, 20]), |
|---|
| 509 | Window( |
|---|
| 510 | x=0.26, |
|---|
| 511 | y=0.19, |
|---|
| 512 | width=0.6, |
|---|
| 513 | height=0.6), |
|---|
| 514 | Documentation(info="<html> |
|---|
| 515 | <p> |
|---|
| 516 | Block has two continuous Real input signal vectors and one |
|---|
| 517 | continuous Real output signal vector. The block is designed |
|---|
| 518 | to be used as base class for a corresponding controller. |
|---|
| 519 | </p> |
|---|
| 520 | </html>")); |
|---|
| 521 | end MVcontrol; |
|---|
| 522 | |
|---|
| 523 | partial block DiscreteBlockIcon |
|---|
| 524 | "Graphical layout of discrete block component icon" |
|---|
| 525 | |
|---|
| 526 | annotation (Icon(Rectangle(extent=[-100, -100; 100, 100], style(color=3, |
|---|
| 527 | fillColor=52)), Text(extent=[-150, 150; 150, 110], string= |
|---|
| 528 | "%name")), Documentation(info="<html> |
|---|
| 529 | <p> |
|---|
| 530 | Block that has only the basic icon for an input/output, |
|---|
| 531 | discrete block (no declarations, no equations), e.g., |
|---|
| 532 | from Blocks.Discrete. |
|---|
| 533 | </p> |
|---|
| 534 | </html>")); |
|---|
| 535 | equation |
|---|
| 536 | |
|---|
| 537 | end DiscreteBlockIcon; |
|---|
| 538 | |
|---|
| 539 | partial block DiscreteBlock "Base class of discrete control blocks" |
|---|
| 540 | extends DiscreteBlockIcon; |
|---|
| 541 | |
|---|
| 542 | parameter SI.Time samplePeriod(min=100*Modelica.Constants.eps) = 0.1 |
|---|
| 543 | "Sample period of component"; |
|---|
| 544 | parameter SI.Time startTime=0 "First sample time instant"; |
|---|
| 545 | protected |
|---|
| 546 | output Boolean sampleTrigger "True, if sample time instant"; |
|---|
| 547 | output Boolean firstTrigger "Rising edge signals first sample instant"; |
|---|
| 548 | equation |
|---|
| 549 | sampleTrigger = sample(startTime, samplePeriod); |
|---|
| 550 | when sampleTrigger then |
|---|
| 551 | firstTrigger = time <= startTime + samplePeriod/2; |
|---|
| 552 | end when; |
|---|
| 553 | annotation (Documentation(info="<html> |
|---|
| 554 | <p> |
|---|
| 555 | Basic definitions of a discrete block of library |
|---|
| 556 | Blocks.Discrete. |
|---|
| 557 | </p> |
|---|
| 558 | </html>")); |
|---|
| 559 | end DiscreteBlock; |
|---|
| 560 | |
|---|
| 561 | partial block DiscreteSISO |
|---|
| 562 | "Single Input Single Output discrete control block" |
|---|
| 563 | |
|---|
| 564 | extends DiscreteBlock; |
|---|
| 565 | |
|---|
| 566 | Modelica.Blocks.Interfaces.RealInput u "Continuous input signal" |
|---|
| 567 | annotation (extent=[-140, |
|---|
| 568 | -20; -100, 20]); |
|---|
| 569 | Modelica.Blocks.Interfaces.RealOutput y "Continuous output signal" |
|---|
| 570 | annotation (extent=[100, |
|---|
| 571 | -10; 120, 10]); |
|---|
| 572 | annotation (Documentation(info="<html> |
|---|
| 573 | <p> |
|---|
| 574 | Block has one continuous input and one continuous output signal |
|---|
| 575 | which are sampled due to the defined <b>samplePeriod</b> parameter. |
|---|
| 576 | </p> |
|---|
| 577 | </html>")); |
|---|
| 578 | end DiscreteSISO; |
|---|
| 579 | |
|---|
| 580 | partial block DiscreteMIMO |
|---|
| 581 | "Multiple Input Multiple Output discrete control block" |
|---|
| 582 | |
|---|
| 583 | extends DiscreteBlock; |
|---|
| 584 | parameter Integer nin=1 "Number of inputs"; |
|---|
| 585 | parameter Integer nout=1 "Number of outputs"; |
|---|
| 586 | |
|---|
| 587 | Modelica.Blocks.Interfaces.RealInput u[nin] "Continuous input signals" |
|---|
| 588 | annotation (extent=[-140, |
|---|
| 589 | -20; -100, 20]); |
|---|
| 590 | Modelica.Blocks.Interfaces.RealOutput y[nout] "Continuous output signals" |
|---|
| 591 | annotation (extent=[100, |
|---|
| 592 | -10; 120, 10]); |
|---|
| 593 | |
|---|
| 594 | annotation (Documentation(info="<html> |
|---|
| 595 | <p> |
|---|
| 596 | Block has a continuous input and a continuous output signal vector |
|---|
| 597 | which are sampled due to the defined <b>samplePeriod</b> parameter. |
|---|
| 598 | </p> |
|---|
| 599 | </HTML> |
|---|
| 600 | ")); |
|---|
| 601 | end DiscreteMIMO; |
|---|
| 602 | |
|---|
| 603 | partial block DiscreteMIMOs |
|---|
| 604 | "Multiple Input Multiple Output discrete control block" |
|---|
| 605 | parameter Integer n=1 "Number of inputs (= number of outputs)"; |
|---|
| 606 | extends DiscreteBlock; |
|---|
| 607 | |
|---|
| 608 | Modelica.Blocks.Interfaces.RealInput u[n] "Continuous input signals" |
|---|
| 609 | annotation (extent=[-140, |
|---|
| 610 | -20; -100, 20]); |
|---|
| 611 | Modelica.Blocks.Interfaces.RealOutput y[n] "Continuous output signals" |
|---|
| 612 | annotation (extent=[100, |
|---|
| 613 | -10; 120, 10]); |
|---|
| 614 | |
|---|
| 615 | annotation (Documentation(info="<html> |
|---|
| 616 | <p> |
|---|
| 617 | Block has a continuous input and a continuous output signal vector |
|---|
| 618 | where the signal sizes of the input and output vector are identical. |
|---|
| 619 | These signals are sampled due to the defined <b>samplePeriod</b> parameter. |
|---|
| 620 | </p> |
|---|
| 621 | </HTML> |
|---|
| 622 | ")); |
|---|
| 623 | |
|---|
| 624 | end DiscreteMIMOs; |
|---|
| 625 | |
|---|
| 626 | partial block SVdiscrete "Discrete Single-Variable controller" |
|---|
| 627 | extends DiscreteBlock; |
|---|
| 628 | |
|---|
| 629 | Discrete.Sampler sampler_s( |
|---|
| 630 | final samplePeriod=samplePeriod, |
|---|
| 631 | final startTime=startTime) annotation (extent=[-100, -10; -80, 10]); |
|---|
| 632 | Discrete.Sampler sampler_m( |
|---|
| 633 | final samplePeriod=samplePeriod, |
|---|
| 634 | final startTime=startTime) annotation (extent=[-10, -100; 10, -80], |
|---|
| 635 | rotation=90); |
|---|
| 636 | Modelica.Blocks.Interfaces.RealInput u_s |
|---|
| 637 | "Continuous scalar setpoint input signal" annotation (extent=[-140, -20; - |
|---|
| 638 | 100, 20]); |
|---|
| 639 | Modelica.Blocks.Interfaces.RealInput u_m |
|---|
| 640 | "Continuous scalar measurement input signal" annotation (extent=[20, -100; - |
|---|
| 641 | 20, -140], rotation=-90); |
|---|
| 642 | Modelica.Blocks.Interfaces.RealOutput y |
|---|
| 643 | "Continuous scalar actuator output signal" annotation (extent=[100, -10; 120, |
|---|
| 644 | 10]); |
|---|
| 645 | annotation (Diagram( |
|---|
| 646 | Text( |
|---|
| 647 | extent=[-100, 34; -140, |
|---|