1 <!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
\r
6 <title>Loop nodes</title>
\r
7 <meta http-equiv="content-type" content="text/html; charset=windows-1252">
\r
8 <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
\r
9 <link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
\r
11 if (navigator.appName !="Netscape")
\r
12 { document.write("<link rel='stylesheet' href='../default.css'>");}
\r
15 <style type="text/css">
\r
17 h1.whs1 { font-family:'Times New Roman' , serif; }
\r
18 img_whs2 { border-style:none; border:none; width:30px; height:30px; float:none; }
\r
19 p.whs3 { font-family:'Times New Roman' , serif; }
\r
20 p.whs4 { font-family:'Times New Roman' , serif; font-style:italic; }
\r
21 img_whs5 { border-style:none; border:none; width:775px; height:360px; float:none; }
\r
22 ul.whs6 { list-style:disc; }
\r
23 p.whs7 { font-family:'Times New Roman' , serif; background-image:url('../texture_horiz_ltbluebubbles.jpg'); }
\r
24 img_whs8 { border-style:none; border:none; float:none; width:36px; height:38px; }
\r
25 img_whs9 { border-style:none; border:none; width:404px; height:297px; float:none; }
\r
26 p.whs10 { font-family:'Courier New' , monospace; }
\r
28 </style><script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
\r
31 if (innerWidth != origWidth || innerHeight != origHeight)
\r
34 if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
\r
35 origWidth = innerWidth;
\r
36 origHeight = innerHeight;
\r
42 <style type="text/css">
\r
44 div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
\r
46 </style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>
\r
47 <script type="text/javascript" language="javascript" src="../whver.js"></script>
\r
48 <script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>
\r
49 <script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>
\r
50 <script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>
\r
52 <body><script type="text/javascript" language="javascript1.2">
\r
54 if (window.gbWhTopic)
\r
56 if (window.addTocInfo)
\r
58 addTocInfo("SUPERVISION module\nEditing graphs\nNodes in the graph\nLoop nodes");
\r
59 addButton("show",BTN_TEXT,"Show","","","","",0,0,"","","");
\r
62 if (window.writeBtnStyle)
\r
65 if (window.writeIntopicBar)
\r
68 if (window.setRelStartPage)
\r
70 setRelStartPage("../supervision.htm");
\r
79 document.location.reload();
\r
82 <h1 class="whs1">Loop nodes</h1>
\r
84 <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
85 kind of Control nodes. In fact two nodes represent Loop: <span style="font-weight: bold;"><B>start
\r
86 loop</B></span> and <span style="font-weight: bold;"><B>end loop</B></span> nodes.
\r
87 Nodes of such type are always InLine nodes. User have to supply this type
\r
88 of node by service, which will check conditions of end of loop. </p>
\r
90 <p class="whs3"><span style="font-family: 'Times New Roman', serif;">With
\r
91 that kind of nodes you may define all kinds of loops:</span></p>
\r
93 <p class="whs4">
\93for(
\r
94 initial condition(s) ; end condition(s) ; end loop code )
\94 or </p>
\r
96 <p class="whs4">
\93while(
\r
97 end condition )
\94</p>
\r
99 <p class="whs4">etc
\85</p>
\r
101 <p class="whs3"> </p>
\r
103 <p class="whs3"><img src="../loop1.jpg" x-maintain-ratio="TRUE" width="775px" height="360px" border="0" class="img_whs5"></p>
\r
105 <p class="whs3"> </p>
\r
107 <ul type="disc" class="whs6">
\r
109 <li class=kadov-p><p class="whs3"><span
\r
110 style="font-weight: bold;"><B>Titles of the nodes.</B></span> By default the
\r
111 name of the service is used. You can change only the name of the Start
\r
112 Loop node - the name of the End Loop node will be automatically created
\r
113 as follows: EndOf + "Name of the Start Loop node" .</p></li>
\r
115 <li class=kadov-p><p class="whs3"><span
\r
116 style="font-weight: bold;"><B>Status of execution</B></span> shows the state
\r
117 of the loop. It can be: <span style="font-weight: bold;"><B>Not Started</B></span>,
\r
118 <span style="font-weight: bold;"><B>Running</B></span>, <span style="font-weight: bold;"><B>Finished</B></span>.</p></li>
\r
120 <li class=kadov-p><p class="whs3"><span
\r
121 style="font-weight: bold;"><B>InGate/OutGate</B></span> - control ports of the
\r
122 loop execution. </p></li>
\r
124 <li class=kadov-p><p class="whs3"><span
\r
125 style="font-weight: bold;"><B>Time of execution </B></span>is a time of node
\r
126 execution in a launched dataflow.</p></li>
\r
128 <li class=kadov-p><p class="whs3"><span
\r
129 style="font-weight: bold;"><B>Input/Output ports</B></span>
\96 are BusPorts, which
\r
130 are processed by Python function. Input ports of the Start Loop node will
\r
131 get the initial values, which can be processed by underlying function
\r
132 and will be transferred inside of the loop. Last calculation node of the
\r
133 loop will put these values to the input port of the End Loop node. If
\r
134 loop continues then this value will be copied to the Input port of the
\r
135 Start Loop node, otherwise into output port of the End Loop node.</p></li>
\r
137 <li class=kadov-p><p class="whs3"><span
\r
138 style="font-weight: bold;"><B>Control loop ports</B></span>
\96 Control ports of
\r
139 the loop nodes manage the functioning of the loop and they are not accessible
\r
140 for the user. <span style="font-weight: bold;"><B>InitLoop</B></span> port launches
\r
141 the loop. <span style="font-weight: bold;"><B>DoLoop</B></span> port of the Start
\r
142 Loop node checks whether the end loop condition set in <span style="font-weight: bold;"><B>More
\r
143 </B></span><span>function of the Loop node</span> has been achieved or not.
\r
144 The value in this ports is of boolean type. It can be 0 or 1. </p></li>
\r
147 <p class="whs3"> </p>
\r
149 <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
150 which will manage the loop with all input and output arguments (ports)
\r
154 <p class="whs3"> </p>
\r
156 <ul type="disc" class="whs6">
\r
158 <li class=kadov-p><p class="whs3"> <span
\r
159 style="font-weight: bold;"><B>INIT: </B></span>An
\r
160 Initialization function which will be executed only when we enter in the
\r
161 loop for the first time.</p></li>
\r
164 <p class="whs3"> </p>
\r
166 <ul type="disc" class="whs6">
\r
168 <li class=kadov-p><p class="whs3"> <span
\r
169 style="font-weight: bold;"><B>MORE: </B></span>A
\r
170 \93More
\94 function which is executed at each execution of the LoopNode even
\r
171 for the first time. That function will have to return as first output
\r
172 argument a boolean before output arguments (ports) defined by the user
\r
173 in the node. If that function value is true the body of the loop will
\r
174 automatically be executed. If it is false SUPERVISOR component will resume
\r
175 execution after the end of the loop. That first output argument will not
\r
176 be represented as an output port and will not be used in the graph.</p></li>
\r
179 <p class="whs3"> </p>
\r
181 <ul type="disc" class="whs6">
\r
183 <li class=kadov-p><p class="whs3"><span
\r
184 style="font-weight: bold;"><B>NEXT: </B></span>A
\93Next
\94 function which is executed
\r
185 each time that SUPERVISOR component resume the execution from the end
\r
186 of the loop to the beginning.</p></li>
\r
189 <p class="whs3"> </p>
\r
191 <p class="whs3">Setting of these functions
\r
192 is possible from the standard <span style="font-weight: bold;"><B>Add Node</B></span>
\r
193 dialog box (<a href="adding_nodes.htm">see also Adding nodes</a>):</p>
\r
195 <p class="whs3"> </p>
\r
197 <p class="whs3"> <img src="../pics/loopfunctions.jpg" x-maintain-ratio="TRUE" width="404px" height="297px" border="0" class="img_whs9"></p>
\r
199 <p class="whs3"> </p>
\r
201 <p class="whs3">Here you can see a simple
\r
202 example of Python functions set in a Loop node:</p>
\r
204 <p class="whs3"> </p>
\r
206 <p class="whs10">def <span style="font-weight: bold;"><B>Init</B></span>(Index,Min,Max,Incr)
\r
209 <p class="whs10"> if
\r
210 Min <= Max : </p>
\r
212 <p class="whs10"> Index
\r
215 <p class="whs10"> else
\r
218 <p class="whs10"> Index
\r
221 <p class="whs10"> return
\r
222 Index,Min,Max,Incr </p>
\r
224 <p class="whs10"> </p>
\r
226 <p class="whs10">def <span style="font-weight: bold;"><B>More</B></span>(Index,Min,Max,Incr)
\r
229 <p class="whs10"> if
\r
230 Index < Max : </p>
\r
232 <p class="whs10"> DoLoop
\r
235 <p class="whs10"> else
\r
238 <p class="whs10"> DoLoop
\r
241 <p class="whs10"> return
\r
242 DoLoop,Index,Min,Max,Incr </p>
\r
244 <p class="whs10"> </p>
\r
246 <p class="whs10">def <span style="font-weight: bold;"><B>Next</B></span>(Index,Min,Max,Incr)
\r
249 <p class="whs10"> Index
\r
250 = Index + Incr </p>
\r
252 <p class="whs10"> return
\r
253 Index,Min,Max,Incr</p>
\r
255 <p class="whs3"> </p>
\r
257 <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
259 <p class="whs3"> </p>
\r
261 <ul type="disc" class="whs6">
\r
263 <li class=kadov-p><p class="whs3">You
\r
264 may create <span style="font-weight: bold;"><B>only input ports</B></span> in
\r
265 the Loop node.</p></li>
\r
267 <li class=kadov-p><p class="whs3">The
\r
268 input ports, which have been created in the Start Loop node are automatically
\r
269 duplicated by SUPERVISOR component as output ports of this node.</p></li>
\r
271 <li class=kadov-p><p class="whs3">SUPERVISOR
\r
272 component automatically adds
\r
273 the same input and output ports in the End
\r
274 Loop node as in the Start Loop node.</p></li>
\r
276 <li class=kadov-p><p class="whs3">If
\r
277 an output port of the Start Loop node has no link and if the corresponding
\r
278 input port of the End Loop node has no link, SUPERVISOR component automatically
\r
279 transmits its value to the corresponding End Loop node during execution.
\r
280 You shouldn't define such links.</p></li>
\r
282 <li class=kadov-p><p class="whs3">When
\r
283 SUPERVISOR component executes the End Loop node, it automatically transmits
\r
284 the actual values of the
\r
285 output ports of the End Loop node to the input ports of the Start Loop
\r
288 <li class=kadov-p><p class="whs3">In
\r
289 the body of a loop, an input port of a calculation node may not be linked
\r
290 from an output port of a node which is not in the body of a loop. That
\r
291 output port <span style="font-weight: bold;"><B>must be linked</B></span> to
\r
292 an input port of the Start Loop node. So its value will be available through
\r
293 the corresponding output port of the Start Loop node.</p></li>
\r
296 <p class="whs3"> </p>
\r
298 <p class="whs3"> </p>
\r
300 <p class="whs3"> </p>
\r
303 <a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;} if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_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>
\r
308 <p class="whs3"> </p>
\r
310 <p class="whs3"> </p>
\r
312 <p class="whs3"> </p>
\r
314 <p class="whs3"> </p>
\r
316 <script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--
\r
317 if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")
\r
318 WritePopupMenuLayer();
\r
319 //--></script><script type="text/javascript" language="javascript1.2">
\r
321 if (window.writeIntopicBar)
\r
322 writeIntopicBar(0);
\r