Jump to content

Buffer allocations from controls


mje

Recommended Posts

Hi all, just a general quickie question.

You know when you play a game of tracking down your buffer allocations, there are *always* alloc's at the control terminals. This makes perfect sense from a top level VI, where the panel will be visible...the controls maintain their own copy of the data independent of what's being operated on.

My question though is with regards to SubVIs...is this allocation "real" if it's not the top level VI? That is if a SubVI is called (and no panel shown), does LV then optimize such that no copy is made? I'm wondering if there's a penalty to passing large data structures through a long call chain due to copying...

-michael

Link to comment

Remember that the "Show Buffer Allocations" tool does just that -- it shows allocations. IT DOES NOT SHOW COPIES. So there's a buffer location allocated in case the front panel does get shown, but it is not necessarily used. So, no, there is no penalty for calling the subVI due to copying unless

1) the front panel is open when you make the call or

2) if there's a control reference open to one of the front panel controls or

3) the block diagram uses any local variables for that control or

4) the block diagram uses any static-linked property/invoke nodes for that control

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.