IWcfPlcService.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.ServiceModel;
  3. namespace MECF.Framework.Common.PLC
  4. {
  5. [ServiceContract]
  6. [ServiceKnownType(typeof(float[]))]
  7. [ServiceKnownType(typeof(bool[]))]
  8. [ServiceKnownType(typeof(int[]))]
  9. [ServiceKnownType(typeof(byte[]))]
  10. [ServiceKnownType(typeof(double[]))]
  11. public interface IWcfPlcService
  12. {
  13. [OperationContract]
  14. int Heartbeat(int counter);
  15. [OperationContract]
  16. bool Read(string variable, out object data, string type, int length, out string reason);
  17. [OperationContract]
  18. bool WriteArrayElement(string variable, int index, object value, out string reason);
  19. [OperationContract]
  20. bool[] ReadDi(int offset, int size, out string reason);
  21. [OperationContract]
  22. float[] ReadAiFloat(int offset, int size, out string reason);
  23. [OperationContract]
  24. int[] ReadAiInt(int offset, int size, out string reason);
  25. [OperationContract]
  26. short[] ReadAiInt16(int offset, int size, out string reason);
  27. [OperationContract]
  28. bool WriteDo(int offset, bool[] buffer, out string reason);
  29. [OperationContract]
  30. bool WriteAoFloat(int offset, float[] buffer, out string reason);
  31. [OperationContract]
  32. bool WriteAoInt(int offset, int[] buffer, out string reason);
  33. [OperationContract]
  34. bool WriteAoInt16(int offset, short[] buffer, out string reason);
  35. }
  36. }