Commit | Line | Data |
---|---|---|
970ed795 EL |
1 | <!-- |
2 | Copyright (c) 2000-2014 Ericsson Telecom AB | |
3 | ||
4 | All rights reserved. This program and the accompanying materials | |
5 | are made available under the terms of the Eclipse Public License v1.0 | |
6 | which accompanies this distribution, and is available at | |
7 | http://www.eclipse.org/legal/epl-v10.html | |
8 | --> | |
9 | <html> | |
10 | <head> | |
11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
12 | <meta http-equiv="Content-Language" content="en-us"> | |
13 | <title>timer</title> | |
14 | </head> | |
15 | <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> | |
16 | <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> | |
17 | <tr> | |
18 | <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td> | |
19 | </tr> | |
20 | </table> | |
21 | <table border="0" align="right" cellpadding="0" cellspacing="0"> | |
22 | <tr> | |
23 | <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> | |
24 | <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> | |
25 | <td><a href="timeout.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> | |
26 | <td><a href="to.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> | |
27 | </tr> | |
28 | </table> | |
29 | <p><br clear="all"> | |
30 | </p> | |
31 | <hr> | |
32 | <h1>timer</h1> | |
33 | <hr align="left" width="75%"> | |
34 | <p>The keyword is used to declare timers in the module control part, test cases, functions and altsteps. These timers are considered as local. <br> | |
35 | Additionally, global timers can be declared in component type definitions.</p> | |
36 | <ul> | |
37 | <li>A timer declaration may have an <a href="#default">optional default duration</a> value assigned to it.</li> | |
38 | <li>It is possible to declare <a href="#several">several timers</a> with one keyword.</li> | |
39 | </ul> | |
40 | <p>Related keywords:</p> | |
41 | <ul> | |
42 | <li><a href="read.html"><b><font face="Courier New" color="#003258" size="4">read</font></b></a></li> | |
43 | <li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a></li> | |
44 | <li><a href="start.html"><b><font face="Courier New" color="#003258" size="4">start</font></b></a></li> | |
45 | <li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li> | |
46 | <li><a href="timeout.html"><b><font face="Courier New" color="#003258" size="4">timeout</font></b></a></li> | |
47 | </ul> | |
48 | <hr align="left" width="50%"> | |
49 | <div align="center"> | |
50 | <center> | |
51 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
52 | <tr> | |
53 | <td width="100%"> | |
54 | <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>timer </b></font><i>timer_identifier</i> [<font face="Courier New" color="#003258" size="5"><b>:=</b></font> <i>default_value</i> | |
55 | ]<font face="Courier New" color="#003258" size="5"><b>;</b></font></h3> | |
56 | </td> | |
57 | </tr> | |
58 | </table> | |
59 | </center> | |
60 | </div> | |
61 | <ul> | |
62 | <li> | |
63 | <p><i>timer_identifier</i> is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.<br> | |
64 | According to the Naming convention, the following prefixes are recommended: | |
65 | <ul> | |
66 | <li><b>T_</b> for timers declared within component type definitions,</li> | |
67 | <li> | |
68 | <p><b>Tl_</b> for timers declared in test cases, functions, altsteps, block of statements or in the control part.</p> | |
69 | </li> | |
70 | </ul> | |
71 | </li> | |
72 | <li><i>default_value</i> optionally states the value of the timer in seconds unless otherwise given in the statement <a href="start.html"> <b><font face="Courier New" color="#003258" | |
73 | size="4">start</font></b></a>.<br> | |
74 | <a href="float.html"><b><font face="Courier New" color="#003258" size="4">Float</font></b></a>ing point values must be used.</li> | |
75 | </ul> | |
76 | <hr align="left" width="75%" color="#0094D2"> | |
77 | <p>It is possible to define an <a href="#array">array of timers</a>.</p> | |
78 | <hr align="left" width="50%" color="#0094D2"> | |
79 | <div align="center"> | |
80 | <center> | |
81 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
82 | <tr> | |
83 | <td width="100%"> | |
84 | <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>timer</b></font> <i>timer_identifier</i> <font face="Courier New" color="#003258" size="5"><b>[</b></font><i>array_dimension</i><font | |
85 | face="Courier New" color="#003258" size="5"><b>]</b></font> [<font face="Courier New" color="#003258" size="5"><b>:=</b></font> <i>default_value_list</i> ]<font face="Courier New" | |
86 | color="#003258" size="5"><b>;</b></font></h3> | |
87 | </td> | |
88 | </tr> | |
89 | </table> | |
90 | </center> | |
91 | </div> | |
92 | <div align="center"></div> | |
93 | <ul> | |
94 | <li> | |
95 | <p><i>timer_identifier</i> is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.</p> | |
96 | </li> | |
97 | <li> | |
98 | <p><i>array_dimension</i> gives the number of timers to be defined.</p> | |
99 | </li> | |
100 | <li><i>default_value</i> optionally states the value array of the timers in seconds unless otherwise given in the statement <b><a href="start.html"><font face="Courier New" | |
101 | color="#003258" size="4">start</font></a></b>.<br> | |
102 | <a href="float.html"><b><font face="Courier New" color="#003258" size="4">Float</font></b></a>ing point values must be used.</li> | |
103 | </ul> | |
104 | <hr align="left" width="50%"> | |
105 | <p>Example 1: | |
106 | <p><font face="Courier New">timer T_tidsoevervakning;<br> | |
107 | </font> | |
108 | <p>The global timer T_tidsoevervakning is declared.</p> | |
109 | <hr align="left" width="50%"> | |
110 | <p><a name="default">Example 2:</a> | |
111 | <p><font face="Courier New">timer Tl_tiempo := 5.5E-2;<br> | |
112 | </font> | |
113 | <p>The local timer Tl_tiempo is declared and given the initial value 55 ms.</p> | |
114 | <hr align="left" width="50%"> | |
115 | <p><a name="several">Example 3</a>: | |
116 | <p><font face="Courier New">timer T_tempilo := 5E-3, T_tijd;<br> | |
117 | </font> | |
118 | <p>Two global timers are defined. T_tempilo gets the default value of 5 ms, whereas T_tijd has no default value.</p> | |
119 | <hr align="left" width="50%"> | |
120 | <p><a name="array">Example 4:</a> | |
121 | <p><font face="Courier New">timer Tl_temporisation[4] := {-, 1E-1, -, -, -};<br> | |
122 | </font> | |
123 | <p>The array of local timers declared is called Tl_temporisation and consists of five timers. The second timer has the default value of 100 ms, the others have no default value. </p> | |
124 | <hr align="left" width="25%"> | |
125 | <hr align="left" width="25%"> | |
126 | <p><a HREF="BNF.html#timerinstance">BNF definition</a> of <font face="Courier New">timer</font></p> | |
127 | </body> | |
128 | </html> |