07-05-2012 04:25 PM
Hello All,
I am new to LabVIEW and am getting an error that I cannot get rid of. My code consists of a state machine with 5 different states. I am not sure if this is a common error or if I need to supply more information. Please let me know and please help.
Best regards,
L.E.
Solved! Go to Solution.
07-05-2012 04:29 PM
L.E.
If your state machine is a type def enum make sure you have a case for every value. If your case selector is a number make sure all ranges are covered, or specify a 'default' case.
e.g.
Case: 0..10,15
Case: 12
Case: Default
Post your code if you need more help 😉
Michael
07-05-2012 04:30 PM
This is explained in the LabVIEW Help: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/specify_default_case/
You are driving the case structure from an enum. If you connect an enum you need to provide a case for each enum value, or specify one case as the default case to execute if no case matches the value of the enum.
-Or-
You are driving the case structure from a string or numeric and do not have a case specified as the default case if no case matches the value of the string/numeric.
07-05-2012 04:30 PM
What did you wire into the Case Selector? You need to account for every possible value in the Cases (the thing at the top). For Booleans, it's simple, as they are True and False, given to you by LabVIEW. If you wire a numeric, however, you need to somehow specify all 256 or 65536 or an even bigger number of cases. Fortunately, you can use "Default" as a case, meaning "Whatever I didn't mention in the other cases". Try adding an additional case and naming it "Default" -- does this fix your problem? [Note if you really want to only handle, say, 0, 1, 2, and 3, you can make 0 or one of the other cases the Default case, but better would be to have a separate Default and know if you get there, you have a "wrong" selector, one that is not 0 .. 3].
07-05-2012 04:32 PM
OP will be overwhelmed by so much help so quickly!
07-06-2012 09:11 AM
River Daddy,
Thank you for all the help. I no longer have a broken arrow and for that, I am excited. Now I get to see if my code actually works.
Regards,
L.E.
09-05-2012 04:41 AM
very helpful ,TANKEYOU