Example Code

Adding Date and Time Stamp to Data

Code and Documents

Attachment

This VI performs the operation of adding a date and time string to a 2-D array. The basic syntax involves extracting the first row of data and converting it to a spreadsheet string. This is followed by extracting the data string without the \n and \r characters from the spreadsheet string. The date and time strings are then concatenated to this data string, which is actually the first row of the output string. The rest of the data array is then extracted, converted to a spreadsheet string and concatenated to the first row of the output string to form the output string, which is then written to a file.

This example complements the data-logging examples that ship with LabVIEW and is useful for other situations where you want to apply a timestamp to your data.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors