-
Reading streaming data into Excel via VBA
I am trying to read data streamed from a sensor into Excel via VBA using modCOMM (by David M. Hitchner) and a simple spreadsheet posted here by S.Dinah.
The data streamed currently consists of a maximum of 7 ASCII string characters separated with a comma between each. The data is being output from an Arduino using a Serial.print command.
Currently, I can open the serial port and read the data into Excel. I've set-up a command button to read the data and display it in Excel and the data updates with each button click.
The problem is I don't know how to separate each data point so they are useful. Ideally, I would like to take a sample of readings (say 20) from the serial data, average them and use it as a data point in the spreadsheet. I'm guessing there must be a way to read and store the characters until a comma is read, add that value to a running total, and then get the next character set..etc. I'm also guessing there is a way to verify each data point is good (not corrupted in transmission).
Will someone here please point me in the right direction on this?
Any help is appreciated.
Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules