| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
on |
| 17 |
|
| 18 |
<html> |
| 19 |
<head> |
| 20 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 21 |
<meta http-equiv="Content-Language" content="en-us"> |
| 22 |
<title>start</title> |
| 23 |
</head> |
| 24 |
<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> |
| 25 |
<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> |
| 26 |
<tr> |
| 27 |
<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> |
| 28 |
</tr> |
| 29 |
</table> |
| 30 |
<table border="0" align="right" cellpadding="0" cellspacing="0"> |
| 31 |
<tr> |
| 32 |
<td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> |
| 33 |
<td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> |
| 34 |
<td><a href="sizeof.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> |
| 35 |
<td><a href="stop.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> |
| 36 |
</tr> |
| 37 |
</table> |
| 38 |
<p><br clear="all"> |
| 39 |
</p> |
| 40 |
<hr> |
| 41 |
<h1>start</h1> |
| 42 |
<blockquote> |
| 43 |
<p>1. <a href="#1"> Starting a component</a></p> |
| 44 |
<p>2. <a href="#Starting a port">Starting a port</a></p> |
| 45 |
<p>3. <a href="##1">Starting a timer</a></p> |
| 46 |
<p>4. <a href="profiler.html#2">Starting the profiler</a></p> |
| 47 |
</blockquote> |
| 48 |
<hr align="left" width="75%"> |
| 49 |
<h3>1. <a name="#1">Starting a component</a></h3> |
| 50 |
<hr align="left" width="50%"> |
| 51 |
<p>When a parallel test component is created it is not executing any behavior yet. |
| 52 |
<p>The start operation can be used to execute the required function on the addressed <a href="#component_start">parallel test component</a>.</p> |
| 53 |
<p>The function will be executed remotely, thus the start operation does not block execution on the component on which it was invoked. |
| 54 |
<p>Normal parallel test components can only be started once, but alive parallel test components may execute several functions consecutively. |
| 55 |
<P>Some limitations apply to the argument function: |
| 56 |
<ul> |
| 57 |
<li>it shall either have a <a href="on.html"><b><font face="Courier New" color="#003258" size="4">runs on</font></b></a> clause referencing the same component type as the newly created |
| 58 |
component, or must not have a runs on clause at all;</li> |
| 59 |
<li>it may only have value (<b><font face="Courier New"><a href="function.html#inout">in</a></font></b>) parameters;</li> |
| 60 |
<li>it must not have a return clause (as an extension to TTCN-3 standard, TITAN permits returning a value from a function executed on a parallel test component; see "value-returning |
| 61 |
done" in TITAN Programmers' Reference Guide); |
| 62 |
<li>port and timer parameters shall not be passed to this function (as an extension to TTCN-3 standard, TITAN relieves this limitation)</li> |
| 63 |
</ul> |
| 64 |
<p>Related keywords:</p> |
| 65 |
<ul> |
| 66 |
<li><a href="alive.html"><b><font face="Courier New" color="#003258" size="4">alive</font></b></a></li> |
| 67 |
<li><a href="component.html"><b><font face="Courier New" color="#003258" size="4">component</font></b></a></li> |
| 68 |
<li><a href="done.html"><b><font face="Courier New" color="#003258" size="4">done</font></b></a></li> |
| 69 |
<li><a href="function.html"><b><font face="Courier New" color="#003258" size="4">function</font></b></a></li> |
| 70 |
<li><a href="kill.html"><b><font face="Courier New" color="#003258" size="4">kill</font></b></a></li> |
| 71 |
<li><a href="killed.html"><b><font face="Courier New" color="#003258" size="4">killed</font></b></a></li> |
| 72 |
<li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a></li> |
| 73 |
<li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li> |
| 74 |
<li><a href="profiler.html"><b><font face="Courier New" color="#003258" size="4">@profiler</font></b></a></li> |
| 75 |
</ul> |
| 76 |
<hr align="left" width="50%"> |
| 77 |
<div align="center"> |
| 78 |
<center> |
| 79 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 80 |
<tr> |
| 81 |
<td width="100%"> |
| 82 |
<h3 align="center"><i>component_identifier</i><font face="Courier New" color="#003258" size="5"><b>.start(</b></font><i>behavior_function</i> <font face="Courier New" color="#003258" size="5"><b>(</b></font> |
| 83 |
[ <i>function_parameter</i> ] <font face="Courier New" color="#003258" size="5"><b>)</b></font><font face="Courier New" color="#003258" size="5"><b>;</b></font></h3> |
| 84 |
</td> |
| 85 |
</tr> |
| 86 |
</table> |
| 87 |
</center> |
| 88 |
</div> |
| 89 |
<ul> |
| 90 |
<li> |
| 91 |
<p><i>component_identifier</i> is the name used to refer to the component to be started.</p> |
| 92 |
</li> |
| 93 |
<li> |
| 94 |
<p><i>behavior_function</i> is the function describing the test component behavior.</p> |
| 95 |
</li> |
| 96 |
<li> |
| 97 |
<p><i>function_parameter</i> specifies actual parameters of the function</p> |
| 98 |
</li> |
| 99 |
</ul> |
| 100 |
<hr align="left" width="75%"> |
| 101 |
<h3>2. <a name="Starting a port">Starting a port</a></h3> |
| 102 |
<hr align="left" width="50%"> |
| 103 |
<p>The keyword may be used to start a <a href="#Example 2a">port</a>.</p> |
| 104 |
<ul> |
| 105 |
<li>By default, all ports of a component shall be started implicitly when a component is created.</li> |
| 106 |
<li>The start operation clears the incoming queue of the named port and starts listening for traffic over the port (incoming ports)</li> |
| 107 |
<li>The start operation allows sending operations (outgoing ports)</li> |
| 108 |
<li>The start port operation will cause unstopped ports to be restarted by removing all messages waiting in the incoming queue.</li> |
| 109 |
<li>It is possible to start all defined ports.</li> |
| 110 |
</ul> |
| 111 |
<p>Related keywords:</p> |
| 112 |
<ul> |
| 113 |
<li><a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a></li> |
| 114 |
<li><a href="port.html"><b><font face="Courier New" color="#003258" size="4">port</font></b></a></li> |
| 115 |
</ul> |
| 116 |
<hr align="left" width="50%"> |
| 117 |
<div align="center"> |
| 118 |
<center> |
| 119 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 120 |
<tr> |
| 121 |
<td width="100%"> |
| 122 |
<h3 align="center"><i>port_reference</i><font face="Courier New" color="#003258" size="5"><b>.start;</b></font></h3> |
| 123 |
</td> |
| 124 |
</tr> |
| 125 |
</table> |
| 126 |
</center> |
| 127 |
</div> |
| 128 |
<ul> |
| 129 |
<li> |
| 130 |
<p><i> port_reference</i> points out the port to be started.</p> |
| 131 |
<ul> |
| 132 |
<li> |
| 133 |
<p>the keywords <b><font face="Courier New" color="#003258" size="4">all port</font> </b> may be used to indicate that all defined ports must be started (see the <a href="#Example 2b">example |
| 134 |
2b</a>).</p> |
| 135 |
</li> |
| 136 |
</ul> |
| 137 |
</li> |
| 138 |
<li> |
| 139 |
<p>The <b><font face="Courier New" color="#003258" size="4">start</font> </b> keyword introduces port starting.</p> |
| 140 |
</li> |
| 141 |
</ul> |
| 142 |
<hr align="left" width="75%"> |
| 143 |
<h3>3. <a name="timer">Starting a timer</a></h3> |
| 144 |
<hr align="left" width="50%"> |
| 145 |
<p>The keyword may be used to indicate that a <a href="#timer_start">timer should start running</a>.</p> |
| 146 |
<ul> |
| 147 |
<li>The <a href="#default">optional timer value</a> shall be a non-negative float number (i.e. greater or equal 0.0). It overrides the value given in the timer declaration.</li> |
| 148 |
<li>The operation may be applied to a running timer, in which case the timer is stopped and re-started.</li> |
| 149 |
</ul> |
| 150 |
<p>Related keywords:</p> |
| 151 |
<ul> |
| 152 |
<li><a href="read.html"><b><font face="Courier New" color="#003258" size="4">read</font></b></a></li> |
| 153 |
<li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a></li> |
| 154 |
<li><a href="timer.html"><b><font face="Courier New" color="#003258" size="4">timer</font></b></a></li> |
| 155 |
<li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li> |
| 156 |
<li><a href="timeout.html"><b><font face="Courier New" color="#003258" size="4">timeout</font></b></a></li> |
| 157 |
</ul> |
| 158 |
<hr align="left" width="50%"> |
| 159 |
<div align="center"> |
| 160 |
<center> |
| 161 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 162 |
<tr> |
| 163 |
<td width="100%"> |
| 164 |
<h3 align="center"><i>timer_identifier</i><font face="Courier New" color="#003258" size="5"><b>.start</b></font> [<font face="Courier New" color="#003258" size="5"><b>(</b></font> <i>timer_value</i> |
| 165 |
<font face="Courier New" color="#003258" size="5"><b>)</b></font>]<font face="Courier New" color="#003258" size="5"><b>;</b></font></h3> |
| 166 |
</td> |
| 167 |
</tr> |
| 168 |
</table> |
| 169 |
</center> |
| 170 |
</div> |
| 171 |
<ul> |
| 172 |
<li> |
| 173 |
<p><i>timer_identifier</i> is the name used to refer to the timer.</p> |
| 174 |
</li> |
| 175 |
<li><i>timer_value</i> is mandatory when no default value was defined in the <a href="timer.html"><b><font face="Courier New" color="#003258" size="4">timer</font></b></a> declaration. |
| 176 |
Otherwise it is optional and overwrites the default value. The value is measured in seconds; <a href="float.html"><b><font face="Courier New" color="#003258" size="4">float</font></b></a>ing point |
| 177 |
value must be used.</li> |
| 178 |
</ul> |
| 179 |
<hr align="left" width="50%"/> |
| 180 |
<p>It is possible to start a member of an <a href="#array">timer array</a>.</p> |
| 181 |
<hr align="left" width="50%"/> |
| 182 |
<div align="center"> |
| 183 |
<center> |
| 184 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 185 |
<tr> |
| 186 |
<td width="100%"> |
| 187 |
<h3 align="center"><font face="Courier New" color="#003258" size="5"><b></b></font> <i>timer_identifier</i><font face="Courier New" color="#003258" size="5"><b>[</b></font><i>array_index</i><font |
| 188 |
face="Courier New" color="#003258" size="5"><b>].start </b></font>[<font face="Courier New" color="#003258" size="5"><b>(</b></font> <i>timer_value</i> <font face="Courier New" color="#003258" |
| 189 |
size="5"><b>)</b></font> ]<font face="Courier New" color="#003258" size="5"><b>;</b></font></h3> |
| 190 |
</td> |
| 191 |
</tr> |
| 192 |
</table> |
| 193 |
</center> |
| 194 |
</div> |
| 195 |
<div align="center"></div> |
| 196 |
<ul> |
| 197 |
<li> |
| 198 |
<p><i>timer_identifier</i> is the name used to refer to the timer.</p> |
| 199 |
</li> |
| 200 |
<li> |
| 201 |
<p><i>array_index</i> points out the timer to be started.</p> |
| 202 |
</li> |
| 203 |
<li><i>timer_value</i> is mandatory when no default value was defined in the <a href="timer.html"><b><font face="Courier New" color="#003258" size="4">timer</font></b></a> declaration. |
| 204 |
Otherwise it is optional and overwrites the default value. The value is measured in seconds; <a href="float.html"><b><font face="Courier New" color="#003258" size="4">float</font></b></a>ing point |
| 205 |
value must be used.</li> |
| 206 |
</ul> |
| 207 |
<hr align="left" width="50%"> |
| 208 |
<p><a name="component_start">Example 1</a></p> |
| 209 |
<p><font face="Courier New">vc_vertrek.start(f_beteende()); </font> |
| 210 |
<p>The behavior described by the function f_beteende is started on the component with the reference vc_vertrek.</p> |
| 211 |
<p> </p> |
| 212 |
<hr align="left" width="50%"> |
| 213 |
<p><a name="Example 2a">Example 2a</a>: |
| 214 |
<p><font face="Courier New">Kapu_PCO.start;</font> |
| 215 |
<p>The port Kapu_PCO will be started.</p> |
| 216 |
<hr align="left" width="50%"> |
| 217 |
<p><a name="Example 2b">Example 2b</a>: |
| 218 |
<p><font face="Courier New">all port.start;</font> |
| 219 |
<p>All ports will be started.</p> |
| 220 |
<hr align="left" width="50%"> |
| 221 |
<p><a name="timer_start">Example 3a</a>: |
| 222 |
<p><font face="Courier New">timer T_recherche := 5E-3;<br> |
| 223 |
T_recherche.start;<br> |
| 224 |
</font> |
| 225 |
<p>The global timer T_recherche is declared (1st line) and started with the default duration (=5 ms; 2nd line).</p> |
| 226 |
<hr align="left" width="50%"> |
| 227 |
<p><a name="default">Example 3b:</a> |
| 228 |
<p><font face="Courier New">timer Tl_perdu;<br> |
| 229 |
Tl_perdu.start(20E-3); <br> |
| 230 |
</font> |
| 231 |
<p>The local timer Tl_perdu is declared (1st line) and started with a duration of 20 ms (2nd line).</p> |
| 232 |
<hr align="left" width="50%"> |
| 233 |
<p><a name="array">Example 3c:</a> |
| 234 |
<p><font face="Courier New">timer Tl_Denfert[2] := {-, 1E-1, -};<br> |
| 235 |
Tl_Denfert[1].start(20E-3); </font> |
| 236 |
<p>The array of local timers declared is called Tl_denfert and consists of three timers . The second timer has the default value of 100 ms, the others have no default value(1st |
| 237 |
line). The second timer in the array is started for 20 ms, overwriting the default value of 100 ms (2nd line).</p> |
| 238 |
<hr align="left" width="25%"> |
| 239 |
<hr align="left" width="25%"> |
| 240 |
<p><a HREF="BNF.html#starttcstatement">BNF definition</a> of <font face="Courier New">component start</font></p> |
| 241 |
<p><a HREF="BNF.html#starttimerstatement">BNF definition</a> of <font face="Courier New">timer start</font></p> |
| 242 |
</body> |
| 243 |
</html> |