Zugriff auf den Grenzwerttext einer Rema

Zugriff auf den Grenzwerttext einer Rema

Hallo, ich möchte in einer ProjectWizardExtension auf einen bestimmten Grenzwert einer Variablen zugreifen und diesen dann in eine andere kopieren. Soll heißen: In einer Integer-Variablen wird der Wert 15 reingeschrieben-> Der Grenzwerttext von Position 15 der Rema "soll in den String "Grenzwert" kopiert werden. Folgenden Code habe ich bis jetzt:
C# Code:
using System; using Scada.AddIn.Contracts; using Scada.AddIn.Contracts.Variable; using Scada.AddIn.Contracts.ReactionMatrix; namespace TransferStoertexte { /// /// Description of Project Wizard Extension. /// [AddInExtension("TransferStoertexte", "Kopiert den Grenzwerttext der Störung in eine Variable")] public class ProjectWizardExtension : IProjectWizardExtension { #region IProjectWizardExtension implementation public void Run(IProject context, IBehavior behavior) { // enter your code which should be executed on triggering the function "Execute Project Wizard Extension" in the SCADA Runtime string zzstrTest; IVariable myVar = context.VariableCollection["zziAWIndex"]; // Position in Rema IVariable myVar2 = context.VariableCollection["zzstrTest"]; // Grenzwerttext aus Remaposition IReactionMatrixCollection zenonRemas = context.ReactionMatrixCollection; // Sammel alle zenon Remas IReactionMatrix zenonRema = zenonRemas["Gesamt_Stoer_Z1"]; // Wähle Rema "Gesamt_Stoer_Z1" aus int Stoernummer;// Stoernummer = (int)myVar.GetValue(0); //Zuweisung: Wert aus myVar -> Stoernummer //store reference of Condition ICondition remaCondition = zenonRema[Stoernummer]; // Position gemäß Variable "Stoernummer" zzstrTest = remaCondition.LimitValueText; myVar2 = zzstrTest; //Hier stimmt irgendwas nicht } #endregion } }


This is a migrated post! Originally posted on 02.04.2020 by user wenzm. Please be aware that information can be outdated.

    Disclaimer

    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