You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.8 KiB

8 months ago
  1. namespace Mirle.Component.MPLC.Interfaces
  2. {
  3. /// <summary>
  4. /// MIRLE PLC 資料提供介面
  5. /// </summary>
  6. public interface IMPLCProvider
  7. {
  8. /// <summary>
  9. /// 是否連線
  10. /// </summary>
  11. bool IsConnected { get; }
  12. /// <summary>
  13. /// 取得位元
  14. /// </summary>
  15. /// <param name="address">位置</param>
  16. /// <returns>True/False</returns>
  17. bool GetBit(string address);
  18. /// <summary>
  19. /// 設置位元開啟
  20. /// </summary>
  21. /// <param name="address">位置</param>
  22. /// <returns>True/False</returns>
  23. void SetBitOn(string address);
  24. /// <summary>
  25. /// 設置位元關閉
  26. /// </summary>
  27. /// <param name="address">位置</param>
  28. /// <returns>True/False</returns>
  29. void SetBitOff(string address);
  30. /// <summary>
  31. /// 讀取字元
  32. /// </summary>
  33. /// <param name="address">位置</param>
  34. /// <returns>值</returns>
  35. int ReadWord(string address);
  36. /// <summary>
  37. /// 寫入字元
  38. /// </summary>
  39. /// <param name="address">位置</param>
  40. /// <param name="data">值</param>
  41. void WriteWord(string address, int data);
  42. /// <summary>
  43. /// 讀取多個字元
  44. /// </summary>
  45. /// <param name="startAddress">起始位置</param>
  46. /// <param name="length">長度</param>
  47. /// <returns>資料集</returns>
  48. int[] ReadWords(string startAddress, int length);
  49. /// <summary>
  50. /// 寫入多個字元
  51. /// </summary>
  52. /// <param name="startAddress">起始位置</param>
  53. /// <param name="data">資料集</param>
  54. void WriteWords(string startAddress, int[] data);
  55. }
  56. }