LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to include a string

Hi Joe Thanks!

Now i have timestamp in my file name. I want filestamp column in my data file ,i mean the time at which the data is acquired.

for instance 12:10:45      D!    D2        D3-...so on

now my presnet problem is..i have all this .as formatted my data in a string and that resulting string iam passing it to write to file VI ( is it same as Write to text VI)

thanks for ur time!°




0 Kudos
Message 11 of 16
(875 Views)

Hi twilight,

Your timestamp within the file is a string, right?

I have to assume that you are using a text file and not a spreadsheet.

In the case of a text file, you can use Concatenate Strings to place the data one after the other following the timestamp. You can include a delimiter, suchs as a space (in this case), so that you can read the file.  You could actually use a tab, which would make the file wider in some text editor, but easier to read.

The trick is to NOT include an end of line character "\r" "\n" (or combo) until you have concatenated all the data for that line, then place a single end of line constant at the end of each sample... Hopefully, I'm not confusing you...  😉

Example: 

10:20:34  data1 data2 data3 ... data_n "end-of-line"

10:26:34  data1 data2 data3 ... data_n "end-of-line"

JLV

0 Kudos
Message 12 of 16
(869 Views)
oooooooooh...i really cudnt get it into my brain..(woof iam bull head)

The trick is to NOT include an end of line character "\r" "\n" (or combo) until you have concatenated all the data for that line, then place a single end of line constant at the end of each sample... Hopefully, I'm not confusing you... 

that mean you wnat be add end of line character as last one in the conating of strings!
0 Kudos
Message 13 of 16
(865 Views)
I modified your vi, please consider carefully the changes... it may not be exactly what you want to do, but it's an improvement.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 14 of 16
(864 Views)
Thank you..
I think now its okay with no errors and does 99% of what i needSmiley Happy
Thanks!
0 Kudos
Message 15 of 16
(858 Views)
I have a question,

In my VI , i wanted mean of values for every second.

i mean , when my DAQ board gives some 1000 samples per second. i need mean of these 1000 samples,but not all 1000 sanmples.
for this i included a elapsed time vi with taget of 1s. (didnt forget to reset after 1s).

but what i see is it gives values at every milli second. to be more clear

12:12:01     d1 d2 d3
12:12:01     d1 d2 d3

but i need like
12:12:01   d1 d2 d3
12:12:02   d1:d2:d3
 did i go any where wrong in my Vi.




0 Kudos
Message 16 of 16
(846 Views)