LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

WORM Global

Solved!
Go to solution
Highlighted

@paulmw wrote:

 

In your latest version, I would recommend moving the initialization (or "delete all") on first call outside of the first case statement that checks for an empty Global Name.  With it where it is there is the potential to not initialize on first call because of a possible empty string for the name.   


You are right about the first call.  If the name is empty, it won't initialize, then you fix it and put in a name, then call again and it won't be a first call anymore, so no init will happen.  Your mod is worth putting in.

 

As for errors, the vi is freely distributed and you can modify as you need.  I feel that name found is not necessarily good or bad by itself.  If attempting to read, name found is good.  If attempting to write, name found is bad.  I don't want to add code to my top level vi to determine if name found is good or bad.  So I will leave that part as is.

 

Thanx for your help with the Variant Attributes and moving the first call to its new place.

 

 

 

- tbob

Inventor of the WORM Global
Message 31 of 43
(18,587 Views)
Highlighted

Question, since I'm very interested in the technique behind it. But where did you get the GetTypeInfo VI from?

0 Kudos
Message 32 of 43
(18,330 Views)
Highlighted

@WouterG wrote:

Question, since I'm very interested in the technique behind it. But where did you get the GetTypeInfo VI from?


C:\Program Files\National Instruments\LabVIEW 2009\vi.lib\Utility\VariantDataType\GetTypeInfo.vo

 

One of those unadvertised gems.

- tbob

Inventor of the WORM Global
Message 33 of 43
(18,323 Views)
Highlighted

I like the idea of this vi... just to make sure I've got it right, I can add a new "variable" at any time, but it can't be replaced once its there is that right?

 

Also, any reason why this wouldn't work in 8.6.1? Don't suppose you could back save it for me so I can have a play?

 

Cheers

 

Paul

0 Kudos
Message 34 of 43
(18,107 Views)
Highlighted

@psmorris wrote:

I like the idea of this vi... just to make sure I've got it right, I can add a new "variable" at any time, but it can't be replaced once its there is that right?

 

Also, any reason why this wouldn't work in 8.6.1? Don't suppose you could back save it for me so I can have a play?

 

Cheers

 

Paul


Yes you can add a variable at any time.  You can only write a value to it at the time of creation.  After that it is read only.  Hence the name WORM (Write Once Read Many).  This will prevent race condtions.  It is very useful when wanting to create a constant.

 

Here is the vi in 8.6

 

- tbob

Inventor of the WORM Global
Message 35 of 43
(18,083 Views)
Highlighted

Tbob,

 

If it will also work in LV8.2, could you save it to that version for me?

 

Thanks,

Mike

 

0 Kudos
Message 36 of 43
(17,898 Views)
Highlighted

Here's an 8.0 version:

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 37 of 43
(17,881 Views)
Highlighted

I just stumbled onto this thread, and this looks like a handy bit of code.  I use a lot of LV2/AEs that I often make WO-RM (but not always I admit Smiley Surprised), but usually not quite as full-featured or modular as this.  My only suggestion would be to reexamine the icon.  I mean, I know exactly what you were going for, but to me it was immediately reminiscent of diagram from a high school biology text, if you get what I'm saying...

0 Kudos
Message 38 of 43
(15,986 Views)
Highlighted

This is open source.  You can change the icon if you wish.  I'm not much of an artist, except when it comes to music.

- tbob

Inventor of the WORM Global
0 Kudos
Message 39 of 43
(15,965 Views)
Highlighted

I am curious how the VariantType:GetTypeInfo works; did you write it by yourself? Or where did you find it? Same question applies to the Data Type Enum.

I like the idea to abuse this room saving design expanded to a FGV - it could also allow for deletion of variables wich is not possible in normal FGV.

 

Thank you for posting this.

0 Kudos
Message 40 of 43
(15,089 Views)