06-11-2010 11:51 AM
Are bundle, unbundle, bundle by name, unbundle by name expensive operations if used in a loop. I am using a bundle to pass/obtain data to a subvi. So I need to unbundle the wire pass them to a subvi and then bundle the wires that come out of the subvi and feed that into a shift register. I cannot do the bundling and unbundling outside because of the shift register which I need.
Thanks.
Solved! Go to Solution.
06-11-2010 11:59 AM
sharmaa wrote:Are bundle, unbundle, bundle by name, unbundle by name expensive operations if used in a loop. I am using a bundle to pass/obtain data to a subvi. So I need to unbundle the wire pass them to a subvi and then bundle the wires that come out of the subvi and feed that into a shift register. I cannot do the bundling and unbundling outside because of the shift register which I need.
Thanks.
Not necessarily. It depends on what you do with what you are bundling and unbundling.
I think the best resource I can offer is this thread where Dr. ONeill and I investigate that very question over a series of days.
Warning:
That thread is NOT lite reading. Take it bit by bit and take frequent breaks to avoid cerebral overload.
Ben
06-11-2010 12:02 PM
Well, it is more expensive than NOT doing it. But let me say this: using clusters to pass ALL of the data around in state machines and two/from VI's is extremely common and often recommended. I carry around arrays or references in clusters, channel setups, tasks, error texts, and so on, in loops that run at 5mS for 24/7 and have never experienced a problem associated with my use of clusters.
My thought is, compared to the alternative of having two dozen shift registers with single items in them or one S/R with a cluster - you might have to be on a real Time target to see a performance hit.
Super-Clusters might be another story.