You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
![]()
11 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using IEC61850.Client;
|
||
|
using IEC61850.Common;
|
||
|
|
||
|
namespace example2
|
||
|
{
|
||
|
class WriteValueExample
|
||
|
{
|
||
|
public static void Main (string[] args)
|
||
|
{
|
||
|
IedConnection con = new IedConnection ();
|
||
|
|
||
|
string hostname;
|
||
|
|
||
|
if (args.Length > 0)
|
||
|
hostname = args[0];
|
||
|
else
|
||
|
hostname = "localhost";
|
||
|
|
||
|
Console.WriteLine("Connect to " + hostname);
|
||
|
|
||
|
try
|
||
|
{
|
||
|
con.Connect(hostname, 102);
|
||
|
|
||
|
float setMagF = con.ReadFloatValue("ied1Inverter/ZINV1.OutWSet.setMag.f", FunctionalConstraint.SP);
|
||
|
|
||
|
Console.WriteLine("ied1Inverter/ZINV1.OutWSet.setMag.f: " + setMagF);
|
||
|
|
||
|
setMagF += 1.0f;
|
||
|
|
||
|
con.WriteValue("ied1Inverter/ZINV1.OutWSet.setMag.f", FunctionalConstraint.SP, new MmsValue(setMagF));
|
||
|
|
||
|
con.Abort();
|
||
|
}
|
||
|
catch (IedConnectionException e)
|
||
|
{
|
||
|
Console.WriteLine("IED connection excepion: " + e.Message);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|