From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

implimante Header Row for array

Solved!
Go to solution

Hi

I want to know how to insert Header Row to an array of double  ? 

0 Kudos
Message 1 of 6
(3,965 Views)

Hi Emna,

 

as long as that "header row" only contains even more DBL values you could use BuildArray to prepend one more row to your 2D array.

 

When those "header" should consist of strings you could

  1. convert your DBL array to a string array and prepend your string header row
  2. use a Table or MultiColumnBox to display your data and use their (separate) header row property
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,945 Views)

Do you mean you want to insert a double value at the beginning of the array? Then use "build array".

 

Do you mean that you want a list or table of the values with a header on top? Then use a listbox or table and put the values there.

 

Please show some code and explain what you want if this answer is not enough.

Certified LabVIEW Architect
Message 3 of 6
(3,944 Views)

@Emna20 wrote:

I want to know how to insert Header Row to an array of double  ? 


Wild guess because you don't give sufficient information:

 

For display, you can format the array as 2D arrays of strings, use a table indicator, and show the header row.

0 Kudos
Message 4 of 6
(3,921 Views)

Hi 

i find two solutions .

1) the first solution is to convert the array of DBL to an array of string and after that, use build array function to concatenate the array with the header .

Capture1.PNGCapture2.PNG

2)  the second solution is to convert the array of DBL to an array of string and after that , use table from (List table, & Tree  palette)  to add header go to Properties.

Capture3.PNGCapture4.PNG

 

 

0 Kudos
Message 5 of 6
(3,886 Views)
Solution
Accepted by Emna20

@Emna20 wrote:

Hi 

i find two solutions .


Your solutions are extremely convoluted and parts of the code make no sense at all. Why do you think you need to go from array to string and back to an array? That's a lot of expensive processing. Also, "%2.1" is NOT a valid format. Fortunately, the function ignores illegal formats and treats it as "%s" here..

 

Here's how you would do it instead. Much simpler! Same result. (See also)

 

Headers.png

 

Message 6 of 6
(3,870 Views)