PropertyStrategy Property

General info

Label

Property Strategy

Description

OPC property strategy to query and create property objects.

Data type

UInt64

Default value

1 (syslib.model.flags.PropertyStrategy.OPCPROP_ITEM_QUERY)

Type

FlagGroup

Code

578

Symbolic name

MODEL_PROP_PROPERTYSTRATEGY

Lua access code

syslib.model.properties.PropertyStrategy

Available since

1.0

Parent properties

PropertyManagement

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.
PROP_INHERIT This Property can inherit from parent if it is the same property.

Flags

Flag group: PropertyStrategy

Name Label Tooltip

OPCPROP_ITEM_QUERY

Query Item Properties

Allow the system to query the server for item property settings during browse process.

OPCPROP_ITEM_CREATE

Create Item Property Objects

Instruct the system to create selected property objects below item level.

OPCPROP_NODE_QUERY

Query Node Properties

Allow the system to query the server for node property settings during browse process.

OPCPROP_NODE_CREATE

Create Node Property Objects

Instruct the system to create selected property objects below item level.

Examples

Read from or write to the PropertyStrategy property.

  • Lua

  • C#

-- Read from the PropertyStrategy
syslib.getvalue("<OBJECT FULL PATH>.OpcXmlCClientOptions.PropertyManagement.PropertyStrategy")

-- Write to the PropertyStrategy
syslib.setvalue("<OBJECT FULL PATH>.OpcXmlCClientOptions.PropertyManagement.PropertyStrategy",
    syslib.model.flags.PropertyStrategy.OPCPROP_ITEM_QUERY)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);

// Read from the PropertyStrategy
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.OpcXmlCClientOptions.PropertyManagement.PropertyStrategy"));
// Write to the PropertyStrategy
Result result = sli.WriteValue(sc, new WriteItem(PropertyStrategy.OPCPROP_ITEM_QUERY, "<OBJECT FULL PATH>.OpcXmlCClientOptions.PropertyManagement.PropertyStrategy"));

A switch-like function of the flags.

function get_flag_name(mask)
    local _ps = syslib.model.flags.PropertyStrategy
    if mask & _ps.OPCPROP_ITEM_QUERY == _ps.OPCPROP_ITEM_QUERY then return 'OPCPROP_ITEM_QUERY'
    elseif mask & _ps.OPCPROP_ITEM_CREATE == _ps.OPCPROP_ITEM_CREATE then return 'OPCPROP_ITEM_CREATE'
    elseif mask & _ps.OPCPROP_NODE_QUERY == _ps.OPCPROP_NODE_QUERY then return 'OPCPROP_NODE_QUERY'
    elseif mask & _ps.OPCPROP_NODE_CREATE == _ps.OPCPROP_NODE_CREATE then return 'OPCPROP_NODE_CREATE'
    end
end
return get_flag_name(syslib.model.flags.PropertyStrategy.OPCPROP_ITEM_QUERY)