LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turning off and on an LED in a stacked sequence

There is something odd about your enum that I can't quite figure out.  (Actually while toying around with things, LV crashed on me.)

 

There are a lot of coercion dots along your blue enum wire.  Your case structure has a mix of numbers and names.  Usually with case structures wired to enums, the cases will all be named.  I think this could cause unexpected behavior in your program.

 

When I deleted the wire going from the case structure to the right hand shift register, a lot of coercion dots went away.  And the numbered cases in the case structure suddenly became named.  But there were stil coercion dots where the constants in the cases run into the right hand tunnel of the case structure.  If I re-add the wire from the case structure to the shift register.  Some of the named cases go back to numbers.

 

All the constants appear to be identical, so I don't know why they are getting coercion dots.

 

I would recommend taking one of your constants, and turning it into a typedef control.  Then go back and replace all the constants with the type def constant.  You can search the forums if you aren't familiar with how to use type defs.  The advantages are that all the constants will be consistent.  And if you need to add a case at a later date, you can add it to the type def enum control one time.  You won't have to go back and updated dozens of instances of the constants.

0 Kudos
Message 11 of 37
(1,391 Views)
Okay so I think that has to do with the enum thing...when I added more frames to my sequence and then added them into the enum thing the title turned red and all the previous titles on the frames changed to numbers...why is that and how do i fix it???
0 Kudos
Message 12 of 37
(1,390 Views)

cmhand wrote:
Okay so I think that has to do with the enum thing...when I added more frames to my sequence and then added them into the enum thing the title turned red and all the previous titles on the frames changed to numbers...why is that and how do i fix it???

 

Wow, a lot of other messages popped up while I was typing mine.  Please take a look at my message right before this.  That should get you on the right track.

0 Kudos
Message 13 of 37
(1,387 Views)
Yesterday on here some guys actually edited my state machine and gave me the state machine I posted and when I went to add frames and more enums is when everything started  turning red and my names on my frames turned to numbers
0 Kudos
Message 14 of 37
(1,385 Views)
What constants are you referring too?
0 Kudos
Message 15 of 37
(1,382 Views)

Ravens Fan wrote:

There is something odd about your enum that I can't quite figure out.  (Actually while toying around with things, LV crashed on me.)

 

There are a lot of coercion dots along your blue enum wire.  Your case structure has a mix of numbers and names.  Usually with case structures wired to enums, the cases will all be named.  I think this could cause unexpected behavior in your program.

 

When I deleted the wire going from the case structure to the right hand shift register, a lot of coercion dots went away.  And the numbered cases in the case structure suddenly became named.  But there were stil coercion dots where the constants in the cases run into the right hand tunnel of the case structure.  If I re-add the wire from the case structure to the shift register.  Some of the named cases go back to numbers.

 

All the constants appear to be identical, so I don't know why they are getting coercion dots.

 

I would recommend taking one of your constants, and turning it into a typedef control.  Then go back and replace all the constants with the type def constant.  You can search the forums if you aren't familiar with how to use type defs.  The advantages are that all the constants will be consistent.  And if you need to add a case at a later date, you can add it to the type def enum control one time.  You won't have to go back and updated dozens of instances of the constants.


I was having the same issue. When I deleted the shift register and enum and started from scratch it seemed to all go away though? Weird.

0 Kudos
Message 16 of 37
(1,383 Views)
So Im really confused how to fix this....
0 Kudos
Message 17 of 37
(1,377 Views)
Create and enum control on the front panel. Right click, go to advanced, customize. There is a drop down menu that says control. Choose type def. Add all of your enum cases then save this control. Now choose select a control from the controls pallete. Voila, there is your enum control with all of your cases added. You can put multiple instances in your VI now to be sure all of the cases match correctly. Any additions to this someone feel free to add.
0 Kudos
Message 18 of 37
(1,373 Views)
Is there a certain way you have to add enums?? because when I add an enum outside my while loop and through the shift register then I added an enum inside my case structure but when I edit my enum outside the while loop it doesnt add that to the enum inside the case structure...do I have to add to both enums every title frame??? I have an odd feeling that this is why my titles are red
0 Kudos
Message 19 of 37
(1,371 Views)
I would delete all of your enums you have in their now but leave your case structure. Make your type def control as was stated above then relink this custom control to your case structure. You can then change the control to a constant in your block diagram by right clicking
0 Kudos
Message 20 of 37
(1,367 Views)