更新2026

This commit is contained in:
GukSang.Jin
2026-05-20 11:29:20 +08:00
parent 9da775aa37
commit a4a95e6cf3
5 changed files with 58 additions and 5 deletions

View File

@@ -45,6 +45,16 @@ namespace TabletTester2025.Services
return Task.FromResult(value);
}
public Task<int> ReadInt32Async(ushort startAddress)
{
int value = startAddress switch
{
400 => 50, // 硬度破损判定
_ => _rand.Next(0, 1000)
};
return Task.FromResult(value);
}
public Task WriteCoilAsync(ushort coilAddress, bool value) => Task.CompletedTask;
public Task<bool> ReadCoilAsync(ushort coilAddress)
@@ -55,6 +65,8 @@ namespace TabletTester2025.Services
public Task WriteRegisterAsync(ushort registerAddress, ushort value) => Task.CompletedTask;
public Task WriteInt32Async(ushort startAddress, int value) => Task.CompletedTask;
public Task WriteFloatAsync(ushort startAddress, float value) => Task.CompletedTask;
public Task<ushort[]> ReadHoldingRegistersAsync(ushort startAddress, ushort count)