Author Topic: log data, how long can I log?  (Read 9717 times)

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 220
  • Karma: +7/-0
log data, how long can I log?
« on: April 10, 2015, 11:58:43 PM »
Guys,

Here is the concern.  I want to log a U8 data every second. I will have the second (U8), minute (U8) and hour (U8) assigned for the data.

so that makes 4 bytes, right?

plus the name of the variable, the tag and the : I guess I should add another 5 bytes, So total bytes to be logged every second is 9 bytes (hypotetically)

I am using a DP250 with 16MB, I have allocated only 2MB for the log.  Doing a basic math I would said the following:

2MB divided by 9 bytes = 222,222 times I can record the data.

so if the data is logged every second therefore I can divide 222,222 between 3600 secs (1 hour) which will be equal to 61 hours.

then it will start overwritting the earliest data.

the problem is that doing some testing I got 5896 times the data logged then it starts over. in time that would be 5896/3600 = 1.6 hours not 61 that I was expecting.

Does anyone have figure out a more accurate way to know how long you can log data?

or what is wrong/missed in my basic calculations?

I appreciate any advice

Regards

Antonio

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 352
  • Karma: +8/-0
    • Marbek Elektronik
Re: log data, how long can I log?
« Reply #1 on: April 11, 2015, 10:09:58 AM »
Perhaps 1byte needs more space then 1byte, maybe 16 or 32 bit!?

Please test the following:
Combine 2 bytes to 1 word and test again,
and then combine 2 words to 32bit and test again.
What is the difference?
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung

Offline oiltronic

  • PLUS+1 Guru
  • *****
  • Posts: 170
  • Karma: +15/-0
Re: log data, how long can I log?
« Reply #2 on: April 14, 2015, 06:55:25 AM »
2MB divided by 5896 log entries is a rather pudgy 339 to 356 bytes per log entry, depending whether we're talking 2000000 or 2^21 bytes, respectively.  Data byte packing is the least of your worries, because even if those 4 data bytes were each put into a 32-bit word then that's still only 16 bytes of data.  The metadata for the log entry probably uses fixed-width text fields for the signal name, etc.  So unless there's a way to configure the logging (don't know, haven't done it) I think you're stuck.

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 220
  • Karma: +7/-0
Re: log data, how long can I log?
« Reply #3 on: April 16, 2015, 02:49:50 PM »
Guys,

Marbek,

I have not done your suggestions yet,

but thinking about what oiltronic said.

if the log has fixed lenght for a variable, it may be better to put as many variables as posible as a 1 variable, in that way I will be saving space or gaining log times


in other words let say I want to log temperature, pressure and level.... so instead of use  a log variable for each one it may be better to only have a letter before the value of each parameter and put all 3 as 1 variable.

I will do more tests I see what the differences are. 

I wonder why the Plus1 guys does not provide some information about how to calculate how long you can log based on your data.

thanks for your advises

Regards

Offline jashom1

  • PLUS+1 Expert
  • ****
  • Posts: 80
  • Karma: +6/-0
Re: log data, how long can I log?
« Reply #4 on: April 29, 2015, 12:30:33 AM »
Guys,

From my experience with a DP600LX I believe the Application log stores pure ASCII, which might explain the difference in logging size and time that you mention.  Because it's pure ASCII it will also take into effect if you pad out numbers with leading zeros etc.  Commas, quotes and slashes that separate data also will use one byte.

For example if we log date, time, and one parameter the string that is written to the Application log would be something like this:

"03/05/15,09:25:18,34"

Which by my counting would be 22 bytes long.

I have found some limitations on the amount of variables in the application log string (on a DP600), it seems to fall over on anything larger than 20 variables in one line, which the help desk is looking into.

Hope this helps.

John.