|
Page 1 of 1
|
[ 4 posts ] |
|
| Author |
Message |
|
Stang
Rookie
Joined: Tue Aug 07, 2007 9:28 am Posts: 3
|
 clearing datalog
Hi,
Is there a way to clear the datalog within a program (or should this be happening automatically when I write it to flash)? I have a program writing to the datalog, then storing it to the flash mem, but when I rerun the program it keeps appending new data to the datalog until it's full. The only way I can currently clear it is to cycle the power on the NXT. Am I missing something obvious?
|
| Tue Aug 07, 2007 9:54 am |
|
 |
|
starwarslegokid
Moderator
Joined: Wed Jan 31, 2007 3:39 am Posts: 298 Location: San Diego, California. USA
|
Hi Stang,
I really haven't played with the data log but if I remember right it saves all its information into a file on the flash correct? If it does, i believe you can use the delete file command at the beginning of each program run. Here is the command and the commentary I found for it:
Delete(sFileName, nIoResult);
Deletes the specified filename from the NXT. nIoResult is non-zero when error occurs.
Let me know if this helps
Scott B-)
_________________Mmmm Legos B-) My Robot Projects: http://www.freewebs.com/robotprojects/
|
| Wed Aug 08, 2007 2:56 pm |
|
 |
|
Stang
Rookie
Joined: Tue Aug 07, 2007 9:28 am Posts: 3
|
Hi Scott,
Thanks for your reply, but no, that's not the problem. When I write to file the datalog isn't cleared, so if I delete the file, then add more points to the datalog, then save it again, the new file (and the datalog) will have both the old points and the new points. My problem is that without a way to clear the datalog (or at least reset the file pointer to the next value to be written) it just fills up until it's full. To take more data I have to turn the brick off to clear the RAM.
I tried changing the value of nUsedDatalogBytes, but it's defined as a const. It seems silly to not have some way to clear it, but I can't work out how from the documentation.
Regards,
Brad
|
| Wed Aug 08, 2007 7:51 pm |
|
 |
|
Stang
Rookie
Joined: Tue Aug 07, 2007 9:28 am Posts: 3
|
Actually, I think I've worked it out now - CreateDatalog[] seems to clear the datalog. Turns out it's not just a vestigial RCX function!
-Stang
|
| Wed Aug 08, 2007 7:56 pm |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 3 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|