08-20-2010 12:17 PM
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!
08-20-2010 12:27 PM
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
08-20-2010 01:13 PM
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.
08-20-2010 05:21 PM
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.