Sync with 5.3.0
[deliverable/titan.core.git] / help / info / start.html
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>start</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="sizeof.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
26 <td><a href="stop.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>start</h1>
33 <blockquote>
34 <p>1. <a href="#1"> Starting a component</a></p>
35 <p>2. <a href="#Starting a port">Starting a port</a></p>
36 <p>3. <a href="##1">Starting a timer</a></p>
37 <p>4. <a href="profiler.html#2">Starting the profiler</a></p>
38 </blockquote>
39 <hr align="left" width="75%">
40 <h3>1. <a name="#1">Starting a component</a></h3>
41 <hr align="left" width="50%">
42 <p>When a parallel test component is created it is not executing any behavior yet.
43 <p>The start operation can be used to execute the required function on the addressed <a href="#component_start">parallel test component</a>.</p>
44 <p>The function will be executed remotely, thus the start operation does not block execution on the component on which it was invoked.
45 <p>Normal parallel test components can only be started once, but alive parallel test components may execute several functions consecutively.
46 <P>Some limitations apply to the argument function:
47 <ul>
48 <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
49 component, or must not have a runs on clause at all;</li>
50 <li>it may only have value (<b><font face="Courier New"><a href="function.html#inout">in</a></font></b>) parameters;</li>
51 <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 &quot;value-returning
52 done&quot; in TITAN Programmers' Reference Guide);
53 <li>port and timer parameters shall not be passed to this function (as an extension to TTCN-3 standard, TITAN relieves this limitation)</li>
54 </ul>
55 <p>Related keywords:</p>
56 <ul>
57 <li><a href="alive.html"><b><font face="Courier New" color="#003258" size="4">alive</font></b></a></li>
58 <li><a href="component.html"><b><font face="Courier New" color="#003258" size="4">component</font></b></a></li>
59 <li><a href="done.html"><b><font face="Courier New" color="#003258" size="4">done</font></b></a></li>
60 <li><a href="function.html"><b><font face="Courier New" color="#003258" size="4">function</font></b></a></li>
61 <li><a href="kill.html"><b><font face="Courier New" color="#003258" size="4">kill</font></b></a></li>
62 <li><a href="killed.html"><b><font face="Courier New" color="#003258" size="4">killed</font></b></a></li>
63 <li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a></li>
64 <li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li>
65 <li><a href="profiler.html"><b><font face="Courier New" color="#003258" size="4">@profiler</font></b></a></li>
66 </ul>
67 <hr align="left" width="50%">
68 <div align="center">
69 <center>
70 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
71 <tr>
72 <td width="100%">
73 <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>
74 [ <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>
75 </td>
76 </tr>
77 </table>
78 </center>
79 </div>
80 <ul>
81 <li>
82 <p><i>component_identifier</i> is the&nbsp;name used to refer to the component to be started.</p>
83 </li>
84 <li>
85 <p><i>behavior_function</i> is the function describing the test component behavior.</p>
86 </li>
87 <li>
88 <p><i>function_parameter</i> specifies actual parameters of the function</p>
89 </li>
90 </ul>
91 <hr align="left" width="75%">
92 <h3>2. <a name="Starting a port">Starting a port</a></h3>
93 <hr align="left" width="50%">
94 <p>The keyword may be used to start a <a href="#Example 2a">port</a>.</p>
95 <ul>
96 <li>By default, all ports of a component shall be started implicitly when a component is created.</li>
97 <li>The start operation clears the incoming queue of the named port and starts listening for traffic over the port (incoming ports)</li>
98 <li>The start operation allows sending operations (outgoing ports)</li>
99 <li>The start port operation will cause unstopped ports to be restarted by removing all messages waiting in the incoming queue.</li>
100 <li>It is possible to start all defined ports.</li>
101 </ul>
102 <p>Related keywords:</p>
103 <ul>
104 <li><a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a></li>
105 <li><a href="port.html"><b><font face="Courier New" color="#003258" size="4">port</font></b></a></li>
106 </ul>
107 <hr align="left" width="50%">
108 <div align="center">
109 <center>
110 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
111 <tr>
112 <td width="100%">
113 <h3 align="center"><i>port_reference</i><font face="Courier New" color="#003258" size="5"><b>.start;</b></font></h3>
114 </td>
115 </tr>
116 </table>
117 </center>
118 </div>
119 <ul>
120 <li>
121 <p><i> port_reference</i> points out the port to be started.</p>
122 <ul>
123 <li>
124 <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
125 2b</a>).</p>
126 </li>
127 </ul>
128 </li>
129 <li>
130 <p>The <b><font face="Courier New" color="#003258" size="4">start</font> </b> keyword introduces port starting.</p>
131 </li>
132 </ul>
133 <hr align="left" width="75%">
134 <h3>3. <a name="timer">Starting a timer</a></h3>
135 <hr align="left" width="50%">
136 <p>The keyword may be used to indicate that a <a href="#timer_start">timer should start running</a>.</p>
137 <ul>
138 <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>
139 <li>The operation may be applied to a running timer, in which case the timer is stopped and re-started.</li>
140 </ul>
141 <p>Related keywords:</p>
142 <ul>
143 <li><a href="read.html"><b><font face="Courier New" color="#003258" size="4">read</font></b></a></li>
144 <li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a></li>
145 <li><a href="timer.html"><b><font face="Courier New" color="#003258" size="4">timer</font></b></a></li>
146 <li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li>
147 <li><a href="timeout.html"><b><font face="Courier New" color="#003258" size="4">timeout</font></b></a></li>
148 </ul>
149 <hr align="left" width="50%">
150 <div align="center">
151 <center>
152 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
153 <tr>
154 <td width="100%">
155 <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>
156 <font face="Courier New" color="#003258" size="5"><b>)</b></font>]<font face="Courier New" color="#003258" size="5"><b>;</b></font></h3>
157 </td>
158 </tr>
159 </table>
160 </center>
161 </div>
162 <ul>
163 <li>
164 <p><i>timer_identifier</i> is the&nbsp;name used to refer to the timer.</p>
165 </li>
166 <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.
167 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
168 value must be used.</li>
169 </ul>
170 <hr align="left" width="50%"/>
171 <p>It is possible to start a member of an <a href="#array">timer array</a>.</p>
172 <hr align="left" width="50%"/>
173 <div align="center">
174 <center>
175 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
176 <tr>
177 <td width="100%">
178 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b></b></font> &nbsp; <i>timer_identifier</i><font face="Courier New" color="#003258" size="5"><b>[</b></font><i>array_index</i><font
179 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"
180 size="5"><b>)</b></font> ]<font face="Courier New" color="#003258" size="5"><b>;</b></font></h3>
181 </td>
182 </tr>
183 </table>
184 </center>
185 </div>
186 <div align="center"></div>
187 <ul>
188 <li>
189 <p><i>timer_identifier</i> is the&nbsp;name used to refer to the timer.</p>
190 </li>
191 <li>
192 <p><i>array_index</i> points out the timer to be started.</p>
193 </li>
194 <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.
195 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
196 value must be used.</li>
197 </ul>
198 <hr align="left" width="50%">
199 <p><a name="component_start">Example 1</a></p>
200 <p><font face="Courier New">vc_vertrek.start(f_beteende()); </font>
201 <p>The behavior described by the function f_beteende is started on the component with the reference vc_vertrek.</p>
202 <p>&nbsp;</p>
203 <hr align="left" width="50%">
204 <p><a name="Example 2a">Example 2a</a>:
205 <p><font face="Courier New">Kapu_PCO.start;</font>
206 <p>The port Kapu_PCO will be started.</p>
207 <hr align="left" width="50%">
208 <p><a name="Example 2b">Example 2b</a>:
209 <p><font face="Courier New">all port.start;</font>
210 <p>All ports will be started.</p>
211 <hr align="left" width="50%">
212 <p><a name="timer_start">Example 3a</a>:
213 <p><font face="Courier New">timer T_recherche := 5E-3;<br>
214 T_recherche.start;<br>
215 </font>
216 <p>The global timer T_recherche is declared (1st line) and started with the default duration (=5 ms; 2nd line).</p>
217 <hr align="left" width="50%">
218 <p><a name="default">Example 3b:</a>
219 <p><font face="Courier New">timer Tl_perdu;<br>
220 Tl_perdu.start(20E-3);&nbsp;<br>
221 </font>
222 <p>The local timer Tl_perdu is declared (1st line) and started with a duration of 20 ms (2nd line).</p>
223 <hr align="left" width="50%">
224 <p><a name="array">Example 3c:</a>
225 <p><font face="Courier New">timer Tl_Denfert[2] := {-, 1E-1, -};<br>
226 Tl_Denfert[1].start(20E-3); </font>
227 <p>The array of&nbsp; 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
228 line).&nbsp;The second timer in the array is started for 20 ms, overwriting the default value of 100 ms (2nd line).</p>
229 <hr align="left" width="25%">
230 <hr align="left" width="25%">
231 <p><a HREF="BNF.html#starttcstatement">BNF definition</a> of <font face="Courier New">component start</font></p>
232 <p><a HREF="BNF.html#starttimerstatement">BNF definition</a> of <font face="Courier New">timer start</font></p>
233 </body>
234 </html>
This page took 0.034132 seconds and 5 git commands to generate.