1 <!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
\r
5 <!--(==============================================================)-->
\r
6 <!--(Document created with RoboEditor. )============================-->
\r
7 <!--(==============================================================)-->
\r
11 <title>Loop nodes</title>
\r
13 <!--(Meta)==========================================================-->
\r
15 <meta http-equiv=content-type content="text/html; charset=windows-1252">
\r
16 <meta name=generator content="RoboHELP by eHelp Corporation - www.ehelp.com">
\r
17 <meta name=generator-major-version content=0.1>
\r
18 <meta name=generator-minor-version content=1>
\r
19 <meta name=filetype content=kadov>
\r
20 <meta name=filetype-version content=1>
\r
21 <meta name=page-count content=1>
\r
22 <meta name=layout-height content=2413>
\r
23 <meta name=layout-width content=797>
\r
26 <!--(Links)=========================================================-->
\r
28 <link rel='stylesheet' href='../default_ns.css'>
\r
29 <script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
\r
31 if (navigator.appName !="Netscape")
\r
32 { document.write("<link rel='stylesheet' href='../default.css'>");}
\r
35 <style type="text/css">
\r
37 h1.whs1 {font-family: 'Times New Roman', serif;}
\r
38 img_whs2 {border-style: none; border: none; width: 30px; height: 30px; float: none;}
\r
39 p.whs3 {font-family: 'Times New Roman', serif;}
\r
40 p.whs4 {font-family: 'Times New Roman', serif; font-style: italic;}
\r
41 img_whs5 {border-style: none; border: none; width: 775px; height: 360px; float: none;}
\r
42 ul.whs6 {list-style: disc;}
\r
43 p.whs7 {font-family:'Times New Roman' , serif; background-image:url(../texture_horiz_ltbluebubbles.jpg); }
\r
44 img_whs8 {border-style: none; border: none; float: none; width: 36px; height: 38px;}
\r
45 img_whs9 {border-style: none; border: none; width: 404px; height: 297px; float: none;}
\r
46 p.whs10 {font-family: 'Courier New', monospace;}
\r
49 <script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
\r
52 if (innerWidth != origWidth || innerHeight != origHeight)
\r
55 if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
\r
56 origWidth = innerWidth;
\r
57 origHeight = innerHeight;
\r
63 <style type="text/css">
\r
65 div.WebHelpPopupMenu {position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;}
\r
68 <script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>
\r
69 <script type="text/javascript" language="javascript" src="../whver.js"></script>
\r
70 <script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>
\r
71 <script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>
\r
72 <script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>
\r
75 <!--(Body)==========================================================-->
\r
80 <script type="text/javascript" language="javascript1.2">
\r
82 if (window.gbWhTopic)
\r
84 if (window.addTocInfo)
\r
86 addTocInfo("SUPERVISION module\nEditing graphs\nNodes in the graph\nLoop nodes");
\r
87 addButton("show",BTN_TEXT,"Show","","","","",0,0,"","","");
\r
90 if (window.writeBtnStyle)
\r
93 if (window.writeIntopicBar)
\r
96 if (window.setRelStartPage)
\r
98 setRelStartPage("../supervision.html");
\r
106 document.location.reload();
\r
109 <h1 class="whs1">Loop nodes</h1>
\r
111 <p><span style="font-weight: bold;"><B><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs2">Loop node</B></span> is a
\r
112 kind of Control nodes. In fact two nodes represent Loop: <span style="font-weight: bold;"><B>start
\r
113 loop</B></span> and <span style="font-weight: bold;"><B>end loop</B></span> nodes.
\r
114 Nodes of such type are always InLine nodes. User have to supply this type
\r
115 of node by service, which will check conditions of end of loop. </p>
\r
117 <p class="whs3"><span style="font-family: 'Times New Roman', serif;">With
\r
118 that kind of nodes you may define all kinds of loops:</span></p>
\r
120 <p class="whs4">
\93for(
\r
121 initial condition(s) ; end condition(s) ; end loop code )
\94 or </p>
\r
123 <p class="whs4">
\93while(
\r
124 end condition )
\94</p>
\r
126 <p class="whs4">etc
\85</p>
\r
128 <p class="whs3"> </p>
\r
130 <p class="whs3"><img src="../loop1.jpg" x-maintain-ratio="TRUE" width="775px" height="360px" border="0" class="img_whs5"></p>
\r
132 <p class="whs3"> </p>
\r
134 <ul type="disc" class="whs6">
\r
136 <li class=kadov-p><p class="whs3"><span
\r
137 style="font-weight: bold;"><B>Titles of the nodes.</B></span> By default the
\r
138 name of the service is used. You can change only the name of the Start
\r
139 Loop node - the name of the End Loop node will be automatically created
\r
140 as follows: EndOf + "Name of the Start Loop node" .</p></li>
\r
142 <li class=kadov-p><p class="whs3"><span
\r
143 style="font-weight: bold;"><B>Status of execution</B></span> shows the state
\r
144 of the loop. It can be: <span style="font-weight: bold;"><B>Not Started</B></span>,
\r
145 <span style="font-weight: bold;"><B>Running</B></span>, <span style="font-weight: bold;"><B>Finished</B></span>.</p></li>
\r
147 <li class=kadov-p><p class="whs3"><span
\r
148 style="font-weight: bold;"><B>InGate/OutGate</B></span> - control ports of the
\r
149 loop execution. </p></li>
\r
151 <li class=kadov-p><p class="whs3"><span
\r
152 style="font-weight: bold;"><B>Time of execution </B></span>is a time of node
\r
153 execution in a launched dataflow.</p></li>
\r
155 <li class=kadov-p><p class="whs3"><span
\r
156 style="font-weight: bold;"><B>Input/Output ports</B></span>
\96 are BusPorts, which
\r
157 are processed by Python function. Input ports of the Start Loop node will
\r
158 get the initial values, which can be processed by underlying function
\r
159 and will be transferred inside of the loop. Last calculation node of the
\r
160 loop will put these values to the input port of the End Loop node. If
\r
161 loop continues then this value will be copied to the Input port of the
\r
162 Start Loop node, otherwise into output port of the End Loop node.</p></li>
\r
164 <li class=kadov-p><p class="whs3"><span
\r
165 style="font-weight: bold;"><B>Control loop ports</B></span>
\96 Control ports of
\r
166 the loop nodes manage the functioning of the loop and they are not accessible
\r
167 for the user. <span style="font-weight: bold;"><B>InitLoop</B></span> port launches
\r
168 the loop. <span style="font-weight: bold;"><B>DoLoop</B></span> port of the Start
\r
169 Loop node checks whether the end loop condition set in <span style="font-weight: bold;"><B>More
\r
170 </B></span><span>function of the Loop node</span> has been achieved or not.
\r
171 The value in this ports is of boolean type. It can be 0 or 1. </p></li>
\r
174 <p class="whs3"> </p>
\r
176 <p class="whs7"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs8">To create a Loop node you have to define three python functions
\r
177 which will manage the loop with all input and output arguments (ports)
\r
181 <p class="whs3"> </p>
\r
183 <ul type="disc" class="whs6">
\r
185 <li class=kadov-p><p class="whs3"> <span
\r
186 style="font-weight: bold;"><B>INIT: </B></span>An
\r
187 Initialization function which will be executed only when we enter in the
\r
188 loop for the first time.</p></li>
\r
191 <p class="whs3"> </p>
\r
193 <ul type="disc" class="whs6">
\r
195 <li class=kadov-p><p class="whs3"> <span
\r
196 style="font-weight: bold;"><B>MORE: </B></span>A
\r
197 \93More
\94 function which is executed at each execution of the LoopNode even
\r
198 for the first time. That function will have to return as first output
\r
199 argument a boolean before output arguments (ports) defined by the user
\r
200 in the node. If that function value is true the body of the loop will
\r
201 automatically be executed. If it is false SUPERVISION component will resume
\r
202 execution after the end of the loop. That first output argument will not
\r
203 be represented as an output port and will not be used in the graph.</p></li>
\r
206 <p class="whs3"> </p>
\r
208 <ul type="disc" class="whs6">
\r
210 <li class=kadov-p><p class="whs3"><span
\r
211 style="font-weight: bold;"><B>NEXT: </B></span>A
\93Next
\94 function which is executed
\r
212 each time that SUPERVISION component resume the execution from the end
\r
213 of the loop to the beginning.</p></li>
\r
216 <p class="whs3"> </p>
\r
218 <p class="whs3">Setting of these functions
\r
219 is possible from the standard <span style="font-weight: bold;"><B>Add Node</B></span>
\r
220 dialog box (<a href="adding_nodes.htm">see also Adding nodes</a>):</p>
\r
222 <p class="whs3"> </p>
\r
224 <p class="whs3"> <img src="../pics/loopfunctions.jpg" x-maintain-ratio="TRUE" width="404px" height="297px" border="0" class="img_whs9"></p>
\r
226 <p class="whs3"> </p>
\r
228 <p class="whs3">Here you can see a simple
\r
229 example of Python functions set in a Loop node:</p>
\r
231 <p class="whs3"> </p>
\r
233 <p class="whs10">def <span style="font-weight: bold;"><B>Init</B></span>(Index,Min,Max,Incr)
\r
236 <p class="whs10"> if
\r
237 Min <= Max : </p>
\r
239 <p class="whs10"> Index
\r
242 <p class="whs10"> else
\r
245 <p class="whs10"> Index
\r
248 <p class="whs10"> return
\r
249 Index,Min,Max,Incr </p>
\r
251 <p class="whs10"> </p>
\r
253 <p class="whs10">def <span style="font-weight: bold;"><B>More</B></span>(Index,Min,Max,Incr)
\r
256 <p class="whs10"> if
\r
257 Index < Max : </p>
\r
259 <p class="whs10"> DoLoop
\r
262 <p class="whs10"> else
\r
265 <p class="whs10"> DoLoop
\r
268 <p class="whs10"> return
\r
269 DoLoop,Index,Min,Max,Incr </p>
\r
271 <p class="whs10"> </p>
\r
273 <p class="whs10">def <span style="font-weight: bold;"><B>Next</B></span>(Index,Min,Max,Incr)
\r
276 <p class="whs10"> Index
\r
277 = Index + Incr </p>
\r
279 <p class="whs10"> return
\r
280 Index,Min,Max,Incr</p>
\r
282 <p class="whs3"> </p>
\r
284 <p class="whs7"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs8">Loop nodes have the following particularities:</p>
\r
286 <p class="whs3"> </p>
\r
288 <ul type="disc" class="whs6">
\r
290 <li class=kadov-p><p class="whs3">You
\r
291 may create <span style="font-weight: bold;"><B>only input ports</B></span> in
\r
292 the Loop node.</p></li>
\r
294 <li class=kadov-p><p class="whs3">The
\r
295 input ports, which have been created in the Start Loop node are automatically
\r
296 duplicated by SUPERVISION component as output ports of this node.</p></li>
\r
298 <li class=kadov-p><p class="whs3">SUPERVISION
\r
299 component automatically adds
\r
300 the same input and output ports in the End
\r
301 Loop node as in the Start Loop node.</p></li>
\r
303 <li class=kadov-p><p class="whs3">If
\r
304 an output port of the Start Loop node has no link and if the corresponding
\r
305 input port of the End Loop node has no link, SUPERVISION component automatically
\r
306 transmits its value to the corresponding End Loop node during execution.
\r
307 You shouldn't define such links.</p></li>
\r
309 <li class=kadov-p><p class="whs3">When
\r
310 SUPERVISION component executes the End Loop node, it automatically transmits
\r
311 the actual values of the
\r
312 output ports of the End Loop node to the input ports of the Start Loop
\r
315 <li class=kadov-p><p class="whs3">In
\r
316 the body of a loop, an input port of a calculation node may not be linked
\r
317 from an output port of a node which is not in the body of a loop. That
\r
318 output port <span style="font-weight: bold;"><B>must be linked</B></span> to
\r
319 an input port of the Start Loop node. So its value will be available through
\r
320 the corresponding output port of the Start Loop node.</p></li>
\r
323 <p class="whs3"> </p>
\r
325 <p class="whs3"> </p>
\r
327 <p class="whs3"> </p>
\r
330 <a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;} if (parseInt(navigator.appVersion) >=2 && typeof(PopupMenu_Invoke) == 'function') PopupMenu_Invoke(e,'','About nodes','about_nodes.htm','Adding nodes','adding_nodes.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a></p>
\r
332 <p class="whs3"> </p>
\r
334 <p class="whs3"> </p>
\r
336 <p class="whs3"> </p>
\r
338 <p class="whs3"> </p>
\r
340 <script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--
\r
341 if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")
\r
342 WritePopupMenuLayer();
\r
343 //--></script><script type="text/javascript" language="javascript1.2">
\r
345 if (window.writeIntopicBar)
\r
346 writeIntopicBar(0);
\r