Skip to content

Commit c5ad606

Browse files
authored
Merge pull request #45 from longzheng/disconnected-polling
Skip polling if disconnected
2 parents 076641d + 880264d commit c5ad606

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ModbusMaster/MasterForm.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ private void cbPoll_CheckStateChanged(object sender, EventArgs e)
272272

273273
private void pollTimer_Tick(object sender, EventArgs e)
274274
{
275+
// disconnected state, skip
276+
if (groupBoxFunctions.Enabled == false)
277+
return;
278+
275279
if (_lastReadCommand != 0)
276280
ExecuteReadCommand(_lastReadCommand);
277281
}

0 commit comments

Comments
 (0)