View unanswered posts | View active topics It is currently Mon Sep 21, 2020 12:32 am

Reply to topic  [ 4 posts ] 
clearing datalog 
Author Message

Joined: Tue Aug 07, 2007 9:28 am
Posts: 3
Post clearing datalog

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
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
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:

Wed Aug 08, 2007 2:56 pm
Profile WWW

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.


Wed Aug 08, 2007 7:51 pm

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!


Wed Aug 08, 2007 7:56 pm
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.