BS2pe and Parallax USB DataLogger question
Michael @ Afineol
Posts: 33
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.
···· 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
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
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.
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 -->
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.