HistorizeStaleValue Property

General info

Label

Historize Stale Value

Description

Configure in which interval the dynamic value is historized again if the value was not modified.

Data type

UInt32

Default value

0 (syslib.model.codes.StaleValueHistorizationInterval.PERIODIC_HIST_NEVER)

Type

CodingGroup

Code

13242

Symbolic name

MODEL_PROP_HISTORIZESTALEVALUE

Lua access code

syslib.model.properties.HistorizeStaleValue

Available since

1.86

Parent properties

ArchiveOptions

Attributes

Name Tooltip
PROP_CONFIGURABLE The property is configurable and can be changed with DataStudio and the various inmation APIs.
PROP_VISIBLE The property is visible in DataStudio and can be read by the inmation APIs.
PROP_HAS_DEFAULT The property has a default value as standard.

Codings

Name Code Label Tooltip

PERIODIC_HIST_NEVER

0

Never

No stale value historization.

PERIODIC_HIST_DAILY

1

Daily

Daily stale value historization. The timestamp will correspond to a UTC time of 00:00:00.

PERIODIC_HIST_HOURLY

2

Hourly

Hourly stale value historization. The timestamp will correspond to a UTC time of XX:00:00.

Examples

Read from or write to the HistorizeStaleValue property.

  • Lua

  • C#

-- Read from the HistorizeStaleValue
syslib.getvalue("<OBJECT FULL PATH>.TPMOEEPresetOptions.TPMOEEIndexPreset.ArchiveOptions.HistorizeStaleValue")

-- Write to the HistorizeStaleValue
syslib.setvalue("<OBJECT FULL PATH>.TPMOEEPresetOptions.TPMOEEIndexPreset.ArchiveOptions.HistorizeStaleValue",
    syslib.model.codes.StaleValueHistorizationInterval.PERIODIC_HIST_NEVER)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);

// Read from the HistorizeStaleValue
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.TPMOEEPresetOptions.TPMOEEIndexPreset.ArchiveOptions.HistorizeStaleValue"));
// Write to the HistorizeStaleValue
Result result = sli.WriteValue(sc, new WriteItem(StaleValueHistorizationInterval.PERIODIC_HIST_NEVER, "<OBJECT FULL PATH>.TPMOEEPresetOptions.TPMOEEIndexPreset.ArchiveOptions.HistorizeStaleValue"));

A switch-like function of the codings.

function get_coding_name(code)
    local _svhi = syslib.model.codes.StaleValueHistorizationInterval
    if _svhi.PERIODIC_HIST_NEVER==code then return 'PERIODIC_HIST_NEVER'
    elseif _svhi.PERIODIC_HIST_DAILY==code then return 'PERIODIC_HIST_DAILY'
    elseif _svhi.PERIODIC_HIST_HOURLY==code then return 'PERIODIC_HIST_HOURLY'
    end
end
return get_coding_name(syslib.model.codes.StaleValueHistorizationInterval.PERIODIC_HIST_NEVER)