123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using MECF.Framework.Common.Communications;
- using MECF.Framework.Common.Event;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MECF.Framework.Common.EtherCAT.Hongke
- {
- public class WcfCifx : ICifx
- {
- private IWcfCifxService _plcClient;
- public WcfCifx()
- {
- _plcClient = new WcfCifxServiceClient();
- }
- public UInt32 ChannelIOWrite(UInt32 hChannel, UInt32 ulAreaNumber, UInt32 ulOffset, UInt32 ulDataLen, byte[] pvData, UInt32 ulTimeout)
- {
- UInt32 result = 0;
- result = _plcClient.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;
- result = _plcClient.ChannelIORead(hChannel, ulAreaNumber, ulOffset, ulDataLen, ref pvData, ulTimeout);
- return result;
- }
- public UInt32 DriverGetErrorDescription(UInt32 lError, byte[] szBuffer, UInt32 ulBufferLen)
- {
- UInt32 result = 0;
- result = _plcClient.DriverGetErrorDescription(lError, szBuffer, ulBufferLen);
- return result;
- }
- }
- }
|