IPLCControl.cs 811 B

1234567891011121314151617181920
  1. namespace PLCControl
  2. {
  3. public interface IPLCControl
  4. {
  5. public string IPAddress { get; set; }
  6. public int Port { get; set; }
  7. public byte SlaveID { get; set; }
  8. public Action<bool> ConnectionChanged { get; set; }
  9. public bool IsConnected { get; }
  10. public bool Connect();
  11. public void Disconnect();
  12. public bool ReadBit(ushort address, byte bitindex);
  13. public void WriteBit(ushort address, byte bitindex, bool value);
  14. public short ReadInt16(ushort address);
  15. public void WriteInt16(ushort address, short value);
  16. public void WriteDatas<T>(ushort address, ref T value, byte bytecount) where T : unmanaged;
  17. public void ReadDatas<T>(ushort startAddress, ref T value,byte bytecount) where T : unmanaged;
  18. }
  19. }