Jump to content

[Discuss] General reference system


Recommended Posts

index.php?app=downloads&module=display&section=screenshot&id=41

Name: General reference system

Submitter: LAVA 1.0 Content

Submitted: 03 Jul 2009

Category: LabVIEW OOP

LabVIEW Version: 8.2

Version: 1.0.3

License Type: Creative Commons Attribution 3.0

Potentially make this available on the VI Package Network?: Undecided

Author:

bsvingen - Bjornar Svingen

--see readme file for contact information

Description:

An LVOOP class that creates and controls reference-data pairs. The basic idea is to simulate random access memory and malloc()/free() by using one single LV2 style global. The data can be of any type (including any LVOOP class and strict typedefs) and can be allocated in any order. The only restriction to the number of references is the physical memory on the computer. The global stores data in a Variant Array and uses a separate Bool Array to control access and free/protect the data.

The "address" to the data that is stored in the reference (LV Object) ,is the index in the Variant Array where the data is stored in the LV2 Global. By using Variant as the type, it is possible to get a reference to all types, and there is no need to manually change a typedef and possibly the names for every vi when more than one typedef will be used.

A small performance penalty is introduced due to the type conversions to/from Variant. However, due to the inherent effectiveness of LV2 style globals, this method is still 2-3 times faster than an equivalent scheme made with wrappers around queue primitives, but slightly slower than using queue primitives directly, (no wrappers around the queues, see example provided). For an even faster reference system, twice the speed of queue primitives, se the separate "Pointer System" on this Code Repository.

In contrast to queues that can be regarded as synchronous references to data, this reference system is fully asynchronous.

Allocation and freeing of data is done dynamically.

Allthough this reference system may at first glance have some resemblence to "classic" GOOP, it is by no means a GOOP system. The main purpose of the reference system is to have a fully asynchronous and fully reusable system for read and write access to one single instance of data in more than one place.

All the VIs in the library are documented.

Version History:

1.0.3

Added an example using queue primitives as references with no wrappers.

Updated this Readme.txt

1.0.2

Minor fixes to the New function and some text.

1.0.1

Added this readme.txt file + some small cosmetic changes

1.0.0:

Initial release of the code.

Click here to download this file

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.