LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Values Radio button

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 

0 Kudos
Message 1 of 16
(2,120 Views)

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 please help me ?

0 Kudos
Message 2 of 16
(2,107 Views)
  • 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!

0 Kudos
Message 3 of 16
(2,103 Views)

Hi Ngouda/Etiou,

 

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

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 16
(2,096 Views)

@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. 😄

0 Kudos
Message 5 of 16
(2,068 Views)
Solution
Accepted by Etiou

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.

0 Kudos
Message 6 of 16
(2,066 Views)

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.
Thanks for your understanding you had already guessed
0 Kudos
Message 7 of 16
(2,052 Views)

Hello @altenbach,
Thanks for your answer and it helps us a lot.
Yes you are right, we will try to apply it, thank you very much.
Have a nice weekend

0 Kudos
Message 8 of 16
(2,048 Views)

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.
0 Kudos
Message 9 of 16
(2,010 Views)

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?

0 Kudos
Message 10 of 16
(1,922 Views)