1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
namespace opc2
{
public partial class Form1 : Form
{
OPCServer ObjOPCServer;
OPCGroups ObjOPCGroups;
OPCGroup ObjOPCGroup;
string OPCServerName;
public Form1()
{
try
{
InitializeComponent();
OPCServerName = "Serveur OPC";
ObjOPCServer = new OPCServer();
ObjOPCServer.Connect(OPCServerName, "");
ObjOPCServer.OPCGroups.DefaultGroupIsActive = false;
ObjOPCServer.OPCGroups.DefaultGroupDeadband = 50;
ObjOPCGroups = ObjOPCServer.OPCGroups;
ObjOPCGroup = ObjOPCGroups.Add("Group1");
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
} |
Partager