09-09-2012 06:00 AM
Hello, I'm using a NI 6034 to acquire through _ LabView a signal in volts from a pressure transducer, these data then save them to a file. Lvm using the "write to a file" (at least I think you call it or something like that). I would have 2 questions:
1) you can always using the virtual instruments to implement a block I calculate directly the average of these 10 thousand values without having to go to the star on excel every time?
2) is it possible to somehow remove the header that LabView a creates by default in the file. LVM when you save?
I hope someone will give me an answer because I'm really losing a lot of precious time to pass each time data from lvm file to the excel.
Thank you in advance for your advice.
Solved! Go to Solution.
09-09-2012 10:25 AM
Marco86,
1. You should be able to read the data directly from the .lvm file in LV. Use the Express VI Read from Measurement File. You can wire the Signals output to the X input of the Mean.vi from the Mathematics >> Probability & Statistics palette. LV will automatically insert a conversion from the Dynamic Data Type output of the Read to the 1D Array of Doubles that Mean needs.
2. I rarely use the Write to Measurement FIle Express VI so I am not sure whether you can completely suppress the header. If you use the Write to Spreadsheet File.vi you get a tab delimited text file containing only your data converted to text and delimiters. You can create you own headers by writing a string array to the file before writing the numeric data. Of course you can have complete control over everything in the file by using the low level file functions and data manipulation and string conversion functions.
Lynn
09-09-2012 11:13 AM
Thank you very much, I solved for the header while I have a problem with the "Dynamic Data conversion from the" T, because this truncates the values that I have saved, for example 86.669922 is stored in the array as 1D 86.6699, you can save it with all the digits after the decimal point?
Attached the VI that I created to calculate the average, using LabView 2010.
09-09-2012 12:33 PM
Marco86,
The double array will have all the resolution that was saved in the file. The indicator may not show all the digits. You can change that by going to the Properties dialog for the indicator and increase the number of digits. Internally a Double uses 64 bits and is the equivalent of about 15 significant decimal digits, regardless of what is displayed.
You do not need the loop in your VI. Why calcualte the same values again and again?
Lynn
09-09-2012 12:54 PM
Thank you thank you so much! I changed the resolution and now it all comes back ... and the cycle is actually of no use now I've taken off, thanks again!