LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enum out

Solved!
Go to solution

Hello everobody,

I work on a rubik's solver and I try to do a randomize. I have a machine state for the 6 motors and an other machine state for the direction of rotation.

I did it in a subVI and I would like to add an enum indicator in output and it doesn't work, I don't know why.

Here is my subvi.

 

Thanks for your help.

0 Kudos
Message 1 of 4
(2,604 Views)
Solution
Accepted by topic author PierBJX

You didn't include the TypeDef file "Commande 1.ctl" in your attachment, so it's broken when I load it.

 

Your basic problem is that the constants on your diagram are of type "Commande 1", but your panel indicator is a generic ENUM.  That will never work.

 

Your indicator has to be the same data type as the data you feed it, and an enum of "A", "B", "C" is a different data type from an enum of "X", "Y", "Z".  They won't match.

 

To fix it, you can either:

--- Place an instance of your typedef on the panel instead of the generic ENUM, or

--- Delete the generic enum, pop up on your output wire and CREATE INDICATOR.

 

Either way, your indicator will then match the data type of the wire.

 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 4
(2,573 Views)

It looks to me like your Enum consists of the States of a State Machine.  I'm wondering if you might want to consider another Organizing Principle, namely the six Faces (Blanc, Bleu, etc.) and two Directions (horaire, anti-horaire).  You might create a cluster of the two that says Which Face and Which Direction.

 

Your State Machine might then become "Initialize", "Compute Move" (which returns a Cluster of Face/Direction), "Do Move", "Quit".  [I realize this is probably a vast over-simplification, but I'm trying to make "Move" a more abstract concept ...].

 

Bob Schor

0 Kudos
Message 3 of 4
(2,540 Views)

Thanks it works now 😉

0 Kudos
Message 4 of 4
(2,535 Views)