设备命令修改

This commit is contained in:
“hsc”
2026-08-06 14:04:28 +08:00
parent 5a565f7361
commit deb3544143
143 changed files with 730494 additions and 1287 deletions
+41 -1
View File
@@ -168,8 +168,48 @@ namespace DeviceCommand.Devices
await .(_slaveAddress, io信息.Address, );
}
// =================================================================================
// 以下为新增的原生命令透传接口,使用台架序号自动路由至对应 IOBoard
// =================================================================================
/// <summary>
/// 内部路由辅助方法:根据板卡索引安全获取当前连接的实例对象
/// 针对指定台架直接写入单个输出开关
/// </summary>
public async Task (int , byte , ushort , bool data)
{
IOBoard targetBoard = GetBoardInstance();
await targetBoard.(, , data);
}
/// <summary>
/// 针对指定台架直接批量写入输出开关
/// </summary>
public async Task (int , byte , ushort , bool[] datas)
{
IOBoard targetBoard = GetBoardInstance();
await targetBoard.(, , datas);
}
/// <summary>
/// 针对指定台架直接读取单个输出开关状态
/// </summary>
public async Task (int , byte , ushort )
{
IOBoard targetBoard = GetBoardInstance();
await targetBoard.(, );
}
/// <summary>
/// 针对指定台架直接批量读取输出开关状态
/// </summary>
public async Task<bool[]> (int , byte , ushort , ushort )
{
IOBoard targetBoard = GetBoardInstance();
return await targetBoard.(, , );
}
/// <summary>
/// 内部路由辅助方法:根据板卡/台架索引安全获取当前连接的实例对象
/// </summary>
private IOBoard GetBoardInstance(int moduleIndex)
{