Bluetooth physiological data acquisition

David Glasgow david at dvglasgow.wanadoo.co.uk
Fri Mar 9 15:22:11 EST 2007


Revvers,

Every now and then I have raised this on the list, but at last seem to 
be getting somewhere.  I have found some portable bluetooth 
physiological equipment which seems to be very flexible regarding ways 
of acquiring the data.  The most simple involves an invisible process 
writing 80 bytes to a single line file just about once a millisecond 
(overwriting the previous data).  My Rev application only needs to read 
relevant (2 to 4) bytes of that as often as I need (maybe 10-20 times a 
second for around half an hour ), and append that to a second file, 
which I can then parse and analyse later.  I estimate that the final 
result will be about 18,000 to 36,000 lines of data.

I plan to time it all with a 'send doit  to me in tmills milliseconds' 
but I go a bit vague beyond that.  Any suggestions about how to do the 
read-append as efficiently as possible?   Should I try to read the 
specific bytes I want, or read and append the lot, then pick out the 
parts I want later?  It may be a dumb question, but if the source file 
is in the same directory as the growing destination file, is it quicker 
than if the destination file is 'way over there' buried 6 deep in a 
different directory?  Does an append get slower the larger the 
destination file becomes? Finally, what is the most efficient way of 
making the data read conditional?  I had thought about putting a 
'repeat while' somewhere, but I am not sure where.

Best Wishes,

David Glasgow
Carlton Glasgow Partnership

http://www.i-psych.co.uk


More information about the use-livecode mailing list