Shop OBEX P1 Docs P2 Docs Learn Events
Memory Stick Datalogger 27937 Variable Space / Array on BS2 — Parallax Forums

Memory Stick Datalogger 27937 Variable Space / Array on BS2

JC68JC68 Posts: 19
edited 2007-08-17 16:29 in BASIC Stamp
i just got the datalogger (27937) and it's really cool. while going through the only code samples i can find (which run fine by the way):

DataloggerDemoV1.0.bs2
DataloggerTestV1.0.bs2

i noticed the following line:

buffer·· VAR·· Byte(15)

is it required to give up over half the BS2 variable space to use it?· i am hoping to find away around this rather large array.

i checked the datalogger spec sheet and a search doesn't show any ref. to a buffer.
http://www.parallax.com/dl/docs/prod/comm/VDAPFirmwareSpec.pdf

thanks!!


·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-15 21:54
    The datalogger can sometimes respond with a relatively long sequence of characters and may timeout (to the Stamp) during this response. The buffer allows the Stamp to accumulate enough characters to make a decision. It's possible to write a complex decision tree that only needs an one character buffer and decodes all possibilities on the fly. This takes quite a bit of code and is not the best example to explain and demonstrate how the device works.

    Basically, take a workbook and list all the possible responses from the datalogger for a given command or group of commands. Your routine has to read in the first character, repeating the SERIN if it times out, then checks the character. Based on the character, it jumps to one of several routines that reads the 2nd character, then jumps to a 3rd routine based on the 2nd character. If you know about state machines, that what this kind of thing is. Eventually, the "last" character of the response is reached and the subroutine reports what kind of message it was and that may be the only additional storage needed.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-08-15 21:58
    Another option which I use on my own code is to switch to the short command set. The responses will be smaller. As for anything else sent, well that depends on how it was stored. If you’re just storing numbers you can definitely reduce the buffer array. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • KatyBriKatyBri Posts: 171
    edited 2007-08-16 02:15
    Could someone explane what the "short command set" is (mentioned in Chris's reply)? Thanks
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-08-16 02:53
    Hi katybri, there·is a choice of·two command modes by which you can communicate with the logger.

    Extended command set and Shortened command set.

    The extended commands are short ascii strings and the shortened commands are hex formatted numbers.

    There·is·not a lot of·difference in size·when you send a command to the logger but the replies the logger sends back can be considerably shorter and easier to handle in shortened command mode .

    Both command sets are listed in the firmware instructions.

    Jeff T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-08-16 14:19
    Jeff got that one (thanks), but I did also mean to mention that if you have a BS2p series module you can simply buffer incoming strings into the Scratch Pad RAM. This will almost eliminate the need for a string buffer in variable space in most cases. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • JC68JC68 Posts: 19
    edited 2007-08-17 16:29
    i did reduce the array from (15) to (7) and it seems to work.· i have the datalogger connected to my BS2 with a DS1302, SHT1x, serial LCD, and a few LEDs.· i am out of variable space and nearly out of program space but it's working.

    FYI: to anybody considering the parallax datalogger, you should check it out.· it's a really COOL device.· from bs2 to excel charts, so easy...

    thanks!!

    ps
    i think i need to get a bs2e or bs2sx
Sign In or Register to comment.