View Single Post
  #12   Spotlight this post!  
Unread 20-12-2008, 08:39
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: LabVIEW vs. Easy C

Hopefully late is still better than never. Just to add some standard terminology to this good discussion, the area that Eric is referring to is called a diagram. At first diagrams are a bit hard to make out since they are more a space than an object, but they are equivalent to the space between { and } in a C program. A diagram is a bit like a statement -- does nothing on its own, but organizes other operations to do something bigger.

The first place you will find a diagram in LV is in the block diagram window. This diagram belongs to the VI and the code place on it will execute as Eric mentioned, all nodes exactly once, according to dataflow, each time the VI is run.

Another place to find diagrams is inside of the for or while loop. The loop is a box with an inside and an outside. This is the same as the { and }'s again. Code inside belongs to the loop, code outside belongs to a different diagram. When a loop node executes once, it can decide to execute its diagram as many times as it likes. Each execution follows the rules. Note that code within a loop seems to execute many times for one execution of the VI, but that is fine because it doesn't belong to the VI's diagram, it belongs to the loop diagram, and none of these are breaking the rule that Eric stated with respect to their owning diagram.

Other places you'll find diagrams are conditional case statements which owns a set of diagrams, picking one to execute, and a sequence which owns a set of diagram that are executed in an order.

The other thing that happens when you move from one diagram to another is to synchronize data. You'll see boxes drawn on edge called tunnels. The tunnel holds the data as long as necessary until the data on other wires arrives, then the execution can move from one diagram to another and that is when the tunnel data is transferred from one diagram to the other, and execution of that diagram begins.

Hope the terminology lecture helped.
Greg McKaskle