LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structures

Solved!
Go to solution

All cluster elements are outputs from the subVI. I need to add an element of BMI to the original cluster and an element of the category of BMI (healthy, obese, etc). So for example, for pt one, the SubVI produces (pt number, age, weight, height, gender) after the code each pt cluster should have (pt number, age, weight, height, gender, +BMI, + BMI category).

 

I actually got the category part, now I have an array of categories, but now I need to remove one of the categories and count how many patients of each category there are in that array. Any advice on how to do it? I've been trying to use shift registers and remove from the array function, but no luck so far?

 

Also, how do I use bundle by name to add that BMI category element to the original array of clusters?

 

0 Kudos
Message 11 of 26
(1,576 Views)

If you want the output cluster to have different elements, you need to create a new cluster type and bundle the relevant fields. Sometimes it is easier to just reuse the same cluster. Make sure it contains all needed fields from the beginning. You can hide certain fields if they are not needed for a certain instance.

 

Here is a draft (note that you need to do more detailed cluster and operations,of course). Note that the BMI field is disabled (i.e. cannot be operated at run time and is also colored like an indicator)

 

altenbach_0-1607291723988.png

 

 

Why would you need to remove a category to count how many? To count you don't need to modify the input data. If you have a recent LabVIEW version 2019+, I probably would do a Map based approach.

0 Kudos
Message 12 of 26
(1,571 Views)

Thank you for the picture, I got it to work, using a bit different approach. And it is one of the assignments to remove BMI of 0. I need to count the categories and then plot a histogram. I am trying to use General Histogram VI, but not working. As a matter of fact, I need 3 histograms in one VI, the user has to switch between them in the front panel. Any additional advice would be appreciated. Thank you for your help so far.

 

Plot a Histogram that will show the number of patients in each category;
a. Patients by BMI category (Underweight. Heathy, Overweight & Obese)
b. Patients by BMI category and gender (I.E. so there are eight bins)
c. Patients by BMI category and age using the following bins for age
i. 16 to 25
ii. 26 to 40
iii. 41 to 65
iv. Older than 65
The Front Panel will contain one Histogram Plot. The user is able to switch between the different histogram information.

 

 

0 Kudos
Message 13 of 26
(1,560 Views)

Don't overcomplicate it with fancy terms such as histogram. All you need is an integer array with an element for each count, then graph it on a bar graph style plot. Right?

0 Kudos
Message 14 of 26
(1,547 Views)

I wish, how would I get an integer array with an element for each count? And I believe we need an actual histogram, Im trying to use histogram express VI or general histogram VI, but it isn't really user friendly, so can't get what I need it to do

0 Kudos
Message 15 of 26
(1,541 Views)

An integer array displayed in a bar graph *is* a histogram.

0 Kudos
Message 16 of 26
(1,538 Views)

I am trying to create an array which associates BMI and age, which array function should I use inside the for loop, so every iteration adds a BMI with age-associated with it - through the indexing tunnel?

0 Kudos
Message 17 of 26
(1,541 Views)

I have an appended array of age and BMI associated of that specific patient. How do I remove the patient (patients BMI and patients age) if BMI equals to 0, and output an array of age-associated with BMI (for only patients who have a BMI above 0)?

0 Kudos
Message 18 of 26
(1,521 Views)
Solution
Accepted by topic author taras01

Hi taras,

 

please keep things in one place: no need to start new threads for the (basically) same topic…

 


@taras01 wrote:

I am trying to create an array which associates BMI and age, which array function should I use inside the for loop, so every iteration adds a BMI with age-associated with it - through the indexing tunnel?


How do you want to "associate" a BMI value to an age? Which kind of "association" to you want to realize?

 


@taras01 wrote:

I have an appended array of age and BMI associated of that specific patient. How do I remove the patient (patients BMI and patients age) if BMI equals to 0, and output an array of age-associated with BMI (for only patients who have a BMI above 0)?


Which kind of patients have a BMI of zero?

 

After all those questions you really should be able to attach your current VI so we can suggest possible improvements. You already know we will not solve your homework for you…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 26
(1,524 Views)

This is not exactly homework. I have genuine questions, but figure some out as I go. I got an array of age and bmi associated together, but cannot pass that array into the histogram vi, because that Vi takes only 1d array and cannot pass two separate arrays into the histogram either. And bins do not allow more elements to be added. Is it even possible to add more elements to the bin? Can you please guide me on how to proceed in this situation?

0 Kudos
Message 20 of 26
(1,514 Views)