LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure: selector values have wrong type

Are you trying to edit the control or the constant?  I don't think you can edit the constant, since it's a typedef.  You need to open the typedef, so that a front panel is showing with the enum on it.  Then launch the properties dialog from that enum.  Also, you'll probably want to find the typedef on disk (Ctrl-I on the typedef to see its path on disk) and make sure the file is not read-only.  I'm not all that familiar with the State Diagram Toolkit, so I'm not sure if there are any other weird factors that may be at play here.

Again, if you're still having problems, you can attach the .ctl file to your next post and I can try it and see if there are any additional strange problems going on that I haven't thought of.

Good luck,

-D

Message 11 of 21
(7,247 Views)

Just to throw something else in -

I don't have the SDTK, but I remember a thread from a few months back about it using Xnodes, which also allowed it to lock the code so that you can only modify it using the SDTK.


___________________
Try to take over the world!
0 Kudos
Message 12 of 21
(7,236 Views)
I createda new VI, and can edit it. It seems that you can't once you made it with the toolkit, even after you tell it to have it brake the links.
0 Kudos
Message 13 of 21
(7,230 Views)

It is a lot easier to answer these questions after someone else has asked all of the questions.

I have, use, and love the SDE (State Digram Editor).

I have also attempted to hack it a bit and realized early on that playing with the enum used to drive the resulting SD (State Diagram) was a bad idea. I seem to remember that if you copied off the enum constant and attempted to use it in a comparison that would throw either an insane object error or crash LV, I forget which. Smiley Surprised

The bottom line is don't play with the enums and case structures from the SDE. There are better ways to create and edit enums and cases. Smiley Wink

Just use the SDE for what it is intended (writing complex algorithms in a self documenting graphic over-view).

But...

It looks like you just found that out. Smiley Sad

Ben

Message Edited by Ben on 01-18-2006 07:13 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 14 of 21
(7,205 Views)

I'm having a similar issue, and instead of starting a new thread, I thought I'd revive this old thread to save space.

 

In the V belowI, I am trying to add another case to my Case Structire but it's coming in red. I can't for the life if me figure out why. I am a beginner at Labview. I'm running Labview 2009 Version 9.0

Message 15 of 21
(6,768 Views)

Your state enum does not have a "test" value.  Add the value to the enum and you should be OK.

 

If you create control and make it a type def, you will not need to edit every constant when you add a case and the case structure will also adapt.

 

Lynn

0 Kudos
Message 16 of 21
(6,762 Views)

You have an enum wired to the case selector. You would have to add a 'Test' value to your enum before you can add a case of that value and you should really be using a type det for the enum. Now you have to edit each instance to add 'Test'.

 

p.s. You should also work to eliminate all of those stacked sequence structures and local variables.

0 Kudos
Message 17 of 21
(6,760 Views)

Dennis & John,

 

Where in the functions pallet do I find the type def?

 

Thanks for your patience.

0 Kudos
Message 18 of 21
(6,750 Views)

@BadAzzS10 wrote:

Dennis & John,

 

Where in the functions pallet do I find the type def?

 

Thanks for your patience.


Typed defs are defined by customizing the control.

 

I wrote this Nugget on that topic to help with this question.

 

I hope that helps,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 19 of 21
(6,744 Views)

It is not a function.  You create a typedef by customizing a control.

 

Since you do not appear to have a control, create on by changing one of the constants to a control.  From the front panel select the control and use Edit >> Customize Control...  In the control editing window which pops up you can choose from the tool bar Control, Type Def, or Strict Type Def.  Read the help for more details.  Save the customized control.

 

Lynn

Message 20 of 21
(6,742 Views)