LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic Function Generator

I produce a sinus-signal with the basic function generator
and i would like to write the x- and the y-values in a simple file
for comparison with values in other files.
First i used the "write measurement file" and i could write it
properly in a *.lvm-file, but i would like to have it in a *.txt
respectively in a *.log-file.
But when i try it with arrays_functions or waveforms_functions
i always get only the y-values, sometimes  x(0) as a time-stamp
but not the proper x-y-values.
Thanks for your help!!!!
Janina
0 Kudos
Message 1 of 10
(3,177 Views)
An lvm file is a text file. It can be opened by Notepad, Excel, etc. The extension can be anything you want. If you don't like .lvm, change it. If you want to use the Write to Spreadsheet file, you have to create the X values from the t0 and dt of the waveform data and then append that array to the Y array for a 2D array.
0 Kudos
Message 2 of 10
(3,174 Views)
Thanks a lot!
Because i don't know what the "Write to measurement.vi" really does in
the background, i will try to rebuilt the x-values with the t(0) and dt-values!
It is surprising that i have to rebuilt the x-values and that i can't force the .vi
to give me y(x)-x-pairs- this is the way normaly functions are calculated...
Beside this thanks you once more!

0 Kudos
Message 3 of 10
(3,168 Views)
I don't understand. You said it works if you use the Write to Measurement File. This does give you x-y pairs. The x value is in the first column and y is in the second column. This is pretty standard. Export Waveforms to Spreadsheet File gives you x-y pairs as well. It gives you absolute time stamps instead of the relative time. this is also a pretty standard method. I only mentioned Write to Spreadsheet if you wanted to use a lower level function.
0 Kudos
Message 4 of 10
(3,161 Views)
Thank you once more! I didn't answer you yet, because i had a lot of other things to do. Sorry!
Yes, it works with the write_to_measurement_file, but i want a more lower level function, so i
really know what the .vi does. The problem with the write_to_spreadsheet was that i get only the
absolute time stamp, but i need the relative time stamp. For this i think i have to rebuilt the x-values
with t(0) and dt.
0 Kudos
Message 5 of 10
(3,111 Views)

Okay. I can understand not wanting to use the Write to Measurement File. I prefer the low level functions myself. Smiley Wink

There is a function on the waveform palette to get an array of time values as timestamps but if all you want is a simple numeric array, that's easily done with a for loop and shift register. If you need some help with that, just ask.

0 Kudos
Message 6 of 10
(3,100 Views)
Yes, maybe, I need some help...
I tried it with the write_spreadsheet function and it works, but
i can't tell him that t(0) isn't the 01.01.1994, 01:00:00.
It doesn't matter if it is the 01.01.1994, but i need to start at 00:00:00,
and to get one spreadsheet for one day.


0 Kudos
Message 7 of 10
(3,091 Views)

Here's something that should work. Since you want time as HH:MM:SS, everything has to be a string.

To save to a single file every day, you will have to add some code that looks at the current date/time. For example, you could convert the date/time to a string and make it part of the file name.

0 Kudos
Message 8 of 10
(3,084 Views)
thanks a lot! I'll try it tomorrow! Today I'm % /....
0 Kudos
Message 9 of 10
(3,079 Views)
Thanks a lot once more!
Your little program works and by studying
it, i learn a lot.
0 Kudos
Message 10 of 10
(3,049 Views)