LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ranking Students Grade - LabView Error

Hello I am trying to rank students grade with a program and I am not being able to connect everything to my results array. I don't know what to change. Help please 😞

help1.pnghelp2.png

0 Kudos
Message 1 of 15
(1,665 Views)

Hi Irene,

 


@irenedgl wrote:

 I am not being able to connect everything to my results array. 😞


Because there is no "result array"!

Make an array from your output cluster...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(1,658 Views)

How do I do that? I thought my array "Students Results" that would be connected to the output cluster would be the results array. I am confused.

0 Kudos
Message 3 of 15
(1,632 Views)

Hi Irene,

 


@irenedgl wrote:

How do I do that? I thought my array "Students Results" that would be connected to the output cluster would be the results array. I am confused.


I'm sorry, when answering from phone I thought your "output cluster" would be connected to the last FOR loop...

 

As you chose to not attach your code you need to debug on your own: which error explanation is shown (in the context help) when you move the mouse over the broken wire?

Keep in mind: we cannot debug/edit/run images with LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(1,623 Views)

The loop will iterate exactly as many times as the input array is long, in this case Zero!

No, the 5 won't change that, but it will limit it to 5 should your input be longer.

Also, it looks like your Output cluser is the same as the result array, but since they're not a type def (make it a type def) they might have different Tab order, which'll cause a broken wire.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 15
(1,617 Views)

I feel like the others didn't get to the point. It seems like you redefined the clusters content during writing the code. I can't see what, the code seems correct, but it might be something small. It might be that Output cluster 2 and Student results array have different contents. The easiest way now is to unwire the Student results array, right-click the indexing output terminal and select Create indicator, which will totally contain the correct data type.

 

In order to avoid these type mismatches, make typedef out of the cluster and replace every cluster instance with the typedef. Once you change the typedef, it gets propagated to every instance.

0 Kudos
Message 6 of 15
(1,609 Views)

Deleting the output array and creating a new indicator will most likely solve the issue.

Otherwise, please attach your VI so that we can comfortably debug.

 

Fort

0 Kudos
Message 7 of 15
(1,589 Views)

You are close. This is what I would do.

 

Test Grade Example.png

Tim
GHSP
Message 8 of 15
(1,561 Views)

@irenedgl wrote:

Hello I am trying to rank students grade with a program and I am not being able to connect everything to my results array. I don't know what to change. Help please 😞

help1.pnghelp2.png


Your code has serious problems.  For example, what would the grade be for a student that scored 82.5, 84 100 on the tests? (24.75+ 24.2 + 40 = 89.95) That's never in range and your student gets No Grade!  Those 40Q tests are pretty standard for an exam.

 

Let's rethink this using a lookup string array of "NG, F, D, C, B, A, A+"  and index the array by "weighted average" /10 - 4

 

At the very least use the same value for LL and the next lower grade UL and enclude LL only except for the A range ( you want the 100 included there unless acing the course can only be done by cheating)

 

Let's rethink ranking students by acending name too!  For that sort to work correctly the grade can be the only concern!  If John Smith and Jane Doe both ace the course do you really want Jane to rank above John?

 

Hint: Use the floor of the threshold of a sorted array of 100 - average of each student's 100 - average


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 15
(1,546 Views)

Maybe this will work for you, plus its written in the student edition for bonus irony points : )

snip2.png

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 10 of 15
(1,502 Views)