IModBus.cs 530 B

12345678910111213141516
  1. using ProtocalGeneral;
  2. namespace ModBusTcp;
  3. public interface IModBus<T_buffer>
  4. {
  5. bool Initialize(string name, ITcpConnectNority tcpConnect);
  6. T_buffer GetBuffer(ushort index, ushort count, byte slaveAddress = 1);
  7. bool SetUshort(ushort index, ushort value, byte slaveAddress = 1);
  8. bool SetValue<T>(ushort index, T value, byte slaveAddress = 1) where T : struct;
  9. bool SetFloat(ushort index, float value, byte slaveAddress = 1);
  10. bool Open(string ip, ushort port, bool notify = true);
  11. bool Close();
  12. }