|How to pace data acquisition in Excel more accurately|
In the step 7) of our Excel eLesson, we use the IeTimer to pace the speed of acquisition. If you play with it for a while, you will notice that the timing is not guaranteed. For example, if you start Microsoft Word while acquiring data from the DI-194 to Excel, you may lose a few readings! The reason is that the IeTimer uses the SetTimer function of Windows, and this is how good it will get. :-(
Here, we will show you how to pace the acquisition rate more accurately. Instead of using IeTimer exclusively to pace the acquisition, we only use it to empty the buffer and rely on the hardware clock on DI-194 as the sample rate for a more accurate timing. If you use Excel 2000, you can refer to our Excel samples and use the NewData Event directly without the help from IeTimer.
Again, we will try to acquire data every second. Please refer to the Excel eLesson for the previous steps. The only difference is in Step 7). Also, we demonstrate a new method called GetDataPt to empty the data buffer.
7) In the Visual Basic code editor, change the default codes (If you decide to type in the codes, you will notice the properties and methods will be displayed in a drop-down menu once you typed in ultimaserial1.)
To (Watch for the blue text, we assume button Command1 and 2 for Start and Stop action)
Here you can learn how to send data to Excel directly from a VB program.
Last update: 02/29/12
Copyright: 2000-2005 www.UltimaSerial.com