Connectivity Software User's Guide and Reference
SparkplugMetric Class Methods


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

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

Public Methods
 NameDescription
Public MethodOverridden.   
Public Methodstatic (Shared in Visual Basic)Overloaded. Creates and returns a metric (with given name) in the specified edge node.  
Public MethodCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public MethodOverloaded.  (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Public Method (Inherited from object)
Public MethodServes as the default hash function. (Inherited from object)
Public MethodRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public MethodOverridden.   
Public Method (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Public Method (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Public MethodGets the System.Type of the current instance. (Inherited from object)
Public MethodObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public MethodPerforms a poll operation on the metric.  
Public MethodPerforms a read operation on the metric.  
Public MethodPerforms a write operation on the metric.  
Public Method (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Public MethodOverridden.   
Public MethodUpdates the value of the metric (used for publishing), and sets its timestamp to the current time.  
Public MethodUpdates the write data.  
Public MethodOverloaded. Defines a generalized method that classes must implement to create type-specific method for determining value equality of instances. Determines whether this instance has the same value as a given other instance. (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Public Method (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Top
Protected Methods
 NameDescription
Protected Method (Inherited from System.ComponentModel.Component)
Protected MethodOverloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected MethodInfrastructure. (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Protected MethodRaises the Read event to obtain the metric read data.  
Protected MethodCalled when the value of the ReadData property has changed.  
Protected MethodRaises the Starting event, indicating when the component is starting.  
Protected MethodRaises the Stopped event, indicating when the component has stopped.  
Protected MethodRaises the Write event, supplying the metric write data.  
Protected MethodCalled when the value of the WriteData property has changed.  
Protected MethodInfrastructure. (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Protected MethodInfrastructure. (Inherited from OpcLabs.BaseLib.Widgets.Widget)
Top
Extension Methods
 NameDescription
Public Extension MethodOverloaded. Modifies the metric to provide the specified constant data (value, timestamp), non-writable.

The metric will not be writable.

Public Extension MethodOverloaded. 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 Extension MethodSpecifies that reads of this metric will be processed by the specified read function.
Public Extension MethodSpecifies that writes of this metric will be processed by the specified write function.
Public Extension MethodOverloaded. Makes the metric readable.
Public Extension MethodOverloaded. 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 Extension MethodOverloaded. 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 Extension MethodOverloaded. 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 Extension MethodOverloaded. 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 Extension MethodSets the arbitrary object associated with the node.
Public Extension MethodSets the arbitrary object associated with the metric.
Public Extension MethodOverloaded. Modifies the metric to use certain value type.
Public Extension MethodOverloaded. Makes the metric writable.
Public Extension MethodOverloaded. 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 Extension MethodOverloaded. 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 Extension MethodOverloaded. 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
See Also

Reference

SparkplugMetric Class
OpcLabs.EasySparkplug Namespace