An application is using an OPC-Client. This OPC-Client fires for each value change an event. In the Event handler I am using the Task.Factory.StartNew to call a method. But now, i recognized that the method is called in a false order. I want to call the method in the right sequence. And it is mandatory to call this method asynchronously, because each method call takedifferent execution time.
Event Handler Snippet:
private void OpcClientInterface_ValueChangeEvent(object sender, OPCClient.OPCClient.strMonitoredItems e)
{
string sValue = String.Empty;
for (int i = 0; i < listOPCItemID.Count; i++)
{
if (listOPCItemID[i].Equals(e.sNodeID))
{
Task.Factory.StartNew(() => GetResult(e.oValue, e.sNodeID));
break;
}
}
}