Connectivity Software User's Guide and Reference
SparkplugMetricExtension Class Methods


OpcLabs.EasySparkplug Assembly > OpcLabs.EasySparkplug Namespace : SparkplugMetricExtension Class

For a list of all members of this type, see SparkplugMetricExtension members.

Public Methods
 NameDescription
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric to provide the specified constant data (value, timestamp), non-writable.

The metric will not be writable.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric to provide the specified constant value, non-writable.

The metric will not be writable.

The timestamp will be the current time of this method call.

 
Public Method (Inherited from object)
Public MethodServes as the default hash function. (Inherited from object)
Public MethodGets the System.Type of the current instance. (Inherited from object)
Public Methodstatic (Shared in Visual Basic)Specifies that reads of this metric will be processed by the specified read function.  
Public Methodstatic (Shared in Visual Basic)Specifies that writes of this metric will be processed by the specified write function.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Makes the metric readable.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric to provide Sparkplug data for the pull data provision model by a specified function.

This method always makes the metric readable, but that does not mean it automatically makes it non-writable. If you need a metric that is readable and non-writable, combine this method with calling Writable(SparkplugMetric,Boolean) method with the 'writable' parameter set to false.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric to provide value for the pull data provision model by a specified function.

This method always makes the metric readable, but that does not mean it automatically makes it non-writable. If you need a metric that is readable and non-writable, combine this method with calling Writable(SparkplugMetric,Boolean) method with the 'writable' parameter set to false.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric to behave as read-write register, with specified initial data (value, timestamp).

This method makes the metric both readable and writable. The data written to the metric will become the data subsequently read from the metric.

This method also makes the timestamp of the metric writable, i.e. Sparkplug host applications will be able to modify its value. If you need a different behavior, call the Writable(SparkplugMetric,Boolean) method subsequently, with the desired parameter, or modify the WritableTimestamp accordingly (set it to false).

In order to make a read-write register of certain type, but without having to specify initial data, consider simply using one of the ValueType(SparkplugMetric,Type) overloads.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric to behave as read-write register, with specified initial value.

This method makes the metric both readable and writable. The data written to the metric will become the data subsequently read from the metric.

This method keeps the settings of WritableTimestamp. This means that by default, the timestamp of the metric will not writable. i.e. Sparkplug host applications will not be able to modify it. If you need a different behavior, call the Writable(SparkplugMetric,Boolean) method subsequently, with desired parameter, or modify the WritableTimestamp accordingly (set one or both to true).

In order to make a read-write register of certain type, but without having to specify initial data, consider simply using one of the ValueType(SparkplugMetric,Type) overloads.

 
Public Methodstatic (Shared in Visual Basic)Sets the arbitrary object associated with the metric.  
Public MethodReturns a string that represents the current object. (Inherited from object)
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric to use certain value type.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Makes the metric writable.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric for consuming Sparkplug data by a specified function, for the push data consumption model.

This method always makes the metric writable, including its timestamp, i.e. Sparkplug host applications will be able to modify them. If you need a different behavior, call the Writable(SparkplugMetric,Boolean) method subsequently, with desired parameter, or modify the WritableTimestamp accordingly (set it to true).

This method does not change the readability access of the metric. By default, metrics are readable. If you need a metric that is writable but non-readable, combine this method with calling Readable(SparkplugMetric,Boolean) method with the 'readable' parameter set to false.

The write function returns a boolean value that indicates the outcome of the Sparkplug write operation. The WriteFunction(SparkplugMetric,Type,Func<SparkplugData,Boolean>) method overloads are the most generic extensions methods for writing. If you only need to deal with the metric value (and not its timestamp), consider using one of the WriteValueFunction<TValue>(SparkplugMetric,Type,Func<TValue,Boolean>) or WriteValueAction<TValue>(SparkplugMetric,Type,Action<TValue>) method overloads, for shorter code and easier programming.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric for consuming values by a specified action, for the push data consumption model.

This method always makes the metric writable; however, its timestamp will not be writable, i.e. Sparkplug host applications will not be able to modify them. If you need a different behavior, use one of the WriteFunction(SparkplugMetric,Type,Func<SparkplugData,Boolean>) method overloads instead.

This method does not change the readability access of the metric. By default, metrics are readable. If you need a metric that is writable but non-readable, combine this method with calling Readable(SparkplugMetric,Boolean) method with the 'readable' parameter set to false.

The write operation defined by this method always succeeds. If you need support the option of failing the write operation to fail, use one of the WriteValueFunction<TValue>(SparkplugMetric,Type,Func<TValue,Boolean>) method overloads instead.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the metric for consuming values by a specified function, for the push data consumption model.

This method always makes the metric writable; however, its timestamp will not be writable, i.e. Sparkplug host application will not be able to modify them. If you need a different behavior, use one of the WriteFunction(SparkplugMetric,Type,Func<SparkplugData,Boolean>) method overloads instead.

This method does not change the readability access of the metric. By default, metrics are readable. If you need a metric that is writable but non-readable, combine this method with calling Readable(SparkplugMetric,Boolean) method with the 'readable' parameter set to false.

The write function returns a boolean that indicates the outcome of the Sparkplug write operation. If the outcome of your write operation should always be successful, you can make your code a bit simpler by using one of WriteValueAction<TValue>(SparkplugMetric,Type,Action<TValue>) method overloads instead.

 
Top
Protected Methods
 NameDescription
Protected MethodAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from object)
Protected MethodCreates a shallow copy of the current System.Object. (Inherited from object)
Top
Extension Methods
 NameDescription
Public Extension MethodSets the arbitrary object associated with the node.
Top
See Also

Reference

SparkplugMetricExtension Class
OpcLabs.EasySparkplug Namespace