Table of Contents

Method SetParameter

Namespace
Skyline.DataMiner.Scripting
Assembly
SLManagedScripting.dll

SetParameter(int, object, ValueType)

Sets the parameter with the specified ID to the specified value.

int SetParameter(int iID, object value, ValueType timeInfo)

Parameters

iID int

The ID of the parameter.

value object

The value to set.

timeInfo ValueType

Timestamp.

Returns

int

HRESULT value. A value of 0 (S_OK) indicates the set succeeded.

Examples

protocol.SetParameter(100, "myValue", DateTime.Now);

Remarks

  • In case multiple parameters need to be set, it is preferred to use a single SetParameters method call in order to reduce the inter-process communication between the SLScripting and SLProtocol processes.
  • The method SetParameter(int parameterID, object value, DateTime timestamp) acts a wrapper method for a NotifyProtocol type 256 NT_SET_PARAMETER_WITH_HISTORY call.
  • From DataMiner 10.2.9 onwards (RN 33849), if the DateTime.Kind property of timeInfo is unspecified, the timestamp will be handled as local time.
  • A null value will not clear the parameter but keep its current value. To clear a parameter, see clear.

SetParameter(int, object)

Sets the parameter with the specified ID to the specified value.

int SetParameter(int iID, object value)

Parameters

iID int

The ID of the parameter.

value object

The value to set.

Returns

int

HRESULT value. A value of 0 (S_OK) indicates the set succeeded.

Examples

protocol.SetParameter(100, "myValue");

In order to avoid magic numbers, you can make use of the Parameter class.

protocol.SetParameter(Parameter.myparameter, "myValue");

Remarks

  • In case multiple parameters need to be set, it is preferred to use a single SetParameters method call in order to reduce the inter-process communication between the SLScripting and SLProtocol processes.
  • A null value will not clear the parameter but keep its current value. To clear a parameter, see clear.