LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Link information from tables and show the "best " box.

Solved!
Go to solution

Hello! I'm totally new to this great software and the truth is I'm lost 😧
 
I try to explain in more detail what I have to do, I hope you can help me please it's urgent T_T

I must make 3 tables should be linked to each other , ie a table where the name of a user will be manually enter, another where you manually enter the last name of a user and the third which will automatically enter the power of each user (for the automatic entry i will use a random data ) . Each table will have a box number , for example :
 
Table 1, Box 1: Paul
Table 2, Box 1: Gate
Table 3, Box 1: 3.74
 
Table 1, Box 2: Miguel
Table 2, Box 2: Ramos
Table 3, Box 2: 4.99
 
Table 1, Box 3: Maelle
Table 2, Box 3: Branco
Table 3, Box 3 : 4.98
 
I mean, I link the box to a table with the other three . And given that the program must compare the data in Table 3 (power ) and display data from the best user ( who has the highest power). In this example, the program should display :
 
BEST USER :
NAME: MIGUEL RAMOS
POWER: 4.99

 

(Is not nessesary save the information when i will close the program)

 

I do not know if I 'm asking a lot , I have a very clear idea in my head of what I have to do , but being a new software for my not know how to implement it .


 
Thank you in advance for your help and quick and ilustrative response! xD

0 Kudos
Message 1 of 12
(3,131 Views)
It would be nice to post what you have done already and where you are in code.
-check this it be helpful to you
http://forums.ni.com/t5/LabVIEW/How-to-find-closest-value-in-array/td-p/1128281
Thanks
uday
0 Kudos
Message 2 of 12
(3,125 Views)

I dont know even how to start 😧 i can just make the tables and make the "random data" in table 3...


0 Kudos
Message 3 of 12
(3,119 Views)
Solution
Accepted by topic author Miguel_Exe

Did tried something with basic understanding of your question check if this is what you need??

-Still not clear what you mean by table??( In my opinion table is 2d array of values here if not please let me know.)

-That's the reason i asked you to show your code what you have done then it will be more clear.

Thanks
uday
0 Kudos
Message 4 of 12
(3,109 Views)

Thank you for you reply! 


saw that you registered the program and is only 1 part of what I wanted, I attached a picture to this message with a draw to give to clearly understand my idea.

 

Thank you very much for your support!

0 Kudos
Message 5 of 12
(3,075 Views)

Hi Miguel,

 

you should organize your data into a more appropriate structure, but for a starting you may try this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(3,061 Views)

Hi Miguel_Exe

-Please check the snippet it does exactly what you said.

-The Box 1,2,3 you mentioned are array indices.For example if you use table_1 and index it with 0(Yes, arrays index starts from 0), you will get first element which is Miguel-Vi used is Index Array.

-For linking you can use string concatenation. Get each element from array using proper index and use Concatenate Strings.

-I am getting the last Numerical Table and passing it to Array Max and Min to get where maximum value is and using same index (Box value) am getting full name.

Thanks
uday
0 Kudos
Message 7 of 12
(3,050 Views)

Hi udka,

 

to check for MAX values on a string array is "kind of dangerous" - I would not trust this to work with all strings. That's why I tested the DBL array in my snippet...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(3,024 Views)
Hi GerdW,
-Infact i did the same first, converting the string to float and then got MAX values.
-But then later i thought converting is redundant. Can you please provide more info on why its dangerous and where it fails??
Thanks
uday
0 Kudos
Message 9 of 12
(3,016 Views)

Hi udka,

 

strings are sorted lexically, while numbers are sorted by their value.

 

Which string is bigger: "222" or "39"? Which number is bigger: 39 or 222?

 

Also using strings will go insane when the user hits the wrong keys: what happens when the user inputs "123-23" instead of "123.23"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 12
(3,003 Views)