Parallax Memory Stick DataLogger

Has anyone played around with this yet ?
When I open a file for writing and write some data it puts it at the end of the file. Okay that's cool.
But if I seek to the beginning of the file and write some data, the file gets truncated after the data I wrote. I'm wondering if that is normal, or am I doing something wrong ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
When I open a file for writing and write some data it puts it at the end of the file. Okay that's cool.
But if I seek to the beginning of the file and write some data, the file gets truncated after the data I wrote. I'm wondering if that is normal, or am I doing something wrong ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
Comments
Is this Parallax product similar to your SD Data Logger? Just kind of a different way of doing the same thing or is there more to it than that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
I think the behavior you're seeing is normal for the current Vinculum firmware and, in fact, is how you're supposed to truncate a file (open in write mode, position somewhere, then close the file to truncate after the current position). There are no provisions for random updating yet.
Just for the record, my datalogger doesn't allow random write either.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
When you seek to a certain position and perform a WRITE, the file is truncated after the
data you write. Therefore you can only write data to the end of the file.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
I had a small database on a Vdrive which I would access from a BS2. The database was an inventory of goods and some of the fields were variable like price and quantity.
Each goods item had its own folder on the drive and each field was a seperate file. So if I wanted to adjust the price or quantity of an item for example I would simply address the path and overwrite the file Folder1/price.txt.....Folder2/price.txt .....Folder1/quantity.txt etc.
When I wanted to view·a database entry I would loop through·a folder and debug each field to the monitor as one continuous string.
A little more costly on disk space but it was never an issue for my application and access was very quick. I·feel·sure the same can be done with the SD logger and the Parallax logger (and probably has).
Just an additional thought, using the method above would make a great·way·of mapping an area into a grid. Using a folder as x,y coordinates and the files within the folder containing terrain description. An option, maybe,·for those wanting to use mapping in their robot apps.
Jeff T.
well I'll be ordering one this week, so we'll see what happens.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
I am sure you have thought about this and thought of much betters ways to do the same thing. The directory structure is fast to access and although I havn't read the Parallax logger specs I have an idea it can support a 4G thumbdrive.
sorry for getting off topic, but after starting with the short comings of writing randomly to a file a little discussion shows that the Parallax logger has more going for it than against.
Jeff T.
It was designed to be only a data logger, and there is no code space left to add features [noparse]:([/noparse]
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·