LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data flow

 

hi everyone,

attached is a simple code that shows a common way of using data flow in labview. unfortunatly i was surprised, that the property node sets the attribute AFTER the loop has started to run, thus the chart does not depict 15 points as one would expect but rather only 14.

is the only alternative in this case the use of a sequence structure?

 

thanks!

 

0 Kudos
Message 1 of 4
(2,676 Views)

Why would you think that your VI shows using dataflow to empty the chart history first?  There is no dependency between them.  Even with Execution Highlighting on the loop starts before the property node runs!

 

Connect the error out terminal of the property node to the border of the for loop.  Then you have real data dependency and the 15 points you expect.

 

Lynn

Message 2 of 4
(2,673 Views)

Actually that is a good example to learn how our eyes can trick us into thinking that there is dataflow... It almost looks right.

 

But as Lynn mentionned there is no dependencies between them.

 

The way to prevent the eyes from thinking that there is proper dateflow is to do the following:

 

Check if the object gets all the values at its inputs.  Remember that as soon as an object has all input values, it will execute.

In this case, you have two objects that have all their inputs available:  The property node and the For Loop.  That becomes a race condition that the For Loop constantly wins.

As Lynn suggested, you actually need to force data flow by wiring the error out of the property node to the For Loop.

0 Kudos
Message 3 of 4
(2,654 Views)

thanks for the replys.

i guess i was thinking i was doing things right after i had seen the same connection scheme in an example in labview2009 (how to clear charts & graphs.vi). the difference to my example is that there is a for loop prior to the while loop preventing the race condition.

 

0 Kudos
Message 4 of 4
(2,628 Views)