PersistencyMode Property

General info

Label

Persistency Mode

Description

Options to control the persistency of the dynamic property value of the object.

Data type

UInt32

Default value

1 (syslib.model.codes.PersistencyMode.DO_NOT_PERSIST)

Type

CodingGroup

Code

2034

Symbolic name

MODEL_PROP_PERSISTENCYMODE

Lua access code

syslib.model.properties.PersistencyMode

Available since

1.20

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

Coding group: PersistencyMode

Name Code Label Tooltip

DO_NOT_PERSIST

1

Do not persist the dynamic value

The dynamic value is not persisted.

PERSIST_PERIODICALLY

2

Persist the dynamic value periodically

The dynamic values are persisted in batches every few seconds.

PERSIST_IMMEDIATELY

3

Persist the dynamic value immediately

The dynamic value is persisted synchronously as soon as it changes. If used for many objects, the system may experience a lag when processing dynamic values.

PERSIST_ON_STOP

4

Persist the dynamic value when the service is stopped

When the service is stopped normally, the dynamic value is persisted before shut down.

Examples

Read from or write to the PersistencyMode property.

  • Lua

  • C#

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

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

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

A switch-like function of the codings.

function get_coding_name(code)
    local _pm = syslib.model.codes.PersistencyMode
    if _pm.DO_NOT_PERSIST==code then return 'DO_NOT_PERSIST'
    elseif _pm.PERSIST_PERIODICALLY==code then return 'PERSIST_PERIODICALLY'
    elseif _pm.PERSIST_IMMEDIATELY==code then return 'PERSIST_IMMEDIATELY'
    elseif _pm.PERSIST_ON_STOP==code then return 'PERSIST_ON_STOP'
    end
end
return get_coding_name(syslib.model.codes.PersistencyMode.DO_NOT_PERSIST)