set values to a archive when archivation was not active

Find and share HowTos to various installations / configurations!
5 posts • Page 1 of 1
baumanndo
Posts:10
Joined: Tue Dec 14, 2010 8:03 am

set values to a archive when archivation was not active

Post by baumanndo »

Is it possible to set values to an archive for periods when archivation was not active.
dpSetTimed is does not work, but maybe changing the activation date of archiving a datapoint is possible.... after that dpSetTimed should work ...

Thanks!

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: set values to a archive when archivation was not active

Post by kilianvp »

Only values with a newer time stamp may be written to a data point. For example, if you write a value with the time of today, you cannot write a value from yesterday to the same data point.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: set values to a archive when archivation was not active

Post by leoknipp »

If you want to write a value with a time stamp older than the current for the same DP element you can write a correction values using dpSetTimed().
Nevertheless when using HDB archiving you can only write value for time periods when archiving was active. The Data Manager and Archive Manager know when the archive config was active.
Why do you want to write values for a time period where archiving was inactive?
Why was it inactive for a given period?

Best Regards
Leopold Knipp
Senior Support Specialist

baumanndo
Posts:10
Joined: Tue Dec 14, 2010 8:03 am

Re: set values to a archive when archivation was not active

Post by baumanndo »

I have a DPT and some datapoints with archive config writing data to the HDB (about 2 years historical data). I want to add a datapoint element to this DPs and set historical values to the new DP-Elements. I want the new dpe's holding historical values in the same way than the old (existing) dps do. I tried to add the historical Data using dpSetTimed - but that doesnt work

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: set values to a archive when archivation was not active

Post by leoknipp »

What you want to do is not possible by design.
If you add now (e.g. 2019.06.25 09:30) an _archive config to a dp element the first value which can be written can have a timestamp equal to 2019.06.25 09:30 or newer.
Writing older values is not possible due to technical limitations.
E.g. possibly the old archive files are already compressed. Adding new dp elements to compressed archive files is not possible.

Maybe you can achieve what you want by some tricks, but I'm not 100% sure if it works in all cases.
You can try to
-- Stop the project
-- Set back the time before the time where the first value shall be written
-- Add a new archive manager to the manager list
-- Start the project without connection to any PLC, without any business logic and without archive managers
-- Configure a complete new archive
-- Start the new archive
-- Add the new dp elements to the DP type
-- Configure the _archive configs
-- Write an initial value to the new dp elements
-- Stop the project
-- Set the time to the current time
-- Start the project
-- Try to write old values to the new dp elements

Before doing this in a real plant system please do some tests in a test environment.
Please take into account that the proposed solution is not officially supported as changing the times and starting the project with a huge time deviation might causes other problems.

Best Regards
Leopold Knipp
Senior Support Specialist

5 posts • Page 1 of 1