LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

define number of case structure cases

Solved!
Go to solution

@Grant_C wrote:

@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: hereCan you shed any light on the Xcontrol your rookie developed?

Regards,


 

Not without giving away a trade secret. Smiley Wink

 

WHat I can do is invite you to chase down the posts where I posted about a GUI Controller.

 

1) Fist, here is a link to an albumn that has images I have posted to support the topci of a GUI Controller.

 

2) Click on each of those images to get a bigger image.

 

3) SCROLL DOWN below the image and you should find links to the original threads where I talked about the code.

 

Read what I have posted already.

 

But generally speaking...

 

We have been responding to your specific question as best we can but I wonder if you are using the best approach for this task.

 

Yes I have written apps that have as many as 500 FP objects but they were not being used as data storage just for display and user interaction.

 

I suspect your code shoould be developing a cluster ON THE BLOCK DIAGRAM that can be passed to the sub-VI to gen the report.

 

So while I am trying to answer your question I want to turn it around and ask if you have concidered just packing up the data in a cluster that can be passed to the sub-VI rather than trying to "reach out" from the sub-VI to get the data?

 

Take care,

 

Ben

 

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

Hi Ben, thanks for those images.  I see in image "1_Bundle_Refs.PNG" that you use a method that I have been using in my subvi's that make up my front panel.  Here you are using references feeding into a bundle and using their respective constants to create a single constant.  Is this methods OK as this is what I am intending on using but I am a bit suspicious from feedback left in this thread.  Due to the amount of references I will have(200), it will take up a lot of BD space so that is why I posted this suggestion of using a case structure.  The outcome of the case structure would be the same with 1 cluster of references that I could feed into my subvi.  Earlier I posted an example of my intentions with an example using 4 references and a case structure but I would in fact have 200 cases.  Do you think this would be suitable as I don't see much difference. 

0 Kudos
Message 22 of 29
(1,267 Views)

link to "1_Bundle_Refs.PNG" here

0 Kudos
Message 23 of 29
(1,264 Views)

If it's a report of 200 clusters, is it some test protocol? If so, itsn't it an array of the same clusters, or could be? If so, send the array and generate the report from that. 🙂

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 24 of 29
(1,262 Views)

I have not seen your specific application but I still believe you are going about things in the wrong manner. Are you saying taht a single record (row) in your report contains 200 pieces of data? Unless they are simply an array of data it sounds like you are not decomposing you data and functionality enough. I know you have not stated that you are using a database but you would be hard pressed to find a well designed database that had tables with 200+ columns in it. Also, if you are passing the data to a report generator it is best to pass the data, not references to it. As I mentioned earlier you don't want to tightly couple your processing code (report generation) with your GUI. Passing references does just that. Ben pointed you to his thread about separating your GUI from your processing. Your application will be much harder to maintain if you lower level code reachs out to the GUI for data.



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 25 of 29
(1,254 Views)

Hi Mark, thanks for your response.  My Word and Excel reports will use these 200 reference clusters (results in the form of indicators, graphs and tables along with the tab controls for screenshots) to generate the reports.  I don't have a single record as you call it.

When you say its best to pass data to my subvi instead of references like I intend in the form of a single cluster of references, how would you go about getting 200 clusters into the subvi.  A cluster of clusters?  That would mean all my code that I have so far written would change. (not a problem if its the correct method).  At present my flat sequence code is using references into my subvi's to populate my front panel - see my attached vi which shows my front panel and all the indicators that are currently referenced.

Regards,

0 Kudos
Message 26 of 29
(1,240 Views)

200 reference clusters? Sounds like 1 array of ref to me. 🙂

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 27 of 29
(1,225 Views)

Since you are open to improving your code I suggest you shift focus from try to get ath the FP controls using references and use a cluster to store the DATA you will need in your report.

 

This image shows a sub-VI where a cluster is passed in, a new value is added to an array and then packed back into the cluster.

 

Bundle_By_name.JPG

 

Accessing the data using acluster is much faster than getting a control or indicator involved and will also work toward reducing the potential of Race Conditions.

 

SO I would envistion you code as passing the cluster from state to state filling in the parts and when ready to report, pass the cluster to the function that will write the report.

 

Ben

 

Ben

 

 

 

 

 

 

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

Hi Ben, Thanks for your recent suggestion however through discussion with NI, I have decided upon my best way forward for now.  I am sticking with bundling up my references into a single cluster (using my aforementioned techinique using the case structure to reduce the size on my BD) due to the fact that i need to programaticaly change my tab controls to select which page is visible prior to me taking a screenshot and pasting this in Word.

Thanks ALL for you help.  I have picked up some great tips through this thread.

Grant

0 Kudos
Message 29 of 29
(1,206 Views)