IPLCAccessor.cs 706 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Text;
  5. using WCS.Entity;
  6. namespace WCS.Core
  7. {
  8. public interface IPLCAccessorCreater
  9. {
  10. IPLCAccessor Create(WCS_PLC data);
  11. }
  12. public interface IPLCAccessor
  13. {
  14. void WriteBytes(ushort db, ushort address, byte[] data);
  15. byte[] ReadBytes(ushort db, ushort address, ushort length);
  16. }
  17. public class PLCAccessor : EntityEx<WCS_PLC>
  18. {
  19. public static IPLCAccessorCreater Creater;
  20. public IPLCAccessor Accessor { get; private set; }
  21. public PLCAccessor(WCS_PLC entity) : base(entity)
  22. {
  23. Accessor = Creater.Create(entity);
  24. }
  25. }
  26. }