LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combining String and Data to File

Hello,

I have a routine that reads a date and a time from one piece of equipment, then reads data values from another piece of equipment and builds an array of those values. This happens each time in a loop (every minute). These values are sent to the front panel OK and displayed.


The date and time values read are strings written as DD/MM/YY and HH:MM:SS. The data is double precision decimal data.

The main problem comes when I try to write these values to file. I can't seem to combine string and data in one function.

I can write the date and time to file OK (with write to file) and also the array of numbers (using array to spreadsheet). However I have to use seperate functions for each.

The problem is that in the file
the data is written as (for example)
DD/MM/YY
HH:MM:SS
0.514 21.970 73.882 98.744

that is there is a new line for the date, time and then the data. These values are written each time the loop executes.

Is there a simple way of combining/formatting the string and data so that they all appear on one line separated by a space or comma. Alternatively, can you combine string and data using one function and then write to file?

GP
0 Kudos
Message 1 of 2
(2,470 Views)
Once written to the file, everything is a "string", even your data is just a string of decimal number characters, etc.

Just format an entire line using "format date/time string", "array to spreadsheet string", etc. and concatenate them all with appropriate spacers (tab, space, comma, etc) and a "newline" at the end.

Append this final single string to your data file at each iteration.
0 Kudos
Message 2 of 2
(2,470 Views)