public static void Multiple_values() { UAEndpointDescriptor endpointDescriptor = "opc.tcp://10.92.116.208:4861"; // Instantiate the client object. var client = new EasyUAClient(); for (int i = 0; i < 20; i += 1) { // Obtain values. By default, the Value attributes of the nodes will be read. ValueResult[] valueResultArray = client.ReadMultipleValues(new[] { new UAReadArguments(endpointDescriptor, "ns=3;s=DB98_HEIZUNG_ISTWERTE_DR_EING_SEK_WT1_HEIZ"), new UAReadArguments(endpointDescriptor, "ns=3;s=DB98_HEIZUNG_ISTWERTE_TEMP_AUSG_SEK_WT1_HEIZ"), new UAReadArguments(endpointDescriptor, "ns=3;s=DB98_HEIZUNG_ISTWERTE_TEMP_EING_SEK_WT1_HEIZ"), new UAReadArguments(endpointDescriptor, "ns=3;s=DB99_KÜHLUNG_ISTWERTE_DR_EING_SEK_WT1_KUEHL"), new UAReadArguments(endpointDescriptor, "ns=3;s=DB99_KÜHLUNG_ISTWERTE_TEMP_AUSG_SEK_WT1_KUEHL"), new UAReadArguments(endpointDescriptor, "ns=3;s=DB99_KÜHLUNG_ISTWERTE_TEMP_EING_SEK_WT1_KUEHL"), new UAReadArguments(endpointDescriptor, "ns=3;s=DB98_HEIZUNG_ISTWERTE_DR_EING_SEK_WT2_HEIZ"), new UAReadArguments(endpointDescriptor, "ns=3;s=DB98_HEIZUNG_ISTWERTE_TEMP_AUSG_SEK_WT2_HEIZ") }); // Display results. foreach (ValueResult valueResult in valueResultArray) { if (valueResult.Succeeded) { Console.WriteLine($"Value: {valueResult.Value}"); using (StreamWriter sw = File.AppendText(OPC_Log)) { sw.WriteLine("value" + i.ToString()+" " + Convert.ToString(DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture))); } } else { Console.WriteLine($"*** Failure: {valueResult.ErrorMessageBrief}"); using (StreamWriter sw = File.AppendText(OPC_Log)) { sw.WriteLine("error" + " " + Convert.ToString(DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture))); } } } } }