Creating a Sink
This example provides information on how to implement a Sink.
Use this procedure to create a Sink:
Check for the existence of Sink, for example, SignalSink.
If a Sink exists remove it from Simulator.DataRecorder.Sinks.
Add a Sink to Simulator.DataRecorder.Sinks.
Solution
Check for the existence of Sink, for example, SignalSink
If exists remove the Sink from Simulator.DataRecorder.Sinks.
if (Simulator.DataRecorder.Sinks.Contains("SignalSink")) { Simulator.DataRecorder.Sinks.Remove(Simulator.DataRecorder.Sinks["SignalSink"]); }
Add a Sink to Simulator.DataRecorder.Sinks.
Simulator.DataRecorder.Sinks.Add(new DataRecorderSink("SignalSink"));
Example
This example provides information on how to implement a Sink.
private void ImplementSink()
{
if (Simulator.DataRecorder.Sinks.Contains("SignalSink"))
{
Simulator.DataRecorder.Sinks.Remove(Simulator.DataRecorder.Sinks["SignalSink"]);
}
Simulator.DataRecorder.Sinks.Add(new DataRecorderSink("SignalSink"));
}
Required Namespaces
ABB.
ABB.