public class ProjectWizardExtension : IProjectWizardExtension { #region IProjectWizardExtension implementation public void Run(IProject context, IBehavior behavior) { try { //############################################################################################### //Liste der Zähler Index, welche exportiert werden sollen, weitere Zähler bitte hier eintragen... List Index = new List(); //#0 Index.Add("140"); //#1 Index.Add("325"); //#2 Index.Add("120"); //############################################################################################### Scada.AddIn.Contracts.Function.IFunction obFctTrend; //RT Funktion welche bearbeitet wird obFctTrend = context.FunctionCollection["FU_Export_Report"]; for (int i = 0; i <= Index.Count - 1; i++) { //Ersetzen des Index der verknüpften Variablen in der Funktion auf den Index des aktuellen Zähler //obFctTrend.SetDynamicProperty("Filter[0].DataSet[0].Filter[0].VarInfo[0].Variable", .... } //RT Funktion in eigenem Thread ausführen Thread thread = new Thread(RunThread_1); thread.Start(context); } catch (Exception err) { context.ChronologicalEventList.AddEventEntry("Fehler: " + err.Message); } } #endregion private void RunThread_1(Object ob) { IProject context = (IProject)ob; try { Thread thread = new Thread(RunThread_2); thread.Start(context); Task.Delay(5000).Wait(); context.ChronologicalEventList.AddEventEntry("Sub Thread 1 Ende"); } catch (Exception err) { context.ChronologicalEventList.AddEventEntry("Fehler RunThread_1: " + err.Message); } } private void RunThread_2(Object ob) { IProject context = (IProject)ob; try { context.ChronologicalEventList.AddEventEntry("Sub Thread 2 Ende"); } catch (Exception err) { context.ChronologicalEventList.AddEventEntry("Fehler RunThread_2: " + err.Message); } } } }Ist die Lebenszeit des Sub Thread irgendwie begrenzt??? Ich habe mich mit dem Thema vorher noch nie beschäftigt, aber ich finde hier im Forum sehr wenig dazu, und was ich unter github: https://github.com/copa-data gefunden habe, habe ich verwendet um den Code zu erstellen. Vielleicht kann mir jemand die richtige Richtung zeigen.... Gruß Tobias
This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.
The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.
Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.
Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.
COPA-DATA reserves the right to change this document from time to time at own discretion.
Ing. Punzenberger COPA-DATA GmbH
Karolingerstraße 7b · 5020 Salzburg · Austria
www.copadata.com