Hi Mik
I use the code below to access data from server.
The server returns error message
Incorrect format of data received from the server: incorrect transaction ID
static void GetCurrentDataConcurrency()
{
CnlData[] cnlData;
for (int i = 0; i < 1000; i++)
{
Task.Run(() =>
{
if (cnlListID > 0)
{
Console.WriteLine("Request data of the list with ID = " + cnlListID);
cnlData = client.GetCurrentData(ref cnlListID);
}
else
{
Console.Write("Enter channel number: ");
int[] cnlNums = new int[] { 101,102 };
cnlData = client.GetCurrentData(cnlNums, true, out cnlListID);
}
if (cnlData == null)
Console.WriteLine("Error: null received");
if (cnlData.Length > 0)
Console.WriteLine("Channel data = " + cnlData[0].Val + " (" + cnlData[0].Stat + ")");
else
Console.WriteLine("No data");
Console.WriteLine("Channel list ID = " + cnlListID);
});
Thread.Sleep(10);
}
}
-
This topic was modified 1 year, 2 months ago by Mikhail.