# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

I have 6 questions and each question has a given name which is the current state of the user:( Somnolence, Concentration, Eveille, Frustration, Entertainment,Content)
I got the values of the answers of these 6 questions in a table and I wrote them in a text file.

Now,

1. I want to group in one table the values of all the valuesof these 9 radio button (see also image values Radio Button.PNG attached).

2. I want to create variables Weight_1, Weight_2, Weight_3, Weight_4, Weight_5, Weight_6

Weight_1 = Sum [of all  values of Somnolence in all Radio Buttons].

Weight_2 = Sum [of all the values of Eveille in all the Radio Buttons].

Weight_3 = Sum [of all the values of Frustration in all the Radio Buttons].

Weight_4 = Sum [of all Entertainment values in all Radio Buttons].

Weight_5 = Sum [of all Content values in all Radio Buttons].

Weight_6 = Sum [of all Concentration values in all Radio Buttons].

To better explain on the image:
Weight_1 = 1 + 0 + 1 = 2

Weight_2= 0 + 1 = 1

Can you  help me please, I am stuck at this level

Message 1 of 16
(1,249 Views)

## Get sum of Radio Buttons Values

I have 6 questions and each question has a given name which is the current state of the user:( Somnolence, Concentration, Eveille, Frustration, Entertainment,Content)
I got the values of the answers of these 6 questions in a table and I wrote them in a text file.

Now,

1. I want to group in one table the values of all the valuesof these 9 radio button (see also image values Radio Button.PNG attached).

2. I want to create variables Weight_1, Weight_2, Weight_3, Weight_4, Weight_5, Weight_6

Weight_1 = Sum [of all  values of Somnolence in all Radio Buttons].

Weight_2 = Sum [of all the values of Eveille in all the Radio Buttons].

Weight_3 = Sum [of all the values of Frustration in all the Radio Buttons].

Weight_4 = Sum [of all Entertainment values in all Radio Buttons].

Weight_5 = Sum [of all Content values in all Radio Buttons].

Weight_6 = Sum [of all Concentration values in all Radio Buttons].

To better explain on the image:
Weight_1 = 1 + 0 + 1 = 2

Weight_2= 0 + 1 = 1

Message 2 of 16
(1,236 Views)

## Re: Get sum of Radio Buttons Values

• Why do you use local variables instead of the terminals for the radiobuttons?
• Why is there so much duplicate code? All you need is one event for all radiobuttons, the process the changed one.
• Do all radio buttons only have tow choices each? In that case a simple boolean would suffice, right?
• Why do you save in thee timeout case 10x per second?
• All the visible properties belong after the case structure!
• Why are the questions individual hidden controls instead of a string array diagram constant?
• Why do you have an array to be compared with label.text. Seems very fragile because there can be typos that are hard to find.

Maybe take a step back and explain step-by-step what the user sees and how he interacts and what the program should do. Simple terms, not a jungle of undecipherable code! LabVIEW Champion. Message 3 of 16
(1,232 Views)

## Re: Get sum of Radio Buttons Values

Hi Ngouda/Etiou,

why do you need 2 accounts and two threads to ask exactly the same question?

Message 4 of 16
(1,225 Views)

## Re: Get sum of Radio Buttons Values

@GerdW wrote:

Hi Ngouda/Etiou,

why do you need 2 accounts and two threads to ask exactly the same question?

Maybe they are students in the same course and that's the verbatim assignment for the weekend. 😄 LabVIEW Champion. Message 5 of 16
(1,197 Views)
Solution
Accepted by topic author Etiou

## Re: Get sum of Radio Buttons Values

In any case, here are some ideas for simplifications. (Not all features are implemented but now it should be much easier to calculate the desired sum (whatever that is!) from the information).

Study it both!

At this time I would leave out the file IO and just generate a text output reflecting the desired file output.

Many things need to be improved, for example you should ensure that all current questions are answered before proceeding to the next step, so modify as needed. LabVIEW Champion. Message 6 of 16
(1,195 Views)

## Re: Get sum of Radio Buttons Values

Hi @altenbach,
I am sorry for the two publications.

Indeed me and Ngouda are in the same class and we are binomial also for this practical work hahaha
We both wrote the question and when I wanted to post on my account I had connection problems and it was very slow, that's why she copied and pasted and published with her account 🙂
And we have to return the work before Monday that's why.
Message 7 of 16
(1,181 Views)

## Re: Get sum of Radio Buttons Values

Hello @altenbach,
Yes you are right, we will try to apply it, thank you very much.
Have a nice weekend

Message 8 of 16
(1,177 Views)

## Re: Get sum of Radio Buttons Values

Hi GerdW,

I am sorry for the two publications.

Indeed me and Ngouda are in the same class and we are binomial also for this practical work hahaha
We both wrote the question and when I wanted to post on my account I had connection problems and it was very slow, that's why she copied and pasted and published with her account .

And we have to return the work before Monday that's why.
Message 9 of 16
(1,139 Views)

## Errors when I try to sums elements in a table

Hello, I am trying to sum the values of the same elements in my table but I have this error.
I don't understand this error, can you help me please?

Message 10 of 16
(1,051 Views)