LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

How to get value and calculate average of value in table

Hello dear all,
I am totally new on Labview, today I come to ask you two questions if you please.
In fact I'm retrieving measurement data from Labview and I have to:
firstly calculate the average of the values in table1
and secondly I have to do the sum of ( values index i of table1 multiply by values index i of table2).
Surely it is very simple but I do not know yet, thank you for your help

Message 1 of 8
(1,445 Views)

Re: How to get value and calculate average of value in table

Hi Melanie,

@Melanie23 wrote:

firstly calculate the average of the values in table1
and secondly I have to do the sum of ( values index i of table1 multiply by values index i of table2).

1. Use the Mean function…
2. Multiply both "tables" and use the ArraySum function…

(As I cannot open your LV2020 VI right now I guess when you write "table" you are using a numeric array instead.)

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(1,438 Views)

Re: How to get value and calculate average of value in table

Could you supply more information on where this data is coming from?  It seems to me it would be a lot easier to do this process closer to the raw data instead of this formatted string.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 8
(1,435 Views)

Re: How to get value and calculate average of value in table

Hi GerdW,

It's a 1D table with strings if it was only numeric in the table I could do the sum but with the strings in it I really don't know how to do it.
I've been looking for the function you're telling me about but I can't find it, can you show me when you're available please??
Best regards

Message 4 of 8
(1,413 Views)

Re: How to get value and calculate average of value in table

Hi crossrulz,
Hi,
This data comes from another application on the bench, it would be very complicated to post it.
I'm in my first year BTS and it's my first day on LabVIEW and I just started, I'm asked to manipulate this data to calculate the average and do the multiplication in the meantime.
So if I can understand and manipulate these formatted data I could do the rest.
I am reading the LabVIEW course but I need some help 🙂

Message 5 of 8
(1,409 Views)
Solution
Accepted by topic author Melanie23

Re: How to get value and calculate average of value in table

Hi Melanie,

@Melanie23 wrote:

It's a 1D table with strings if it was only numeric in the table I could do the sum but with the strings in it I really don't know how to do it.

So it is a 1D array of strings? ("Tables" are a 2D array of strings in LabVIEW!)

See this:

As you are new to LabVIEW I recommend to use QuickDrop:

When typing <Ctrl-space> a small dialog window opens and you can search for functions by typing just a part of their name.

By pressing <Enter> you can easily drop the selected function in your block diagram…

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 8
(1,408 Views)

Re: How to get value and calculate average of value in table

Hi GerdW,
Thank you for your answer I did not know about the table.
Please can you send me a snippet or the vi?
Thanks a lot.

Message 7 of 8
(1,392 Views)

Re: How to get value and calculate average of value in table

Hi Melanie,

@Melanie23 wrote:

Please can you send me a snippet or the vi?

Unfortunately I didn't save that tiny VI after creating the screenshot. But I show all the relevant function names so you can easily recreate it!

Why don't you talk with Steph? (S)he basically has the same issue, as he is using very similar string arrays with the same formatting of "key = value" for some unknown reason?

Are you students in the same class/group?

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 8
(1,345 Views)