Create Dynamic Headers in a Spreadsheet in LabVIEW

Updated Oct 25, 2023

Reported In

Software

  • LabVIEW

Issue Details

I´m looking for best practices to create headers for spreadsheets. Normally they are created using a build string array or concatenate strings, using a string constant. I´m wondering if the label for each control could be read and then sent to create the headers.

Solution

The labels for each control can be use for create headers for spreadsheets, in order to do this, please follow the steps below.
  1. Right-click your control which you want to obtain the label to create a header, and select Create>>Property Node>>Label>>Text.
explorer_KeBDsEJ89l.png
  1. Once your property node has been created, wire the output to a build array function and then wire the output of the build array function to the 1D data input of the Write Delimited Spreadsheet VI.
explorer_zVgvLfb0dW.png
  1. Now that your spreadsheet has headers, you can now add the data in your spreadsheet. Below is an example where ten numbers are randomly created and stored in the Test1.txt file under the header Label-1.
explorer_pbxBax0wpJ.png
explorer_gkk9FqtnrA.png
 

Additional Information

The code shown above can be implemented using multiple headers. Below is an example using two headers for ten numbers randomly created and stored in the Test2.txt file under two headers.
chrome_dyo5a0CJR7.png
explorer_5t1KsqsfJJ.png
 

Was this information helpful?

Yes

No