Hi,
Has anyone written a simple Visual Basic program that will enable serial
data to be read directly into Excel that they are willing to share? I want
to try with a simple PIC data logger and read the serial data directly into
Excel. or any suggests website or book, which can help me to finish this
project!!
Thanks !!
>Has anyone written a simple Visual Basic program that will enable serial
>data to be read directly into Excel that they are willing to share? I want
>to try with a simple PIC data logger and read the serial data directly into
>Excel. or any suggests website or book, which can help me to finish this
>project!!
Does it really need to go straight into Excel? My thinking is that you may
find it easier to write the info into a comma delimited format text file,
with the .CSV extension, and then import that into Excel. However this then
makes viewing the data in Excel a batch job, which may not be what you want.
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
I don't have anything that does exactly that but I do have a rough VB
program for receiving rs232 from a pic. I use it for testing. I'm sure
you could adapt it. As for getting it into Excel you can use DDE. This
is a very old standard but is still supported. In my opinion it is much
simpler and reliable than OLE automation. I do it with Word a lot. If
you look hard you can find some good info on the web. Look for terms like
DDEPoke & DDEExecute. The other thing you can do which is probably even
easier is to get VB to output text in html format and the name the file with
a .xls extension. Excel will open it like an ordinary .xls file. I have
some code for that too.
IIRC, you could use VBA with regular VB controls. Add the MSCOMM control
to your VBA project and you have very complete serial comms at your
fingertips.
I suppose you are collecting statistical values of some sort, in which
case I would use a standalone VB application. The app would handle
serial comms and insert values as appropriate into an Access DB. The DB
can be read an written to while in use by the VB app. Furthermore,
Access has many export capabilities and VBA.
Excel isn't really suited nor intended for database type data,
especially if we are talking of large amounts.
On Wed, 07 Jan 2004 03:30:36 -0600, jay chen wrote:
> Has anyone written a simple Visual Basic program that will enable
> serial data to be read directly into Excel that they are willing to
> share? I want to try with a simple PIC data logger and read the
> serial data directly into Excel. or any suggests website or book,
> which can help me to finish this project!! Thanks !!
I haven't done specifically what you ask but here is a link to some
information about using Excel and VB together...
Not to Excel, but I've tied it to Access. Someone mentioned using regular
VB controls for VBA, that's what I did. I had to install VB to get the
development license for MsComm. Then I just added it to a form, set up a
timer to poll the buffer every 100mS and append the data to a string
variable. Whenever my variable exceeds a record length, I run it through a
second function that parses it and appends it to a table.
If I was doing it over again I'd probably use a similar method, but instead
of the timer I'd try to set it up in the OnComm event handler.
I can share if you want (it's not pretty, but it works) but it won't work
for you unless you have a copy of VB for the MsComm license.
I remember reading somewhere someone had wrapped MsComm and released it
freeware, so you could probably find an alternative.
-Denny
> Hi,
> Has anyone written a simple Visual Basic program that will enable serial
> data to be read directly into Excel that they are willing to share? I
want
> to try with a simple PIC data logger and read the serial data directly
into {Quote hidden}
> Excel. or any suggests website or book, which can help me to finish this
> project!!
> Thanks !!
>
> chen
>
> _________________________________________________________________
> Check your PC for viruses with the FREE McAfee online computer scan.
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
> --
> http://www.piclist.com hint: PICList Posts must start with ONE topic:
> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
I'd bet with very little medication you could use Stamp DAQ....It takes debug statements from the stamp and pops them into Excel. Just have your PIC program put out the same syntax and your set...
> Has anyone written a simple Visual Basic program that will enable
> serial data to be read directly into Excel that they are willing to
> share? I want to try with a simple PIC data logger and read the
> serial data directly into Excel. or any suggests website or book,
> which can help me to finish this project!! Thanks !!
I haven't done specifically what you ask but here is a link to some
information about using Excel and VB together...
>>> .....firmwareKILLspam@spam@TDS.NET 01/07/04 11:15AM >>>
Not to Excel, but I've tied it to Access. Someone mentioned using regular
VB controls for VBA, that's what I did. I had to install VB to get the
development license for MsComm. Then I just added it to a form, set up a
timer to poll the buffer every 100mS and append the data to a string
variable. Whenever my variable exceeds a record length, I run it through a
second function that parses it and appends it to a table.
If I was doing it over again I'd probably use a similar method, but instead
of the timer I'd try to set it up in the OnComm event handler.
I can share if you want (it's not pretty, but it works) but it won't work
for you unless you have a copy of VB for the MsComm license.
I remember reading somewhere someone had wrapped MsComm and released it
freeware, so you could probably find an alternative.
-Denny
> Hi,
> Has anyone written a simple Visual Basic program that will enable serial
> data to be read directly into Excel that they are willing to share? I
want
> to try with a simple PIC data logger and read the serial data directly
into {Quote hidden}
> Excel. or any suggests website or book, which can help me to finish this
> project!!
> Thanks !!
>
> chen
>
> _________________________________________________________________
> Check your PC for viruses with the FREE McAfee online computer scan.
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
> --
> http://www.piclist.com hint: PICList Posts must start with ONE topic:
> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
> Hi,
>> Has anyone written a simple Visual Basic program that will enable serial
>> data to be read directly into Excel
> I remember reading somewhere someone had wrapped MsComm and released it
> freeware, so you could probably find an alternative.
Exactly what I have done to display data from a PIC on Excel.
Here is the free wrapped MSComm:
ourworld.compuserve.com/homepages/richard_grier/NETCommOCX.htm
and also how to use it.
I've used in on a project that has been put on hold for a while, so I'm
a bit rusted on what I did. Sorry, I can't release the code.
Also read on VB technical section of Microsoft how to use MSComm
(NetComm works exactly the same as MSComm, with the same commands, etc.).
Also read a bit on how to select and use ActiveX, to know how to install
NetComm into Excel and use it (I found it very easy to do).
Ask if you got questions, maybe your questions will make me remember
more. :)
Quentin
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
On Wed, 07 Jan 2004 12:15:59 -0500, Denny Esterline wrote:
> I can share if you want (it's not pretty, but it works) but it
> won't work for you unless you have a copy of VB for the MsComm
> license.
>
> I remember reading somewhere someone had wrapped MsComm and
> released it freeware, so you could probably find an alternative.
If you do many VB or VBA development projects that involve the serial
port, printer port, or need to use TCP to talk with network devices
you might also try JS Payne's IO Control. It works with Windows OS
versions from Win95 through XP.
There is a free demo version that's 100% functional and the cost is
reasonable for a license considering all you get. Much more flexible
than MSCOMM. (I'm just a happy customer.)
Tim
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads