NI Home > Community > NI Discussion Forums

LabVIEW FPGA Idea Exchange

Showing results for 
Search instead for 
Do you mean 
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!
jakidd

Support Type Cast from Integer to Enum

Status: New
by Member jakidd on ‎08-24-2011 07:19 PM - last edited on ‎08-25-2011 09:15 AM by Active Participant Dragis

Old Title: FPGA Case Structure Needs To Display Enum Values

 

In LabVIEW the case structure can show enum values, while the FPGA case only shows the numeric value. Would like to see the below example capable in FPGA.

Untitled.png

Comments
by Active Participant Dragis on ‎08-24-2011 11:29 PM

You should be able to wire an enum directly to a case structure in FPGA. Are you getting an error if you use enums on FPGA?

by Member jakidd on ‎08-25-2011 09:01 AM

Sorry, my wording was wrong. I would like to be able to Type Cast a numeric to a enum, thus the case structure has enum values for the selects.

by Active Participant Dragis on ‎08-25-2011 09:18 AM

That makes more sense. I have updated the title of the idea to reflect this. 

 

Also, there is a way to cast from an integer to an enum. It isn't pretty, and I won't accept it as a "fix" for this idea, but it is a workaround. You have to use clusters in such a way that forces LabVIEW to choose the enum type instead of widening to the integer type.

 

enum-cast.png

by Member jakidd on ‎08-25-2011 09:35 AM

FPGA2.png

FPGA1.png

by Member dwisti on ‎08-25-2011 11:12 AM

Why not use a simple subVI to coerce the data types?  The subVi input control is of the integer data type and is wired the output indicator which is the enum.  This should give you a coercion dot on the enum.

by Member jakidd on ‎08-25-2011 11:26 AM

I just tried that, using a subVI to coerce, and that is a solution, thanks! I was unaware you could do that.

About LabVIEW FPGA Idea Exchange

Have a LabVIEW FPGA Idea?

  1. Does your idea apply to LabVIEW in general? Get the best feedback by posting it on the original LabVIEW Idea Exchange.
  2. Browse by label or search in the LabVIEW FPGA 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!
  3. If your idea has not been submitted click New Idea to submit a product idea to the LabVIEW FPGA Idea Exchange. Be sure to submit a separate post for each idea.
  4. Watch as the community gives your idea kudos and adds their input.
  5. As NI R&D considers the idea, they will change the idea status.
  6. Give kudos to other ideas that you would like to see in a future version of LabVIEW FPGA!
Idea Statuses
Top Kudoed Authors