CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sat Aug 17, 2019 4:29 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Sqlite Trend Values
PostPosted: Wed Jan 16, 2019 11:12 pm 
Offline

Joined: Fri Feb 16, 2018 5:39 pm
Posts: 25
I have a trend saving values and I made a copy of the SQlite file and loaded it into SQlite Studio. I understand the TS is epoch value in seconds which makes sense when I put it through a converter. My value 2 and value 3 are boolean, which makes sense. What isn't making sense is my Value 1. It's reading a real variable that is a temperature value. But it isn't making sense to me.

For instance it has a value of 1076546816 for something that should be between 2 and 4 degrees C.

How should I go about converting this?

Here is the SQlite file.


Top
   
 Post subject: Re: Sqlite Trend Values
PostPosted: Thu Jan 17, 2019 8:08 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3381
Hi,

In fact the TS value uses a higher resolution seconds. The trend recording encodes all values into a column of integral type and therefore real/lreal values cannot be directly interpreted from that column. To convert that values the value has to be put into a 8 byte binary value and then reinterpreted as real/lreal (respecting the byteorder of the recording device).

The documented way of reading a trenddatabase would be using the according API from the library VisuTrendStorageAccess. An according example can be found with the CODESYS Store: https://store.codesys.com/trend-api-example.html

BR
Edwin


Top
   
 Post subject: Re: Sqlite Trend Values
PostPosted: Thu Jan 17, 2019 5:02 pm 
Offline

Joined: Fri Feb 16, 2018 5:39 pm
Posts: 25
Ah, thanks Edwin.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 7 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® Forum Software © phpBB Limited