LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

int to enum type loookup

I am iterating in a while loop and using the index terminal to build an array of differnet values of the same enumerated type control that are from a strict type def enumerated control. What I want to do is to iterate and do a comparison and if the comparison holds, I want to build an array of the correlating enumerated types so that I can use this later on.

I am using a Function that came with the state diagram toolkit called "int to enum" that the state diagram uses when calculating its next state info. It seems to bomb out when I attempt to wire my enum type control to its input.

Any ideas?
0 Kudos
Message 1 of 5
(2,891 Views)
I have not used the state diagram toolkit but have extensively employed enums from typedefs. This is very convenient since for comparisons just compare it to a constant version of the typedefs. If you use a strict typedef remember that almost everything must be identical and this causes many problems. Since typedefs of enums rarely have to be strict I would think about why you chose a strict type def as opposed to a normal typedef. One additional added feature is that when wiring a enum typedef to a case structure you can populate the case with the enum named cases. I would speculate that your problems are due to the use of a strict typedef which is only necessary when you are concerned with more than just a typdef's structure and values (i.e aesthetic properties). Hope this helps (again I have not used the state diagram toolkit).
-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 5
(2,875 Views)
Can you attach an example of what you have? I'm not entirely clear from your description what you are attempting to do.


Thanks,

Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 5
(2,874 Views)
Here is what I am trying to do...
0 Kudos
Message 4 of 5
(2,868 Views)
Well it got a little hosed up as I didn't have some of your type defs, but here is a little fix. I don't know about the int to enum, but you can do the same thing with a type cast, remembering the type defs are unsigned words (U16) and the interation is an I32.

Hope this helps


Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 5
(2,860 Views)