04-12-2008 03:39 AM
04-12-2008 08:54 AM
I think the problem is with the way you are using the function. On the first iteration, you have a sinlge sample for each 'channel'. This information is written to the header and then the data is written. You have configured the express VI to write only a single header (Segment Headers>One header only). So, the second iteration, just the data is written. The information in the file is correct. You do only have a single sample. What you see in the file are really considered multiple segments.
I'm not sure there is an easy fix if you use the Express VIs aside from using the one header per segment option. I never use the epxress VIs. There is considerable overhead with the Write to Measurement File so you might be better off just using the low level file write functions and not using the Read From Measurement File either.
04-12-2008 09:49 AM
04-12-2008 10:18 AM - edited 04-12-2008 10:19 AM
I don't think it is a bug in the Write to Measurement file. The data looks correct. The Generate Arbitrary Signal probably doesn't have a bug either. What I think the problem is that the Express VIs are designed to be quick and easy to use in a limited number of applications. The typical use of the Write to Measurement File is to save data from a data acquisition with mulitple samples. The Generate Arbitrary Signal import function was designed with this in mind. It probably never occured to the author of the Express VI that someone would be trying to import a file with multiple segments. Or, if it did occur to the author, that the number of users doing this would be small and didn't want to add a lot of complexity to the program.
Besides the other suggestions I made about using the low level file functions, you can place the Write to Measurement File outside your loop and do a single write. Wire the data through the while loop and on the exit tunnel, select Enable Indexing. This will create an array of values. Now, when you use the Write to Measurement File, your number of samples will be correct and you will have a single segment that can be read by the Generate Arbitrary Signal function.
04-12-2008 01:20 PM