NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Announcements
The NI Idea Exchange is a product feedback forum where NI R&D and users work together to submit ideas, collaborate on their development, and vote for the ones they like best. View all of the NI Idea Exchanges to post an idea or add your opinion on an existing one today!
0 Kudos
rcpacini

New Enum Class Primitive: "The Defined Enum" (with pictures)

Status: Declined
by Member rcpacini on ‎03-07-2012 08:29 AM

(Resubmitted to include pictures)

 

Similar to the discussions on command and data cluster primitives, it seems many programmers would like the ability to have a primitive to move a message and some additional data easily. The current methods involve casting specific data types to generic types (i.e. Variants) which are then passed to sub-processes. Once in the sub-process, the process reverses and the data is cast back to the specific type. Many times this casting to and from generic data types not only takes time and resources but also requires managing many type def'ed controls for each specific data type used.

 

Here is a traditional method for passing data between processes:

TraditionalConfiguration.png

Alternately, if the message (such as an enum) included the specific data type definition then no casting is required. This idea involves embedding inherancy of private class data into a defined LabVIEW primitive where each command/item is its own class of private data. It's like having your cake and eating it too! Or, it's like having your message and the data too! (cheesy, i know). Below is an idea for the configuration of the "Defined Enum":

DefinedEnumControl.png

Like a tab control, each tab is an Enum Item and the controls within the tab are specific controls associated with the item. The Defined Enum loads a drop-down selection list of the private data associated with the current item.

DefinedEnumBlockDiagram.png

In the block diagram, like property nodes, the accessors would be used to get or set the values of the enum items. 

DefinedEnumAccessors.png

The sales pitch: When developing large applications where there are multiple services running in parallel it is often difficult to develop completely modular processes because the casting to and from specific data types require a control dependancy between the caller and the callee. Eliminating generic data casting would help develop a more robust hierarchy. I applogize if this idea is a repeat. Let me know what you think.

-Ryan

Status: Declined
Already implemented as LV class.
Comments
by Trusted Enthusiast on ‎03-07-2012 10:36 AM

What you ask for is called a LabVIEW class. Yes, really. With all the polymorphism that you're looking for.

 

And your solution to the communication problem of this data? Please check this out: https://decibel.ni.com/content/docs/DOC-17193

by Trusted Enthusiast on ‎03-07-2012 10:38 AM

I will say that I've been looking for images that make classes easier to view on the diagram, and I may borrow some of your approaches here for that purpose.

by Member MaryH on ‎03-07-2012 11:12 AM
Status changed to: Declined
Already implemented as LV class.
by Member rcpacini on ‎03-07-2012 11:40 AM

Hi Aristos,

 

Thanks for showing me the Actor Framework using classes, this was exactly what I was hoping for.

 

by Trusted Enthusiast on ‎03-07-2012 11:39 PM

Just wanted to add a quick comment to this thread: this idea is an important archive piece for the LabVIEW forums, because it demonstrates a common design challenge with great illustrations. People searching for a solution - yet lacking vocabulary such as "run-time polymorphism" ("dynamic dispatch") and "strictly typing" vs. "stringly typing" - might stumble upon this thread and discover LabVIEW Classes and LVOOP principles! So, +1 to rcpacini for the detailed write-up! 

by Member drjdpowell on ‎03-08-2012 03:25 AM

"User Events" are another method in LabVIEW that also allows the equivalient of strictly-types messages, in addition to LVOOP and the "Command Pattern".

by Member Wart on ‎03-08-2012 11:20 AM

It would be useful to attach a LVOOP implementation of the drawings to complete the loop.  You've then taken a common challenge with great visual documentation and turned it into classes that people are more likely to understand and appreciate.

by Trusted Enthusiast on ‎03-16-2012 07:29 PM

Wart: Excellent point. I do not have it as images, but I do have that "finish the loop" as video:

http://zone.ni.com/wv/app/doc/p/id/wv-3101

 

This web video shows the progression of how we go from a messaging scheme using an enum and variant pair to a class implementation and then into the Actor Framework for communications.

Latest LabVIEW Idea Exchange Blog Posts
About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
Idea Statuses
Top Kudoed Authors
User Kudos Count
137
87
71
67
61
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page