Jump to content

Call By Reference using LVOOP


Recommended Posts

Is there any possibility to "simulate" Call By Reference using LVOOP? I mean if my class contains only refnums to real objects or something like that. The problem is that some of my classes contains very large members and if I call member VIs, than each member VI will get the whole class but needs e.g. only to read one value.

Thanks, Eugen

Link to comment

Just because the subVI gets the entire class does NOT mean that the entire class gets copied. If you pass a class into a subVI then unbundle a single element, the class is not copied at the call. If you then use that single element in a read-only way (for example, connecting it to the select terminal of a case structure) the class is still not copied at the call. If you use the element in a write operation (such as wiring it to the Increment primitive), the element is copied, but the class is still not copied at the call. If you then bundle the incremented element back into the class, the class MAY be copied at the call, depending upon whether the particular call itself is already set up for writing (for more details see the large body of documents across the WWW about "inplaceness").

Is that enough reference for you?

Link to comment
QUOTE (Eugen Graf @ Jan 23 2009, 10:19 AM)
Yes, this info is exactly what I needed. Would you give me please a link, where inplaceness in LabVIEW is describen very well.
No. Because if I gave you such a link, you'd start caring about it. Stop caring. Really. Let LV make copies when it sees that your code needs copies and stop worrying about it. If you really hit a performance problem, you can dig into the topic further, but until then, let it go. It is almost never of interest to a LabVIEW programmer.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.