Shop OBEX P1 Docs P2 Docs Learn Events
BS2pe and Parallax USB DataLogger question — Parallax Forums

BS2pe and Parallax USB DataLogger question

Michael @ AfineolMichael @ Afineol Posts: 33
edited 2007-12-03 15:39 in BASIC Stamp
When I run the attached code with "Sets = 1" everything executes without error, but when I set "Sets = 2" the BS2pe stops logging data on the 26th Serout·of the second set. It appears to stop·in the "Set_USB_1" subroutine to the DataLogger with the USB Flash Drive and DataLogger consitently blinking every .5 secs or so.

···· SEROUT TX\CTS, Baud, [noparse][[/noparse]$08, $20, $00, $00, $00, $0B, CR,
············ DEC1 Target, ",", DEC1 Hit, ",", DEC5 Speed, CR, LF, CR]

I have attached a file "datafile.txt" of what the output should look like and a comment where it stops.

I need help. Thanx in advance.

Mike S.

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-12-03 02:33
    Hi Mike, I'm not sure whats going on here but looking at your datafile your program seems to be working fine. It·might be·possible that the logger buffer fills at Set=2 26th byte and that the 27th byte is written before the buffer is cleared. A line that·could prove or disprove that thought is to modify the Set_USB_1: sub routine. Replace PAUSE Serial_Write with SERIN RX\RTS, Baud,[noparse][[/noparse]WAIT (">")].

    Jeff T.

    EDIT: another possible cause for data not being written or the logger hanging is if the memstick is not formatted correctly.

    Post Edited (Unsoundcode) : 12/3/2007 2:39:29 AM GMT
  • Michael @ AfineolMichael @ Afineol Posts: 33
    edited 2007-12-03 04:15
    Jeff,

    Thank you. I tried SERIN RX\RTS, Baud,[noparse][[/noparse]WAIT (">")], but it did not help. To·see if·my code was the issue,··I modified the DataloggerDemov1.0.bs2 code (I attached the modified program).

    '
    [noparse][[/noparse] Constants ]
    NumSamples····· CON···· 200············· ' Number Of Samples To Log

    · FOR counter = 1 TO NumSamples········ ' Number Of Samples To Log
    ·'·· HIGH Sensor························ ' Charge Capacitor
    ·'·· PAUSE 1···························· ' Wait 1 ms
    ·'·· RCTIME Sensor, 1, result··········· ' Measure Discharge Time
    ··· DEBUG "Sample ", DEC5 counter, " of ", DEC5 NumSamples,
    ········· " --> ", DEC5 result, CR····· ' Display Results
    ··· SEROUT TX\CTS, Baud, [noparse][[/noparse]$08, $20, $00, $00, $00, $0D, CR,
    ········· DEC5 counter, ",", DEC5 result, CR, LF, CR]
    ··· PAUSE 500·························· ' Write Results/Delay
    ··· GOSUB Get_Data····················· ' Purge Receive Buffer
    · NEXT

    This will loop 91 times and then give the same blinking on/off until I turn off the BS2pe.
  • Michael @ AfineolMichael @ Afineol Posts: 33
    edited 2007-12-03 05:49
    Jeff,

    I tried two other Flash Drives on·both my program and the DataLogger Demo program and they worked without error. I formated the Flash Drive that was not working and it still·stopped after 91 loops. I ran a Chkdsk /f on the·drive with the same result. The "failed" drive is a Kingston·DataTraveler 2 GB DTI/2GB.

    Thanks for the advice: EDIT: another possible cause for data not being written or the logger hanging is if the memstick is not formatted correctly.

    Is there a list of compatible Flash Drives with the Parallax DataLogger?

    <!-- Edit -->
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-12-03 15:39
    Hi Mike, not sure what operating system you have or how you have formatted the Kingston drive.

    This is how I would format the drive for use with a logger in Win XP OS.

    Control Panel-->AdministrativeTools-->Computer Management-->Disk Management-->Right Click the Memstick Drive letter-->Format-->Select Fat 32 with an Allocation unit size of 512-->OK

    This has worked for me in the past, I would be interested to know if it helps with your Kingston drive.

    Jeff T.
Sign In or Register to comment.