04-15-2006 08:25 AM
04-15-2006 06:02 PM - edited 04-15-2006 06:02 PM
You can save waveforms to a file with the Export Waveforms to Spreadsheet File without doing any conversion. This will create a text file. You can create a binary file with Write Waveforms to File. Both functions work with a single waveform or a waveform array. If you want to extract just the Y array, you can do that and then use Write to Spreadsheet File. If you have a waveform array, you can put the Get Waveform Component inside a for loop and create a 2D array that Write to Spreadsheet can also use.
Message Edited by Dennis Knutson on 04-15-2006 05:02 PM
04-16-2006 10:30 PM
04-17-2006 08:35 AM - edited 04-17-2006 08:35 AM
If you want to create an array of timestamps, one way to do it is like in the picture attached. Using Export Waveforms To Spreadsheet File will do this for you too, if I remember correctly. I don't use the function that much.
You data is not appended randomly but whether it is correct or not, I can't say without having the actual VI to run and knowing exactly what you are trying to do.
The function Write Characters to File is probably slowing things down. If you were to look inside the function, you would thatt every time it is called, the file is opened, written to, then closed. The file opening and closing takes some time as does the actual file writing. You can put the file open and close outside the loop so that each is only done once. The time it takes to do the file writing is determined by the amount of data and the type of data. You are converting to text and that requires more bytes to store each data point. You could, save the data as binary. This will result in a smaller file and a faster write. You other option is to defer the file write until after the while loop terminates. You could wire the signal data type to the edge of the while loop and enable auto-indexing. Then, the array of signals or waveform datatypes could be written all at once.
Message Edited by Dennis Knutson on 04-17-2006 07:40 AM
Message Edited by Dennis Knutson on 04-17-2006 07:40 AM