StorageStrategy Property

General info

Label

Storage Strategy

Description

Summarizes the settings for historization, aggregration and forecasting for a particular ItemValue.

Data type

UInt64

Default value

0

Type

FlagGroup

Code

154

Symbolic name

MODEL_PROP_STORAGESTRATEGY

Lua access code

syslib.model.properties.StorageStrategy

Available since

1.0

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.

Flags

Name Label Tooltip

STORE_RAW_HISTORY

Raw History

ItemValue is stored in Raw History Collections.

Examples

Read from or write to the StorageStrategy property.

  • Lua

  • C#

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

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

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

A switch-like function of the flags.

function get_flag_name(mask)
    local _ivss = syslib.model.flags.ItemValueStorageStrategy
    if mask & _ivss.STORE_RAW_HISTORY == _ivss.STORE_RAW_HISTORY then return 'STORE_RAW_HISTORY'
    end
end
return get_flag_name(syslib.model.flags.ItemValueStorageStrategy.STORE_RAW_HISTORY)