LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

define number of case structure cases

Solved!
Go to solution

You can use property nodes to get the labels of all of your data scructures and they can be written to the stings of a ring control.

The ring can then be replaced with a an enum.

Save the enum as a type def.

WIre it to the case and then do as suggested above to "add case for all values".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 29
(1,271 Views)

Hi Ben, but I only want to have say 200 cases named "0..199" without having to add next case manually?  That is if what I am doing is programatically correct to link 200 references from the top level down to a subvi.

0 Kudos
Message 12 of 29
(1,268 Views)

Here is an example of how you can start the process of using property nodes.  You need to dig down into the tabs and clusters until you get to the elementary controls with the data.

 

What Ben is suggesting will allow you to have meaningful names on the case selectors rather than 0..199 without having to type them all in.

 

Lynn

0 Kudos
Message 13 of 29
(1,262 Views)

Hi Lynn, i think we are on different tracks albeit your suggestion will come in handy.  It has also go me thinking that i perhaps dont need to bundle all my cluster references up in order to feed the 1 cluster line from the top level into my subvi but perhaps do as you have done with the front panel reference ctl?  Would this work in terms of then indexing the particular set of results or controlling which tab page was visible during my report geneartion subvi?

0 Kudos
Message 14 of 29
(1,253 Views)

Yes, you can use property nodes and control references to manipulate the appearance of the panel.

 

This can be slow and may be confusing to the user if the panel changes just as the user clicks on a control for a different purpose.  Plan carefully.

 

Lynn

0 Kudos
Message 15 of 29
(1,243 Views)

@Grant_C wrote:

Hi Ben, but I only want to have say 200 cases named "0..199" without having to add next case manually?  That is if what I am doing is programatically correct to link 200 references from the top level down to a subvi.


To me it sounds like you are going about things the wrong way. First, if you have 200 controls on your front panel something is very wrong with your application and the UI would be virtually unusable since no one will be able to keep track of the clutter you present. If you are using controls on the front panel as some type of variable storage, again you are going about things the wrong way. In LabVIEW you can think of the wire as the variable. (It is a bit more complex than that). If you are passing large number of references to subVIs you are again going about things in the wrong way. Unless the subVIs are written specifically and only for the purpose of controlling the UI than a subVI should have no knowledge of the UI. Your application should be separated to have code to control the UI and that is the sole purpose of it. Then you would have code that does the processing. Use queues, user events or notifiers to pass data from the processing code to the UI when updates are required.

 

As others have said it would help if you tried to better explain what you are trying to accomplish.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 16 of 29
(1,247 Views)

Hi Mark, just to clarify, i have 200 clusters that include controls/indicators/tab pages.

0 Kudos
Message 17 of 29
(1,227 Views)

@ Hi Lynn, my report generation vi will execute after all the tests have completed.  It is basically a subvi that will create a MS Excel report and MS Word report.  The user will have no input at this point.

0 Kudos
Message 18 of 29
(1,226 Views)

Mark_Yedinak wrote: If you are passing large number of references to subVIs you are again going about things in the wrong way. Unless the subVIs are written specifically and only for the purpose of controlling the UI than a subVI should have no knowledge of the UI. Your application should be separated to have code to control the UI and that is the sole purpose of it. Then you would have code that does the processing. Use queues, user events or notifiers to pass data from the processing code to the UI when updates are required.

Hi Mark, yes, I am trying to feed a cluster of 200 references down into my report generation subvi.  In a previous post, I included a vi with my front panel and the BD shows the various types of data that I am referencing.  The front panel clusters of results is populated in a flat sequence of test with minimal user interaction.  Once the test is finished (all clusters populated), I then want to use these results for report generation.  The reason I include the tab page reference is that some of the tables/indicators are not suitable for my report so I simply manipulate the particular tab page which is visible and take a screenshot and programatically add this to my report instead.  All other results, I simply use property node to index the appropriate reference line to gain access to the results.

During my test sequence, I have all clusters of indicators/tables etc on the top level and use a single reference line down into my subvi's where I simply use a property node(value) to populate my top level.  I achieve this single line by bundling up the references into a single cluster of references.  Can you please offer advice if you think is a good method or not.  

Regards,

 

0 Kudos
Message 19 of 29
(1,223 Views)

@Ben.  Hi Ben, i believe what i am trying to do with my 200 references of clusters is similar to a thread you were involved in some time ago: here.  Can you shed any light on the Xcontrol your rookie developed?

Regards,

0 Kudos
Message 20 of 29
(1,212 Views)