发表于:2006-05-20 17:56:00
2楼
@@@@@@@@@@@@@ Add Opc Group
private void AddOpcGroup_Click(object sender, System.EventArgs e)
{
OpcAddGroup() ;
}
private OpcGroup tOpcGroup ;
private string tGroupName = "thisGroup" ;
private bool tActive = true ;
private int tEquestedUpdateRate = 1000;
private float tDeadBand = 0.0F ;
private string tReturnGroupName ;
private void OpcAddGroup()
{
tOpcGroup = tOpcServer.AddGroup(tGroupName, tActive, tEquestedUpdateRate, ref tDeadBand, 0, 0);
tReturnGroupName = tOpcGroup.Name.ToString() ;
OpcGroupName.Text = tReturnGroupName ;
tOpcGroup.DataChanged += new DataChangeEventHandler( DataChangedHandler );
tOpcGroup.ReadCompleted += new ReadCompleteEventHandler( ReadCompleteHandler );
tOpcGroup.WriteCompleted += new WriteCompleteEventHandler( WriteCompleteHandler );
tOpcGroup.AdviseIOPCDataCallback();
}