Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Size of table set with DataTable() does not match size in the tabledef file


Eppie May 31, 2011 12:38 PM

Hello,

I have a problem with a CR200. In the program are several tables defined with the TableDef statement. I all give them a fixed size.

Example:

DataTable(Meetwaarden,1,2000). So the table can hold a max of 2000 records.

After compiling and sending this to the logger I connect with my own software to the logger and start downloading the tabledef file.

The weird thing is that the size mentioned in the tabledef does not always match the size defined in the program! How is this possible? I've double checked if I read the right bytes but this was ok. :S

Example:
TableDef ( Id: 2 Name: Meetwaarden Size: 2016 TimeType: c TimeInfo: 0 Interval: 0 Signature: 4294942298 )


I want to use this size to determine when I reached the last record number so I can go further with the first record. If someone knows an other way to do this I'm all ear!

Thanks in advance!


Sam Jun 2, 2011 12:28 AM

DataTable(Meetwaarden,1,2000)

means that the table should hold a minimum of 2000 records.

Memory is generally not allocated in exacting measures - bit by bit. Instead it is allocated in finite chunks - for example 2^x bytes. This is certainly true for our loggers. Because of that the number of records parameter is used as a minimum.

Can you expand on this statement? I am unclear what the problem is

"I want to use this size to determine when I reached the last record number so I can go further with the first record."


Eppie Jun 6, 2011 06:54 AM

Can you expand on this statement? I am unclear what the problem is

"I want to use this size to determine when I reached the last record number so I can go further with the first record."

In my understanding the tables in the cr200 act like a ring buffer. If there is place for 10 records and the device filled the 10th record it will start over by the first record (Record id 1 till 10). Our is this incorrect and is the record ID always an unique id and will increase?


aps Jun 6, 2011 03:23 PM

The record number is an almost unique ID, it will keep on incrementing until is hits 2^32 then it will restart at zero.


Sam Jun 8, 2011 01:51 PM

And a record should have a unique combination of Record Number and Timestamp.

Log in or register to post/reply in the forum.