LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My multifunction VI is duplicating data in the measurment file

Hi,

 

I am having problems with my VI. This VI is designed to aquire data from two different device types. Unfortunatley I need to aquire different amounts of data over differing periods of time from the two different device types. For this reason I have a high sample rate which I then reduce for one of the devices. When the sample rate is reduced it appears to duplicate the data in the measurment file.

I think that their may be an error with the loops that i may not have accounted for but I am not sure.

 

Thank you very much for any help and advice that you can give on this matter.

 

Tim

0 Kudos
Message 1 of 7
(2,982 Views)
In your example, you have a low sample rate of 100 S/sec and then are trying to reduce it by a factor of 400. That does not make any sense.
Message 2 of 7
(2,968 Views)

I am recording data continuously for a week up to a month. This means that monitoring 100 samples within 1s has little relevance and trends over the course of a day + is more important. For ease of data manipulation I have reduced the sampeling rate. The other application only requires a maximum of 100Hz their for I used this so to reduce the number of samples taken.

 

I have come to this solution as I am using a PCI-6254 which I believe doesn't allow you to set two independent sampeling rates that run at the same time.

 

Thank you for any help that you can give with my current problem

0 Kudos
Message 3 of 7
(2,949 Views)

I guess I should have looked at what the Collector Express VI does. Since I have never used an Express VI for any real work, I did not know that it would accumulate previous data.

 

I'm still not sure what the problem is. Since you are accumulating over 1 million samples and with each iteration, only adding 100 new samples, and then reducing by the mean, I would expect very little difference between successive records. How much does the amplitude of the measured signal vary, how often, and how long. Relatively small changes of short duration would seem to be filtered out but if you are looking for trends over a long term, isn't that what you want?

0 Kudos
Message 4 of 7
(2,933 Views)

That part of my VI is functioning as i want at the moment. The problem arises when wrighting to a file. When this happens it appears to either duplicate data or fill the buffer up befor it has written all the data (giving error 200279 which can also be caused via the collector but i have since reduced the collectors size as to prevent this) to the file. I am not sure if their is another solution to the same problem using timed loops to collect the data only every few seconds or so, but my knowledge of programming is fairly limited (as you may have guessed from the use of express VIs).

 

If you could forsee any possible problems with the wright to measurement file with my VI I would be greatful if you could suggest another solution or means of collecting a reduced data set.

 

Thank you for your time taken to review my problem

0 Kudos
Message 5 of 7
(2,928 Views)

When I've been in similar situations, what I've done is use the decimate array function to reduce the sample size or did a mean function on the data to reduce it to a single sample.

 

The Write to Measurement File is probably not the best function for long term logging and especially not with large data arrays and when files get very large. With each iteration, the function first opens the file, finds the end, writes the data, then closes the file. It would be much faster to use the low level functions where you open/close the file only once and outside the loop. Even faster would be to use one of the binary file formats. You might want to look at the shipping examples that use the tdms functions.

0 Kudos
Message 6 of 7
(2,920 Views)
Thank you very much. I will have a go at that. I will see what else I can find in the examples.
0 Kudos
Message 7 of 7
(2,915 Views)