Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ModBusWriteOperation.cs
1using System;
2using System.Threading.Tasks;
3using System.Xml;
6
8{
13 {
18
22 protected IValue value = null;
23
30 : base(Parent, Model)
31 {
32 }
33
38 public override Task FromXml(XmlElement Definition)
39 {
40 foreach (XmlAttribute Attr in Definition.Attributes)
41 {
42 switch (Attr.Name)
43 {
44 case "responseVariable":
45 this.responseVariable = new StringAttribute(Attr.Value);
46 break;
47 }
48 }
49
50 return base.FromXml(Definition);
51 }
52
57 public void Register(IValue Value)
58 {
59 if (this.value is null)
60 this.value = Value;
61 else
62 throw new Exception("Write node already has a value defined.");
63 }
64 }
65}
Abstract base class for ModBus operations.
Abstract base class for ModBus write operations.
ModBusWriteOperation(ISimulationNode Parent, Model Model)
Abstract base class for ModBus write operations.
void Register(IValue Value)
Registers a value for the argument.
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
StringAttribute responseVariable
Response variable attribute.
Root node of a simulation model
Definition: Model.cs:49
Contains the value of a string attribute, possibly with embedded script.
Abstract base class for values
Definition: Value.cs:11
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.
Interface for nodes holding a value node