LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simplified Queue functions

It is possible to change the strings to variants thus allowing enum types. 

 

I modified the basic functions to test it out and it does work.  I have attached a sample demonstrating the actions.  The only addition was the variant to data to wire the variant element to the case structure. 

 

When I get some free time I will finish converting the Polymorphic VIs to variants.

 

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 11 of 12
(412 Views)

Christian L wrote:

 

A tool to copy and rename the wrapper, as tst' suggested, is what is needed.


The easiest way to do this is to create the wrappers once and to build a VI which will have an array of static references to the wrappers and the typedef. After asking the user for a target folder and a namespace, you can simply call the Save method on all the VIs. Just be sure NOT to use the Save a Copy option and to save them in order, because after changing the typedef, all its callers are updated. Also, if you use static refs, the caller will probably want to be saved to, so you need to account for that somehow.

 

Another nice addition, which brings this closer to LVOOP, is the ability to carry additional data with the command. You can do this by separating the enum and the variant and you can see examples here and here:

 

 

If you use one of the subVI as a template, then you can create something like this:

 

 

 

You can add the enum to the variant to create a cluster, and because this is a subVI for creating a specific variant, it can have the enum as a constant and can do whatever validation code is required on the inputs.

 

P.S. As Ben mentioned, wrappers around core VIs will hurt performance, so you can just add the core VIs to the duplicating process. Of course, that has its own problem and converting the data to a variant already hurts performance, so its probably not the best option for utility VIs which you distribute to many people.

Message Edited by tst on 10-02-2008 09:34 AM

___________________
Try to take over the world!
0 Kudos
Message 12 of 12
(380 Views)