10-26-2012 08:29 PM
I am sampling data coming in via the serial port. The data is updated every second Displaying the one second data is fine, however I only want to store a record every fifth minute, how do I accomplish this without storing all the one second data?
10-26-2012 11:42 PM
Use the Elaspsed Time Express VI to determine when 5 minutes have passed. Put the code where you are storing the data inside a case structure that is wired to the Time Elapsed? output of the Express VI.
10-27-2012 10:53 AM
Thank you for your response. How would this solution address data in the serial port buffer: that is, how do I know I am recording data received at the five minute interval verses recording data that happens to be queued in the buffer and was received earlier than the five minute interval?
10-27-2012 11:01 AM
MacKensie,
You would read the buffer much more often than every five minutes. Read the port every second when the data is received. Put the data in a shift register or other buffer. Keep only as much data as you will want to display or save and discard the older data. This is called a circular buffer.
If you only want to save the most recent data received, just keep only one point in the shift register. When the 5 minute time has elapsed, save the point in the shift register, which should be the most recent point.
Lynn
10-27-2012 11:20 AM
I said put the code where you store the value inside the case structure. I did not say put the serial port read inside the case structure. As Lynn said, you are constantly reading, only storing the value when the 5 minutes have elapsed.
10-27-2012 01:16 PM
Thank you to both of you. I appreciate the support.