I will be used the 128 data change handler for taking the updates of the OPC server but only 2 are working fines, but another is not working. It will stop af开发者_运维百科ter 15 min. Please tell me how many data change handlers will work in one application. Data change handler working is same as timer thread; it will be invoke after the 250 milliseconds.
private void DataChangeHandler(object sender, DataChangeEventArgs e)
{
// The invoke handling is only required when
// the callback handler writes data into Windows dialogs
try
{
if (InvokeRequired)
{
BeginInvoke(new DataChangeEventHandler(DataChangeHandler),
new object[] { sender, e });
// return;
}
if (parameter.X == 0)
{
parameter.X = 1;
Thread th = new Thread(param.update);
th.Start(e);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
精彩评论