04-29-2017 05:03 AM
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.
Solved! Go to Solution.
04-29-2017 06:30 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-29-2017 12:25 PM
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
04-29-2017 12:36 PM
Thanks it works now 😉