Stream.DigitalBlocks

Stream.DigitalBlocks.GetInstance

DBInstance GetInstance(string instancePath)


Returns the full DBInstance object for the given path (or Nothing).


Parameters

Parameter

Description

instancePath

'{ParentGroupPath}.{InstanceName}' (dot- or slash-separated)


Returns

DBInstance


Example

var result = Stream.DigitalBlocks.GetInstance("instancePath");




Stream.DigitalBlocks.GetInstanceState

object GetInstanceState(string instancePath)


Returns a JSON-friendly snapshot of an instance.


Parameters

Parameter

Description

instancePath

instance path


Returns

object


Example

var result = Stream.DigitalBlocks.GetInstanceState("instancePath");




Stream.DigitalBlocks.GetParameter

string GetParameter(string instancePath, string paramName, string default = "")


Returns a parameter value as string, or the default.


Parameters

Parameter

Description

instancePath

instance path

paramName

parameter name

default

returned if instance/parameter is not found


Returns

string


Example

var result = Stream.DigitalBlocks.GetParameter("instancePath", "paramName");




Stream.DigitalBlocks.GetParameterNum

double GetParameterNum(string instancePath, string paramName, double default = 0)


Returns a parameter value as Double.


Parameters

Parameter

Description

instancePath

instance path

paramName

parameter name

default

numeric fallback


Returns

double


Example

var result = Stream.DigitalBlocks.GetParameterNum("instancePath", "paramName");




Stream.DigitalBlocks.GetTagNum

double GetTagNum(string instancePath, string tagSuffix, double default = 0)


Reads an instance-scoped tag as a Double.


Parameters

Parameter

Description

instancePath

instance path

tagSuffix

tag name

default

numeric fallback


Returns

double


Example

var result = Stream.DigitalBlocks.GetTagNum("instancePath", "tagSuffix");




Stream.DigitalBlocks.GetTagStr

string GetTagStr(string instancePath, string tagSuffix, string default = "")


Reads an instance-scoped tag as a string.


Parameters

Parameter

Description

instancePath

instance path

tagSuffix

tag name (no instance prefix)

default

string fallback


Returns

string


Example

var result = Stream.DigitalBlocks.GetTagStr("instancePath", "tagSuffix");




Stream.DigitalBlocks.InstanceExists

bool InstanceExists(string instancePath)


True if a Digital Block instance exists at the given path.


Parameters

Parameter

Description

instancePath

instance path


Returns

bool


Example

var result = Stream.DigitalBlocks.InstanceExists("instancePath");




Stream.DigitalBlocks.ListInstances

List<string> ListInstances(string templateName = "", string groupPath = "")


Returns instance paths (FullGroupPath) optionally filtered by template and/or group.


Parameters

Parameter

Description

templateName

optional template filter

groupPath

optional group filter


Returns

List<string>


Example

var result = Stream.DigitalBlocks.ListInstances();




Stream.DigitalBlocks.ListTemplates

List<string> ListTemplates()


Returns names of all defined Digital Block templates.


Parameters

This function takes no parameters.


Returns

List<string>


Example

var result = Stream.DigitalBlocks.ListTemplates();




Stream.DigitalBlocks.SetTagNum

string SetTagNum(string instancePath, string tagSuffix, double value)


Writes a numeric value to an instance-scoped tag.


Parameters

Parameter

Description

instancePath

instance path

tagSuffix

tag name

value

numeric value


Returns

string


Example

var result = Stream.DigitalBlocks.SetTagNum("instancePath", "tagSuffix", 0);




Stream.DigitalBlocks.SetTagStr

string SetTagStr(string instancePath, string tagSuffix, string value)


Writes a string value to an instance-scoped tag.


Parameters

Parameter

Description

instancePath

instance path

tagSuffix

tag name

value

string value


Returns

string


Example

var result = Stream.DigitalBlocks.SetTagStr("instancePath", "tagSuffix", "value");