运用VC#编程通过OPC方式实现PC机与西门子
点击数:7525 次 录入时间:03-04 11:43:57 整理:http://www.55dianzi.com PLC入门
IntPtr pos = pResults;Marshal.Copy(pErrors, errors, 0,itemsName.Length);for(int i=0;i {if (errors[i] == 0){OPCITEMRESULT result = (OPCITEMRESULT)Marshal.PtrToStructure(pos, typeof(OPCITEMRESULT));itemsID[i] = result.hServer; pos = new IntPtr(pos.ToInt32() + Marshal.SizeOf(typeof(OPCITEMRESULT)));}else{String pstrError;pIOPCServer.GetErrorString(errors[0],0x407,out pstrError); success=false;break;}}SetItenClient(groupName,itemsID,itemsID); //要求始终只有一个组被激活,才不会引起冲突。}catch (System.Exception err) // catch for error in adding items.{success=false;//error="错误信息:"+error+err.Message;}finally{上一页 [1] [2] [3] [4] 下一页
本文关键字:暂无联系方式PLC入门,plc技术 - PLC入门