| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | using Aitex.Core.WCF;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace MECF.Framework.Common.EtherCAT.Hongke{    public class WcfCifxServiceClient : ServiceClientWrapper<IWcfCifxService>, IWcfCifxService    {        public WcfCifxServiceClient(string configName)             : base(configName, "WcfCifxService")        {        }        public WcfCifxServiceClient()            : base("Client_IWcfCifxService", "WcfCifxService")        {        }        public UInt32 ChannelIOWrite(UInt32 hChannel, UInt32 ulAreaNumber, UInt32 ulOffset, UInt32 ulDataLen, byte[] pvData, UInt32 ulTimeout)        {            UInt32 result = 0;            Invoke(svc =>            {                result = svc.ChannelIOWrite(hChannel, ulAreaNumber, ulOffset, ulDataLen, pvData, ulTimeout);            });            return result;        }        public UInt32 ChannelIORead(UInt32 hChannel, UInt32 ulAreaNumber, UInt32 ulOffset, UInt32 ulDataLen, ref byte[] pvData, UInt32 ulTimeout)        {            UInt32 result = 0;            byte[] temp = new byte[1024];            Invoke(svc =>            {                result = svc.ChannelIORead(hChannel, ulAreaNumber, ulOffset, ulDataLen, ref temp, ulTimeout);            });            pvData = temp;            return result;        }        public UInt32 DriverGetErrorDescription(UInt32 lError, byte[] szBuffer, UInt32 ulBufferLen)        {            UInt32 result = 0;            Invoke(svc =>            {                result = svc.DriverGetErrorDescription(lError, szBuffer, ulBufferLen);            });            return result;        }    }}
 |