Getting data into Excel

Questions about the BASICtools and MakeItC
Post Reply
basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Getting data into Excel

Post by basicchip »

The BASIC ARM boards are an effective way to get data into Excel. This was highlighted in webpages posted almost 7 years ago, but those links have gotten stale, so those pages and examples will be added here.

The BASIC ARMs collect data, and then relay it to the PC over the USB serial port. That data can be read on the PC many ways, as simple as cutting and pasting from BASICtools window into Excel, or running a background program on the PC to collect data into a CSV file, or running a VB macro within Excel to gather data directly.



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Getting data into Excel

Post by basicchip »

From the original webpage

The ARMmite or ARMexpress can generate data for use in Excel. The USB port can be used to send data back to a PC. There are a number of ways to capture that data, including MSCOMM or Tcl. This is an example that uses a Tcl utility to control the ARMmite, capture data and then write that data into an Excel .CSV file.

Tcl is a cross-platform language that makes it easy to develop a GUI for various utilities. This example is taken from TclTerm, and shows how to open a serial port, capture incoming data, display that data to a text window, and finally write that data to Excel. Find the attached source and a Windows executable version.
CSVgrab.tcl
(11.14 KiB) Downloaded 449 times
Zip file of executable at http://www.coridium.us/files/CSVgrab.zip

For a minimalist Tcl program to do the same, here is the source for that
CSVgrabMini.tcl
(1.57 KiB) Downloaded 479 times
csv1.GIF
csv1.GIF (11.26 KiB) Viewed 5886 times
BASIC program to produce Excel comma seperated data

The simplest method to do this, is to use the BASIC PRINT statement, to send data to the PC and then seperate each value with a comma. This may also be done using printf in C.

Here is a simple example of a BASIC program to generate this data.
makeCSV.bas
(111 Bytes) Downloaded 465 times

Post Reply