Jump to content

ByRef using LV2 Global example


Recommended Posts

Use LV2 global to return a key to your data stored into the global. Then store this key to your objects private data. When you need to access the data, use the key in the objects private to fetch the data from the LV2 global. The key can be for example index of an array if you are using an array for data storage or variant attribute name if you are using variant attributes as data storage.

Cheers,

Tomi

Link to comment

QUOTE(Dan Bookwalter @ Feb 13 2008, 12:05 PM)

Does anyone have a simple example of implementing By Ref using a LV2 Global ?

thanks

Dan

You can also make the LV2 global reentrant and use VI server "Call by reference node" to access data. The VI server reference is then your reference to the data.

Tomi's suggestion is probably faster, but using VI-server means that different objects don't share the same memory to store the by-ref data, and in turn this means that two objects can access data in parallel.

/J

Link to comment

QUOTE(Dan Bookwalter @ Feb 13 2008, 06:05 AM)

Does anyone have a simple example of implementing By Ref using a LV2 Global ?

Check out the INI file VIs in LabVIEW - they're not particulary simple, but I'd be happy to throw somwthing together to help (should only take 15 mins, but I'm a little busy right now - I'll do it this morning some time).

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.