Skip to content

Commit

Permalink
Skip polling if disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
longzheng committed Aug 11, 2024
1 parent b7e9237 commit 880264d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ModbusMaster/MasterForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ private void cbPoll_CheckStateChanged(object sender, EventArgs e)

private void pollTimer_Tick(object sender, EventArgs e)
{
// disconnected state, skip
if (groupBoxFunctions.Enabled == false)
return;

if (_lastReadCommand != 0)
ExecuteReadCommand(_lastReadCommand);
}
Expand Down

0 comments on commit 880264d

Please sign in to comment.