alnaimi Posted May 4, 2007 Report Share Posted May 4, 2007 Very urgent question ! how can I do two loops seqentally , I mean i want to finish the first for loo then start the new for loop??? Quote Link to comment
Tomi Maila Posted May 4, 2007 Report Share Posted May 4, 2007 Error cluster can be used to define the execution order of almost anything. When you wire error out of an item to error in of another item, the items will be executed sequentially. So wire error cluster out from one of your loops and into another loop. Tomi Quote Link to comment
crelf Posted May 4, 2007 Report Share Posted May 4, 2007 QUOTE(Tomi Maila @ May 3 2007, 11:35 PM) When you wire error out of an item to error in of another item, the items will be executed sequentially. So wire error cluster out from one of your loops and into another loop. ...or anything really - LabVIEW is a dataflow language, meaning that a node won't execute until there's data at all of it's inputs, so the second loop will wait for an uotput of the first loop. Quote Link to comment
Doon Posted May 4, 2007 Report Share Posted May 4, 2007 QUOTE(crelf @ May 3 2007, 07:50 AM) ...or anything really - LabVIEW is a dataflow language, meaning that a node won't execute until there's data at all of it's inputs, so the second loop will wait for an uotput of the first loop. This may go without saying, but if the two loops are unrelated -- that is, they do not share data -- would it not be more efficient to put the two loops in a sequence structure? I have always understood that data transfered into or out-of loops cause a re-allocation of memory. Clarification on this issue would be quite nice. -H Quote Link to comment
lraynal Posted May 4, 2007 Report Share Posted May 4, 2007 Because a drawing is always better than explanations... http://forums.lavag.org/index.php?act=attach&type=post&id=5705 Quote Link to comment
LAVA 1.0 Content Posted May 4, 2007 Report Share Posted May 4, 2007 QUOTE(Tomi Maila @ May 3 2007, 09:35 AM) When you wire error out of an item to error in of another item, the items will be executed sequentially. So wire error cluster out from one of your loops and into another loop. Note that you don't have to USE (connect) the error to anything inside the second loop. Just connecting it to the second loop defines the execution order. This is called creating an http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/block_diagram_data_flow/' target="_blank">artificial data dependancy and is a very useful technique. :thumbup: Quote Link to comment
BrokenArrow Posted May 19, 2007 Report Share Posted May 19, 2007 QUOTE(crelf @ May 3 2007, 09:50 AM) ...- LabVIEW is a dataflow language, meaning that a node won't execute until there's data at all of it's inputs,..... Crelf, what is the advantage of doing what's shown in the picture with the delay's output being wired to the loop? I've seen this a lot lately. Is this an attempt to get the delay to be the last thing that runs? I have read the LAVA Wiki article on timers in loops, and have learned that you don't have a lot of control as to WHEN the delay will take place. Thanks, Richard Quote Link to comment
Gary Rubin Posted May 19, 2007 Report Share Posted May 19, 2007 I'm not Crelf, but I'll venture an answer. I don't believe that wire has any effect on when the delay occurs. What it does do, however, is provide a ms timer value of when the last loop finished. This could be accessed by wiring the output tunnel to something. Gary Quote Link to comment
Jim Kring Posted May 19, 2007 Report Share Posted May 19, 2007 QUOTE(BrokenArrow @ May 18 2007, 05:58 AM) what is the advantage of doing what's shown in the picture with the delay's output being wired to the loop? I've seen this a lot lately. Is this an attempt to get the delay to be the last thing that runs? Richard: Wiring from the output of the function to the structure frame creates a wire that can be probed. Such wires are commonly left over from debugging activities, where the developer needed to probe the output of a function/VI and had no other need for the data downstream. For example, you'll commonly see the loop iteration terminal wired to the structure frame. http://forums.lavag.org/index.php?act=attach&type=post&id=5901''>http://forums.lavag.org/index.php?act=attach&type=post&id=5901'>http://forums.lavag.org/index.php?act=attach&type=post&id=5901 Quote Link to comment
BrokenArrow Posted May 19, 2007 Report Share Posted May 19, 2007 Thanks Jim and Gary, That makes sense, that it's left over from debugging. Other than using a sequence, IS there a way to ensure that the delay in a loop is the last thing that runs before the loop starts over? Quote Link to comment
Darren Posted May 19, 2007 Report Share Posted May 19, 2007 QUOTE(BrokenArrow @ May 18 2007, 10:14 AM) Thanks Jim and Gary,That makes sense, that it's left over from debugging. Other than using a sequence, IS there a way to ensure that the delay in a loop is the last thing that runs before the loop starts over? I know a lot of people have wrapped the Delay function in a subVI and given it error I/O...if you do this, you can put your Delay "subVI" at the end of your error chain in your loop, guaranteeing it runs after all the other code in the loop. -D Quote Link to comment
BrokenArrow Posted May 19, 2007 Report Share Posted May 19, 2007 QUOTE(Darren @ May 18 2007, 11:18 AM) I know a lot of people have wrapped the Delay function in a subVI and given it error I/O...if you do this, you can put your Delay "subVI" at the end of your error chain in your loop, guaranteeing it runs after all the other code in the loop.-D OH YES! How about the Express Vi delay thing? It has an error input. As for all my 5.1 projects, I could create one. :thumbup: Thanks for the memory jog! Quote Link to comment
Darren Posted May 19, 2007 Report Share Posted May 19, 2007 QUOTE(Jim Kring @ May 18 2007, 09:46 AM) Richard: Wiring from the output of the function to the structure frame creates a wire that can be probed. Such wires are commonly left over from debugging activities, where the developer needed to probe the output of a function/VI and had no other need for the data downstream. For example, you'll commonly see the loop iteration terminal wired to the structure frame. Hey Jim, Seeing your post reminded me of a similar technique I use for debugging Event Structures. You inspired a http://forums.ni.com/ni/board/message?board.id=170&message.id=248138' target="_blank">Darren's Occasional Nugget today! -D Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.