LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
m3rl3n

State Control - Similar to polymorphic VI Control

Status: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.

Hi All,

 

Maybe there is a way to do this already that I'm not aware of.

 

I try to use state machines as often as possible & organize them as a single VI. I may have a VI that performs operations (very much like a class) on a specific item. For example I may have a VI that does all of my post processing of data that I collect and from that I may have a case that does FFT or some other type of custom analysis. What I have been doing is creating an enum and wiring that to the case inside the vi. This works but sometimes when copying to another VI or location I miss grabbing the wire and if it is hidden, I end up not noticing that it's not there when I try to debug.

 

What I would like to see is a property that can be selected to make an enum, a state selector, that is integral to the VI without having it be wired to the VI. Very much like what is done for polymorphic VIs.  This would also make the VI easily identifiable as either a state vi or polymorphic vi.

 

In the simple example below:

 

This is how I'm doing this now (here I'm using an action engine that I had handy, but it makes the point):

Cases_1.png

 

It would be nice if the this control would not have to be wired and it could look like this:

Cases_2.png

 

It could still be edited like an enum.  There would not be a selector tunnel on the case statement within the VI...  if possible. (this may actually require a new case structure to be available)

 

I hope this conveys the idea....

 

Dan

 

 

 

4 Comments
RavensFan
Knight of NI

Why wouldn't using an actual polymorphic VI work for you?  Each case of the case structure would become an instance of the polymorphic VI.

 

Or you could create a wrapper where each polymorphic instance contains the enum constant set feeding the actual VI that does the work.

 

If failing to wire a constant to your VI causes bugs, then make sure you set that connector terminal to be required on your subVI.

 

I don't see what you are asking for here that can't be easily done already in LabVIEW.

m3rl3n
Member

RavensFan,

 

Very valid comments and ones that I had thought of too, with the setting of the connector terminal being something that I have to remember to do.

 

As far as using an actual polymorphic VI, there is a certain level of additional work with each new VI that is created to be used within a polymorphic, plus the potential of many component VIs that need to be kept track of, whereas just modifying or adding a case within an already established VI is much faster when simple cases are the solution. 

JÞB
Knight of NI

What you seem to be looking for is possible today simply.  Create wrappers to expose your AE as an API and create the palatte mnu! You automatically get a RCM to replace with other items in the same mnu!


"Should be" isn't "Is" -Jay
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.