This commit is contained in:
sc committed 2026-01-18 19:28:00 +08:00
1 parent cf65689558
commit 312f501742
1 file changed
+2 -6
+2 -6
View File
@@ -50,7 +50,6 @@ static void mb_plc_read_regs(mb_inst_t *hinst)
}else
{
rt_thread_mdelay(500);
return;
}
// 输出 m0256 -> RTU 2256
@@ -68,10 +67,9 @@ static void mb_plc_read_regs(mb_inst_t *hinst)
}
// 写入 Modbus
int mwy = mb_write_bits(hinst, 2256, DO_TABLE_SIZE, w_buffer);
if (mwy <= 0)
if (mwy ==0)
{
rt_thread_mdelay(500);
return;
}
//输入寄存器d0->6000
@@ -86,7 +84,6 @@ static void mb_plc_read_regs(mb_inst_t *hinst)
}
}else {
rt_thread_mdelay(500);
return;
}
//输出寄存器d100->6100
@@ -97,10 +94,9 @@ static void mb_plc_read_regs(mb_inst_t *hinst)
}
// 写入 Modbus
int mwd = mb_write_regs(hinst, 6100, AO_TABLE_SIZE, w_regsD);
if (mwd > 0)
if (mwd == 0)
{
rt_thread_mdelay(500);
return;
}
}