123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using System;
- namespace Team.Communicate.Modbus
- {
- public interface IModbusTcpMaster
- {
- public string Ip { get; }
- public int Port { get; }
- int ConnectTimeOut { get; set; }
- byte SlaveId { get; set; }
- bool IsConnect { get; }
- void Connect();
- Task ConnectAsync();
-
-
-
-
-
-
- Task<bool> ReConnect();
- ushort[] ReadBytes(ushort start, ushort length);
-
-
-
-
-
-
- bool GetBool(ushort start, ushort index);
- List<KeyValuePair<string, bool>> GetBoolList(IEnumerable<string> addresses);
-
-
-
-
-
-
- Task<bool> GetBoolAsync(ushort start, ushort index);
-
-
-
-
-
-
- void WriteBool(ushort start, int index, bool flag);
-
-
-
-
-
-
- Task WriteBoolAsync(ushort start, int index, bool flag);
- void WriteInt32(ushort start, int value);
- Task WriteInt32Async(ushort start, int value);
-
-
-
-
-
-
- void WriteByte(ushort start, int index, byte value);
-
-
-
-
-
-
- Task WriteByteAsync(ushort start, int index, byte value);
-
-
-
-
-
- void WriteDouble(ushort start, double value);
-
-
-
-
-
-
- Task WriteDoubleAsync(ushort start, double value);
-
-
-
-
-
- void WriteFloat(ushort start, float value);
-
-
-
-
-
-
- Task WriteFloatAsync(ushort start, float value);
-
-
-
-
-
- float GetFloat(ushort index);
-
-
-
-
-
- Task<float> GetFloatAsync(ushort index);
-
-
-
-
-
- ushort GetShort(ushort index);
-
-
-
-
-
- Task<ushort> GetShortAsync(ushort index);
-
-
-
-
-
-
- int GetInteger(ushort index);
-
-
-
-
-
-
- Task<int> GetIntegerAsync(ushort index);
-
-
-
-
-
-
- Task<byte> GetByteAsync(ushort start, int index);
-
-
-
-
-
-
- byte GetByte(ushort start, int index);
- ushort[] GetBytes(ushort start, ushort length);
- Task<ushort[]> GetBytesAsync(ushort start, ushort length);
-
- event EventHandler<bool> ConnectChanged;
-
- }
- }
|