LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turning off and on an LED in a stacked sequence


cmhand wrote:
What constants are you referring too?

The ones in each case that determine what is the next case that will execute.

 


For(imt..  wrote:
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.

 

The original poster should really use typedef's.  What you say might be fine if he never makes further changes.  But add 1 more case and you have to do this all over again.  Here is a recent message thread where I wrote up the steps for working with typedef's.

0 Kudos
Message 21 of 37
(777 Views)

here is your quote from the other message Raven

 

Take one of your enum constants and turn it into a control.  Do an Advanced/Customize on the control.  From the toolbar at the top of the Control editor, select TypeDef rather than control.  (TypeDef (Strict) is okay also.).


Here is my quote.

For(imt..  wrote:
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
 
How is this different :)?

 

 

0 Kudos
Message 22 of 37
(774 Views)
raven wrote:

Go back and turn that control back into a constant.

 

Replace all constants wherever used, with the typedef'ed version of the constant.  Edit the SubVI so the Enum control that you use in the connector pane is also the TypeDef control.

 

Now whenever you update your subVI, you can add a new item to the Enum control and resave the control.  Everywhere that control is used (including the constants) will have the new item automatically added.

 

After I save how do I convert the enum back to a constant?? Also I started from scratch with the enums so I have no enum constants or shift register anywhere besides the one I just added

0 Kudos
Message 23 of 37
(773 Views)

for(imstuck) wrote:

here is your quote from the other message Raven

 

Take one of your enum constants and turn it into a control.  Do an Advanced/Customize on the control.  From the toolbar at the top of the Control editor, select TypeDef rather than control.  (TypeDef (Strict) is okay also.).


Here is my quote.

For(imt..  wrote:
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
How is this different :)?

 

 


I'm sorry.  There is no difference.  There has been such a flurry of activity on this thread that I post once, and 5 new messages appeared during that time, that I read all the new messages so quickly that I missed some of the details they are saying.  This one was of them.

Message 24 of 37
(770 Views)

cmhand wrote:
raven wrote:

Go back and turn that control back into a constant.

 

Replace all constants wherever used, with the typedef'ed version of the constant.  Edit the SubVI so the Enum control that you use in the connector pane is also the TypeDef control.

 

Now whenever you update your subVI, you can add a new item to the Enum control and resave the control.  Everywhere that control is used (including the constants) will have the new item automatically added.

 

After I save how do I convert the enum back to a constant?? Also I started from scratch with the enums so I have no enum constants or shift register anywhere besides the one I just added


You have nothing but enum constants.  The one that goes to the left hand shift register from outside the loop, and the ones that are in each and every case that go to the right hand shift register.  I would work with the left one and replace the ones in the case structure later once you have the type def control saved.

 

You can take constants and turn them into controls or indicators by going right click,  Change to Control  (or indicator).  When you have the control converted to a saved typedef version, you can turn it back into a constant by right clicking and selected Change to Constant.

 

While I wouldn't consider some of these concepts basic, I do think you will need to know them to move onto the next level of LabVIEW programming.  I would recommend you learn more about LabVIEW from here. I would recommend you learn more about LabVIEW from here. How to Learn LV

Message Edited by Ravens Fan on 03-06-2009 11:13 AM
0 Kudos
Message 25 of 37
(768 Views)
after I did the typedef thing and saved then you said to change back to constant, when I right click on the enum on the front panel I have only the option to change to indicator, nothing about a constant...
0 Kudos
Message 26 of 37
(762 Views)
nvm I figured out the constant thing sorry, so I have my enum control set up for outside the while loop, now do I create a whole new enum constant on the front panel and add everything and then add that to the case structure?
0 Kudos
Message 27 of 37
(758 Views)

Go to the block diagram and you'll have change to constant.  That's because the front panel can only have indicators and controls.  Constants don't have any meaning for a front panel since they aren't a user interface item, just a programming item.

0 Kudos
Message 28 of 37
(757 Views)
Yeah I figured that out, but now that I have that set up I want to do the case structures...do I do the enum constant on the front panel again??
0 Kudos
Message 29 of 37
(754 Views)

Once you have the typed def'd enum constant on your block diagram, just wire that into the left hand shift register then into the case selector of the case structure.

 

In case you don't know, if you turn on context help (ctrl-H) you can hover the mouse over any wire and it will give you a description of the data being carried by the wire.  A typedef data type will have the name typedef show up in the description.

0 Kudos
Message 30 of 37
(750 Views)