IPlc.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.ServiceModel;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Aitex.Core.RT.Device;
  8. using MECF.Framework.Common.Communications;
  9. using MECF.Framework.Common.Event;
  10. namespace MECF.Framework.Common.PLC
  11. {
  12. [ServiceContract]
  13. [ServiceKnownType(typeof(float[]))]
  14. [ServiceKnownType(typeof(bool[]))]
  15. [ServiceKnownType(typeof(int[]))]
  16. [ServiceKnownType(typeof(byte[]))]
  17. [ServiceKnownType(typeof(double[]))]
  18. public interface IPlc : IDevice, IConnection
  19. {
  20. AlarmEventItem AlarmConnectFailed { get; set; }
  21. AlarmEventItem AlarmCommunicationError { get; set; }
  22. event Action OnConnected;
  23. event Action OnDisconnected;
  24. [OperationContract]
  25. bool CheckIsConnected();
  26. //倍福
  27. [OperationContract]
  28. bool Read(string variable, out object data, string type, int length, out string reason);
  29. [OperationContract]
  30. bool WriteArrayElement(string variable, int index, object value, out string reason);
  31. // 三菱
  32. [OperationContract]
  33. bool ReadBool(string address, out bool[] data, int length, out string reason);
  34. [OperationContract]
  35. bool ReadInt16(string address, out short[] data, int length, out string reason);
  36. [OperationContract]
  37. bool ReadFloat(string address, out float[] data, int length, out string reason);
  38. [OperationContract]
  39. bool WriteBool(string address, bool[] data, out string reason);
  40. [OperationContract]
  41. bool WriteInt16(string address, short[] data, out string reason);
  42. [OperationContract]
  43. bool WriteFloat(string address, float[] data, out string reason);
  44. }
  45. }