2 Copyright (c) 2000-2015 Ericsson Telecom AB
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
11 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
12 <meta http-equiv=
"Content-Language" content=
"en-us">
15 <body bgcolor=
"#DAD3C5" vlink=
"#0094D2" link=
"#003258">
16 <table align=
"left" border=
"0" cellspacing=
"0" cellpadding=
"0" valign=top
>
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>
21 <table border=
"0" align=
"right" cellpadding=
"0" cellspacing=
"0">
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>
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>
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:
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
"value-returning
52 done
" 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>
55 <p>Related keywords:
</p>
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>
67 <hr align=
"left" width=
"50%">
70 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
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>
82 <p><i>component_identifier
</i> is the
name used to refer to the component to be started.
</p>
85 <p><i>behavior_function
</i> is the function describing the test component behavior.
</p>
88 <p><i>function_parameter
</i> specifies actual parameters of the function
</p>
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>
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>
102 <p>Related keywords:
</p>
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>
107 <hr align=
"left" width=
"50%">
110 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
113 <h3 align=
"center"><i>port_reference
</i><font face=
"Courier New" color=
"#003258" size=
"5"><b>.start;
</b></font></h3>
121 <p><i> port_reference
</i> points out the port to be started.
</p>
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
130 <p>The
<b><font face=
"Courier New" color=
"#003258" size=
"4">start
</font> </b> keyword introduces port starting.
</p>
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>
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>
141 <p>Related keywords:
</p>
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>
149 <hr align=
"left" width=
"50%">
152 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
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>
164 <p><i>timer_identifier
</i> is the
name used to refer to the timer.
</p>
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>
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%"/>
175 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
178 <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
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>
186 <div align=
"center"></div>
189 <p><i>timer_identifier
</i> is the
name used to refer to the timer.
</p>
192 <p><i>array_index
</i> points out the timer to be started.
</p>
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>
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>
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>
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);
<br>
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
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).
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>