Store PLCnext CommunityPLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. fabianr
  2. PLCnext Engineer
  3. Friday, 18 December 2020

I'm using the SQLite datalogger to store measure and event values in two different configurations.

Now I wanted to use Node.js to read the data from the created databases, which works fine.

But now my question is how can i interpret the value in the "Timestamp" column as a readable date time?

e.g. a value in this column is 5249124847214548914 which is obviously no unix timestamp, because when converting this value to a readable date time it results in "27.12.166338146642 - 23:41:54"

My current setting in the datalogger configuration for Timestamp format is "RAW", but I also used ISO 8601 format, which ended in a similar result.

 

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hello,

There was a problem with PLCnext Engineer 2020.6, which meant that the selection of ISO 8601 format was effectively ignored:

https://www.plcnext-community.net/en/discussions-2-offcanvas/native-datalogger.html#reply-6245

This should be fixed in PLCnext Engineer 2021.0.

The RAW time format is described in the Info Center:

The implementation and internal representation complies to the Microsoft® .NET DateTime class, see the documentation of DateTime Struct on  docs.microsoft.com

More information is given in that other forum thread:

The Datalogger uses the ToBinary method to encode the date/time and "kind" data. If you are using C# or VB.NET to read the TimeStamp field, you can use the FromBinary method. Otherwise you can remove the two leading bits, and the remaining data represents the ticks (in 100s of nanoseconds) since 01.01.0001.

... and a conversion example is given:

https://www.plcnext-community.net/en/discussions-2-offcanvas/native-datalogger.html#reply-6098

Hope this helps.

~ Martin.

 

 

 

 

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. more than a month ago
  2. PLCnext Engineer
  3. # 1
fabianr Accepted Answer Pending Moderation
0
Votes
Undo

Hi Martin,

thanks for the reply. I tried to update the existing project to PLC Next Engineer 2021.0 but unfortunately i get two error messages after the conversion.

One of the error messages mentiones the DataLogger, but i deleted my existing configuration before the conversion.

See error messages in attachment.

 

Attachments (1)
  1. more than a month ago
  2. PLCnext Engineer
  3. # 2
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

OK, we will need to get more information about your project. Is it OK if we contact you at the email address that you used to register on this forum?

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. more than a month ago
  2. PLCnext Engineer
  3. # 3
fabianr Accepted Answer Pending Moderation
0
Votes
Undo

sure, no problem

  1. more than a month ago
  2. PLCnext Engineer
  3. # 4
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

This has been answered by email, but for others - the datalogger issue is also discussed here:

https://www.plcnext-community.net/en/discussions-2-offcanvas/datalogger-problem.html

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.