Shop OBEX P1 Docs P2 Docs Learn Events
Data logging through serial port — Parallax Forums

Data logging through serial port

eecs501eecs501 Posts: 3
edited 2007-12-05 17:38 in BASIC Stamp
How can one output data from the BS2 into a PC file through the serial port? Thanks

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-12-02 14:11
    eecs501 -

    One method is to use Hyperterminal, which can capture incoming data coming across the serial port. There are some issues using Hyperterminal, but I think they are resolved by turning flow control OFF. Perhaps others can shed a bit more light on this compatibility issue.

    You can certainly use any other communications utility you wish, providing it is able to capture the data coming in from the serial port.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • KatyBriKatyBri Posts: 171
    edited 2007-12-03 02:25
    From previous threads-

    The best way is to use Hyperterminal as your debug screen, then capture Hyper to an Excel or Word file.

    Also, have a look at StampPlot Pro and StampDAQ (here www.parallax.com/html_pages/products/accessories/tm.asp).

    Is breadboarding a Stamp MODULE as easy as providing it with a regulated 5vdc power source and putting together the RS232 connector using physical Stamp pins 1, 2, 3, and 4?

    There's a schematic on page 28 (pdf page 32) of the BASIC Stamp Manual that might be useful to you:

    http://www.parallax.com/dl/docs/prod/stamps/web-BSM-v2.2.pdf

    Oh, and you need to add one more wire to your DB-9 -- loop pin 6 to pin 7, that's what the IDE uses to detect "cable connected" (aka "Loopback test").

    Does regulated, +5vdc go to VDD and ground to VSS?

    yes you are correct, 5VDC on VDD and ground VSS.
  • eecs501eecs501 Posts: 3
    edited 2007-12-04 02:49
    Ok, I was able to log data using the serial port in Matlab.

    SerialPort = serial('COM1');

    fopen(SerialPort)
    fscanf(SerialPort)
    fclose(SerialPort)

    Normally if you want a number output with DEBUG, you put '?' or 'DEC' in front of the variable of interest.
    DEBUG DEC x, LF

    When I try
    DEBUG x, LF
    I get a bunch of characters and symbols. Is there a way to convert these characters and symbols into numbers (not using the bs2 DEBUG, so I can perform faster samples)?

    Thanks
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-12-04 15:11
    SEROUT 16, 16864, [noparse][[/noparse]DEC X, CR] ' This should ouptut to the 'programming' port like Debug
    ' But, using SEROUT lets you use different baud rates (16864 is 9600 baud for the BS2) and send EXACTLY what you want to send.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-12-05 17:38
    eecs501,
    Once you have mastered the serout on the stamp ... I wrote a few applications (some in VB6 and others in .NET) to log this data to a text or html file on a P.C ....also·if the html file was on a P.C running a webservice - (like abyss - free webserver) you could be updating real time to a log available on the internet ..

    http://forums.parallax.com/showthread.php?p=640960

    the latest version of the .NET application is available for download on that thread or here ...
    www.igniteautomation.com/IA_Logger.html

    Regards,
    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
Sign In or Register to comment.