Sic.Framework/MECF.Framework.Common/MECF/Framework/Common/PLC/IAdsPlc.cs

40 lines
1015 B
C#
Raw Normal View History

2023-04-13 11:51:03 +08:00
using System;
using System.ServiceModel;
using Aitex.Core.RT.Device;
using MECF.Framework.Common.Event;
namespace MECF.Framework.Common.PLC
{
[ServiceContract]
[ServiceKnownType(typeof(float[]))]
[ServiceKnownType(typeof(bool[]))]
[ServiceKnownType(typeof(int[]))]
[ServiceKnownType(typeof(byte[]))]
[ServiceKnownType(typeof(double[]))]
public interface IAdsPlc : IDevice
{
AlarmEventItem AlarmConnectFailed { get; set; }
AlarmEventItem AlarmCommunicationError { get; set; }
event Action OnConnected;
event Action OnDisconnected;
[OperationContract]
bool CheckIsConnected();
[OperationContract]
bool Read(string variable, out object data, string type, int length, out string reason);
[OperationContract]
bool WriteArrayElement(string variable, int index, object value, out string reason);
[OperationContract]
bool BulkReadRenderResult(string Adrress, ushort length, out byte[] data);
[OperationContract]
bool BulkWriteByteRenderResult(string Adrress, byte[] data);
}
}