What does the CreateDatalog(size) function do? It isn't listed in the "NXT Datalog Test.c" sample program and I can't figure out a use for it.

What format is the .rdt file saved in? Is this a Lego format? Is it documented? I'd like to be able to write a program to read it.

When you use the RobotC GUI to do a "Spreadsheet Upload" to a .csv file, why are there two columns of data? For example, from "NXT Datalog Test.c":

Code:

1: 255 20012: 3 03: 3 14: 3 2...

Is the first line always 255, # data points?

Too many questions? I'll post any answers I get to the wiki. Thanks.

Wed Apr 04, 2007 8:38 pm

JamesD

Novice

Joined: Sun Feb 04, 2007 12:48 amPosts: 69Location: Australia

Hi Trailfoot,
In response to your questions:

1) I'm pretty sure the CreateDatalog(size) function does appear in the "NXT Datalog Test.c" near the top and is used to define the number of readings/variables you want to record. In the sample it is set to 2000.

2) I've no idea

3) I can't answer your question about the first column but I'd also like to know why and what this column represents. I'd also like to pose another question about timestamps. Is it possible to use a datalog that also timestamps each entry. Do I need to run a different datalog at the same time? Can this be done?

Thanks
James

Mon Apr 23, 2007 2:05 am

Dick Swan

Creator

Joined: Fri Feb 09, 2007 9:21 amPosts: 616

What does the CreateDatalog(size) function do? It isn't listed in the "NXT Datalog Test.c" sample program and I can't figure out a use for it. This is a legacy hangover from the iniitla RobotC implementation on the Mindstorms RCX. On the RCX the datalog and user programs shared the same memory and the "CreateDatalog" function was used to indicate how much of this single memory pool was assigned to the datalog.

On the NXT, the datalog is fixed in size at something like 7000 entries. The "CreateDatalog" function has no effect.

What format is the .rdt file saved in? Is this a Lego format? Is it documented? I'd like to be able to write a program to read it. The format is 3-bytes per datalog entry. The size is dependend on the number of used entries in the datalog. It's three bytes because the first byte contains the "source" of the data point (i.e. is in a sensor value, a timer value, a user variable, etc). The next two bytes are the actual data point.

The purpose of storing a source type is to allow for storing multiple data sets in the single datalog. For example, you might want to store the values of two different sensors.

One way of logging data points is to create a task that periodically -- say every 50 milliseconds -- logs a data point. This way you have a known time base of when data points vs time the point was logged.

But there may be cases when you don't want to periodically log data points. You may only want to log a data point when some action triggers it. Say when you push a button or touch sensor you might want to log the value of a light sensor. In this case it would make sense to actually log two items. The first item is a timer value so that you know when the second item -- the actual data point -- was logged.

Say you logged timer "T1" with a 100Msec resolution it would have source type "0x20". Timers T2/T3/T4 would be source types 0x21/0x22/0x23.

Sensor values are source types 0x40 to 0x43 for the four sensor ports.

When you use the RobotC GUI to do a "Spreadsheet Upload" to a .csv file, why are there two columns of data? For example, from "NXT Datalog Test.c":THis is explained above. Note that the first entry in the file is "special". The source type is 255 (only used for the first entry) and the "value" is the number of datapoints in the datalog.

Thu Apr 26, 2007 9:23 am

JamesD

Novice

Joined: Sun Feb 04, 2007 12:48 amPosts: 69Location: Australia

Hi Dick,

Thanks for taking the time to make such a detailed and clear response. It is very much appreciated.

James

Sun Apr 29, 2007 6:56 am

JamesD

Novice

Joined: Sun Feb 04, 2007 12:48 amPosts: 69Location: Australia

Datalogging: Does too much data 'brick' the NXT?

I moved this from its own post as I felt it better to add to this one

Hi All,

Has anyone else been playing around with datalogging and ended up 'bricking' (getting the NXT into a non functioning state) their NXT?

I'm not sure why. It might be because I was trying to collect too many data values, but it 'bricked' requiring me to reload the firmware.

Anyone else had a similar experience?
Am I correct in assuming if I go over approx 7000 readings I'll brick the NXT?

Thanks
James

Mon Jun 11, 2007 7:53 am

Dick Swan

Creator

Joined: Fri Feb 09, 2007 9:21 amPosts: 616

Exceing the datalog size should not "brick" the NXT. In my testing, the NXT quietly simply stopped logging data points. IF this is not happening then it is a bug.

If you post some code that causes the problem, I'll analyze it to determine the root cause. Even better if you send me a PM as I'll get to it sooner.

Fri Jun 22, 2007 5:57 am

amormachine

Rookie

Joined: Mon Jul 09, 2007 6:47 pmPosts: 3

Datalog Continued ...

Is there a way to datalog multiple columns? or do you have to log the data in one column sequentially?

Tue Jul 10, 2007 7:25 pm

amormachine

Rookie

Joined: Mon Jul 09, 2007 6:47 pmPosts: 3

Floats?

An additional question would be whether or not you can datalog a float value. Unfortunately, it appears that all values are saved as integers.

Tue Jul 10, 2007 8:58 pm

JamesD

Novice

Joined: Sun Feb 04, 2007 12:48 amPosts: 69Location: Australia

As far as datalogging to separate columns, my understanding is it dumps to a single column and then you export it to excel and sort the column based on the "source data Point" Dick referred to above and seperate these out into separate columns for analysis.

Re Floating point, I don't think it does it, so depending on the level of detail you need, ie (# of decimal places) you might want to multiply your floating point numbers by 100 and divide them later in excel.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum