Skip to content

Commit

Permalink
Merge pull request #45 from longzheng/disconnected-polling
Browse files Browse the repository at this point in the history
Skip polling if disconnected
  • Loading branch information
graham22 authored Aug 14, 2024
2 parents 076641d + 880264d commit c5ad606
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 c5ad606

Please sign in to comment.