[已关闭问题]
关闭于 2008-01-26 01:39
-------------------------定义的OPC操作类-------------------- <BR>using OpcRcw.Da; <BR>using OpcRcw.Comn; <BR><BR>using System; <BR>using System.Collections; <BR>using System.Collections.Generic; <BR>using System.Runtime.InteropServices; <BR>using System.Text; <BR><BR><BR>namespace WCS_SWKJ <BR>{ <BR> public class ClassOpcSynchro <BR> { <BR> public string serverName = "OPC.SimaticNET"; <BR> public IOPCServer pIOPCServer; // OPC server接口 <BR> public Object pobjGroup1; // Pointer to group object <BR> public int nSvrGroupID; // server group handle for the added group <BR> public System.Collections.Hashtable groupsID = new Hashtable(11); //用于记录组名和组ID号 <BR> public System.Collections.Hashtable hitemsID = new Hashtable(17); //用于记录项名和项ID号 <BR> public Guid iidRequiredInterface; <BR> public int hClientGroup = 0; //客户组号 <BR> public int hClientItem = 0; //Item号 <BR><BR><BR> /// <BR> /// 创建一个OPC Server接口 <BR> /// <BR> /// 返回错误信息 <BR> /// 若为true,创建成功,否则创建失败 <BR> public bool Open(out string error) <BR> { <BR> ///dt = new S7Connection.DataChange(DataChange); <BR> ///server = new AsynServer(S7Connection.ServerType.OPC_SimaticNET, dt); <BR><BR> &n