01-15-2015 04:15 AM
Hello,
Maybe this is very obvious, but I do not fully understand something with flat sequence structures-FSS (I never use this structure by the way, and I do not get why they use it in this example).
There is a NI doc online explaining some rookie mistakes in LV:
http://www.ni.com/newsletter/51735/en/
The doc describes that the FSS is useful for benchmarking, the BD:
My question: what about if we put the Tick Count in a subVI at the left and at the right, and giving the exec. order with error wires? Or using a while loop which executes only once (with error wires passing through)?
Are these 3 different ways identical?
Solved! Go to Solution.
01-15-2015 04:24 AM - edited 01-15-2015 04:25 AM
Yes you can do all of those things - I think the only thing to bear in mind is that you don't want your benchmarking code to affect the execution speed of the code - otherwise you'll get inaccurate results. If you use the while loop, you'll need to do something to ensure that your second Tick Count executes after your While loop - e.g. with an FSS
Using the flat sequence structure is OK - it's overuse of it that is a common rookie mistake - trying to force things to execute in a specific order (e.g. if coming from a text based sequential programming language) instead of understanding that this is done by data flow in LabVIEW.
I think the reason for it is just because the Tick Count VI doesn't have an input so you can't enforce data flow. It's quite common to have a subVI that wraps the tick count VI with error in/out wires.
01-15-2015 04:40 AM
Thanks! It is more clear now. So a while loop actually changes the things too much, so it is not good here. A subVI needs to be created, so I see why it is just quicker to drop a FSS instead...
01-15-2015 03:14 PM - edited 01-15-2015 03:15 PM
Actually depending on the precision you want, that example has other issues. Altenbach has a post somewhere that I can't find at the moment that lists out how to best measure the speed of some code. Here are some of the points I remember:
Without following these steps you'll still get a pretty good idea about how long something takes to do, but when comparing multiple coding techniques for speed, these steps help make a level playing field.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord