Downloading data from eeprom using Visual Basic
Archiver
Posts: 46,084
Dear fellow stampers
I am planning on making a device using a BS2e and a sharp GP2DO2 infra red
digital distance sensor to measure water heights in a flume to calculate
flow rates down an irrigation furrow. I'm fairly new to using Basic stamps
and microcontrollers and would like to know how I go about linking a BS2e
chip to a visual basic 6 program in order to download the stored data in
eeprom. What I plan to do is have a stamp logging data in the field (Water
heights at specified time intervals) and storing it to the stamps eeprom.
Then I plan to come along at a latter date and connect a laptop with a
serial cable and open up my VB program and click a button in the VB program
to download the data stored in the eeprom of the stamp to a .txt file or
something similar once I have the data safely on the laptop I then want to
erase the values from the eeprom but not the program so it can go on logging
further data after I have disconnected the computer. What I would like to
know is how do I go about doing this and is it possible with the BS2e and
Visual Basic 6 ? Does anyone know of any books, articles, websites etc which
explain how to do this? Or is the stamp not capable of such a task?
Thanks for your help, I would greatly appreciate any
suggestions/tips/references etc.
Cheers John
________________________________________________________________________________\
_____
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
I am planning on making a device using a BS2e and a sharp GP2DO2 infra red
digital distance sensor to measure water heights in a flume to calculate
flow rates down an irrigation furrow. I'm fairly new to using Basic stamps
and microcontrollers and would like to know how I go about linking a BS2e
chip to a visual basic 6 program in order to download the stored data in
eeprom. What I plan to do is have a stamp logging data in the field (Water
heights at specified time intervals) and storing it to the stamps eeprom.
Then I plan to come along at a latter date and connect a laptop with a
serial cable and open up my VB program and click a button in the VB program
to download the data stored in the eeprom of the stamp to a .txt file or
something similar once I have the data safely on the laptop I then want to
erase the values from the eeprom but not the program so it can go on logging
further data after I have disconnected the computer. What I would like to
know is how do I go about doing this and is it possible with the BS2e and
Visual Basic 6 ? Does anyone know of any books, articles, websites etc which
explain how to do this? Or is the stamp not capable of such a task?
Thanks for your help, I would greatly appreciate any
suggestions/tips/references etc.
Cheers John
________________________________________________________________________________\
_____
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Comments
>Dear fellow stampers
>
>I am planning on making a device using a BS2e and a sharp GP2DO2 infra red
>digital distance sensor to measure water heights in a flume to calculate
>flow rates down an irrigation furrow. I'm fairly new to using Basic stamps
>and microcontrollers and would like to know how I go about linking a BS2e
>chip to a visual basic 6 program in order to download the stored data in
>eeprom.
Unless there is some compelling need to download it directly into your
progrma, why not just use any standard terminal communications program with
approprite protocol and baudrates to serially transmit ASCII, BCD, binary,
or whatever sort of data you wish to. I believe there are even methods to
input directly or indirectly into an Excel spreadsheet.
>What I plan to do is have a stamp logging data in the field (Water
>heights at specified time intervals) and storing it to the stamps eeprom.
Just in passing, another method might be to use a EEPROM or FLASH chip
external to the Stamp. Then you wouldn't be using up Stamp memory for data
which probably should be offloaded for safety's sake anyway. There are many
NVRAM and Flash soultions available today, some of which will store HUGE
amounts of data. The may provide a greater reserve of memory than just
using the Stamp. Serial memory is available, and they could be downloaded
directly into a laptop with or without using the Stamp to access it.
Lastly, you might chose to avoid bring thew laptopo into the field. If
that's the case, just swap out "full" memeory chips with "fresh" one,
rotating them appropriately to ensure maximum endurance.
>Then I plan to come along at a latter date and connect a laptop with a
>serial cable and open up my VB program and click a button in the VB program
>to download the data stored in the eeprom of the stamp to a .txt file or
>something similar once I have the data safely on the laptop I then want to
>erase the values from the eeprom but not the program so it can go on logging
>further data after I have disconnected the computer. What I would like to
>know is how do I go about doing this and is it possible with the BS2e and
>Visual Basic 6 ? Does anyone know of any books, articles, websites etc which
>explain how to do this? Or is the stamp not capable of such a task?
It is quite capaple of such an application. One commerical use can be found
here: [noparse][[/noparse] http://www.emesystems.com ]. There are many excellent tips and
pointers on Tracy's site as well. While there, you may want to check out
the Stache unit. It permits field re-programming of the Stamp BS-2e units
without the use of a laptop !
>Thanks for your help, I would greatly appreciate any
>suggestions/tips/references etc.
>
>Cheers John
Regards,
Bruce Bates
>_______________________________________________________________________________\
______
>Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
I concur with Bruce about using hyperterminal to offload the data. Thanks
Bruce for the link to my site.
Another excellent possibility for data offload is Stamp Plot Pro from
Selmaware:
http://selmaware.com/
specifically designed for the BASIC Stamp. Both offload the data and
visualize it on graphs etc etc.
Also check out the data collection proto board from Scott Edwards. At
http://www.seetron.com/cft.htm
The .pdf user manual with programs is available there for download. A
super resource.
-- Tracy Allen
electronically monitored ecosystems
http://www.emesystems.com
>>I am planning on making a device using a BS2e and a sharp GP2DO2 infra
red
>>digital distance sensor to measure water heights in a flume to calculate
>>flow rates down an irrigation furrow. I'm fairly new to using Basic
stamps
>>and microcontrollers and would like to know how I go about linking a BS2e
>>chip to a visual basic 6 program in order to download the stored data in
>>eeprom. What I plan to do is have a stamp logging data in the field
(Water
>>heights at specified time intervals) and storing it to the stamps eeprom.
>>...snip
>>Then I plan to come along at a latter date and connect a laptop with a
>>serial cable and open up my VB program and click a button in the VB
program
>>to download the data stored in the eeprom of the stamp to a .txt file or
>>something similar once I have the data safely on the laptop I then want
to
>>erase the values from the eeprom but not the program so it can go on
logging
>>further data after I have disconnected the computer. What I would like to
>>know is how do I go about doing this and is it possible with the BS2e and
>>Visual Basic 6 ? Does anyone know of any books, articles, websites etc
which
>>explain how to do this? Or is the stamp not capable of such a task?
>It is quite capaple of such an application. One commerical use can be
found
>here: [noparse][[/noparse] http://www.emesystems.com ]. There are many excellent tips and
>pointers on Tracy's site as well. While there, you may want to check out
>the Stache unit. It permits field re-programming of the Stamp BS-2e units
>without the use of a laptop !
<irrigation_man@h...> wrote:
> Dear fellow stampers
>
> I am planning on making a device using a BS2e and a sharp GP2DO2
infra red
> digital distance sensor to measure water heights in a flume to
calculate
> flow rates down an irrigation furrow. I'm fairly new to using Basic
stamps
> and microcontrollers and would like to know how I go about linking
a BS2e
> chip to a visual basic 6 program in order to download the stored
data in
> eeprom. What I plan to do is have a stamp logging data in the field
(Water
> heights at specified time intervals) and storing it to the stamps
eeprom.
> Then I plan to come along at a latter date and connect a laptop
with a
> serial cable and open up my VB program and click a button in the VB
program
> to download the data stored in the eeprom of the stamp to a .txt
file or
> something similar once I have the data safely on the laptop I then
want to
> erase the values from the eeprom but not the program so it can go
on logging
> further data after I have disconnected the computer. What I would
like to
> know is how do I go about doing this and is it possible with the
BS2e and
> Visual Basic 6 ? Does anyone know of any books, articles, websites
etc which
> explain how to do this? Or is the stamp not capable of such a task?
>
> Thanks for your help, I would greatly appreciate any
> suggestions/tips/references etc.
>
> Cheers John
>
I have a device that measures data outside in a field as you
decribed. The first thing that I would say is to use external EEPROM,
I use two X25128 16 kByte EEPROMS, this uses four pins on the stamp,
two chip select pins, a CLK pin and a data I/O pin.
To write a program in VB6 to download the data is very simple. All
you need to do is add the MSCOMM controll on to your form. There are
some very good examples on the Microsoft development network
msdn.microsoft.com . If you want it to generate Excel sheets for you
again that is very easy. Add the Excel objects library to your forms
references, record a macro in excel, copy and paste the macro text
into VB and that is about it.
To download the data from the stamp, use the DEBUG or SEROUT (on pin
16).
Hope this helps.
Andy