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.
51 lines
1.0 KiB
C#
51 lines
1.0 KiB
C#
![]()
11 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using IEC61850.Common;
|
||
|
using IEC61850.Client;
|
||
|
|
||
|
|
||
|
namespace control
|
||
|
{
|
||
|
class ControlExample
|
||
|
{
|
||
|
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);
|
||
|
|
||
|
string objectReference = "IEDM1CPUBHKW/DRCC1.DERStr";
|
||
|
|
||
|
ControlObject control = con.CreateControlObject(objectReference);
|
||
|
|
||
|
ControlModel controlModel = control.GetControlModel();
|
||
|
|
||
|
Console.WriteLine(objectReference + " has control model " + controlModel.ToString());
|
||
|
|
||
|
if (!control.Operate(true))
|
||
|
Console.WriteLine("operate failed!");
|
||
|
|
||
|
|
||
|
|
||
|
con.Abort();
|
||
|
}
|
||
|
catch (IedConnectionException e)
|
||
|
{
|
||
|
Console.WriteLine(e.Message);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|