Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Alias trend script + Alarm indicator
PostPosted: Tue Oct 30, 2018 11:59 pm 

Joined: Fri Jun 15, 2018 4:45 am
Posts: 3

Offline
Hi,

my knowledge of C# is very very weak and I assume that only solution to my problem is to program script in iX Developer (X2 Pro 12).

To be more precise, I have 2 questions/problems:

1. I have an alias screen with trend. I used software that I found on this forum ('AliasTrend') as a template for my program but in 'AliasTrend' there is no manipulation with 'TrendViewer.ValueScaleMinimum/Maximum' that I need to implement. To elaborate, I have several analog input tags with different MIN and MAX values. I tried to program something, as shown below, but based on my program I need to enter twice in alias screen to update min/max values (probably FOR loop executes only once when screen is opened). As I said, my knowledge of C# is very very weak.


Code:
    public partial class Screen2
    {
      
      void Screen2_Opened(System.Object sender, System.EventArgs e)
      {
         // Copies the Alias instance name to variable "CurrentAnalog" as well as to the Tag "CurrentInstance"
         string CurrentAnalog = this.InstanceName;
         Globals.Tags.CurrentInstance.Value = CurrentAnalog;
   
         // Clears all pens/curves from TrendViewer
         for (int i = 0; i < 3; i++)
         {
             TrendViewer.Curves[i].IsVisible = false;
         }
         
         // Enables the specific pens/curves for the alias instance and tag "InstanceNumber"
         if (CurrentAnalog == "PT_101")
         {
            TrendViewer.ValueScaleMinimum = this.min;
            TrendViewer.ValueScaleMaximum = this.max;
            TrendViewer.Curves[0].IsVisible = true;
            Globals.Tags.InstanceNumber.Value = 0;
         }
         else if (CurrentAnalog == "PT_102")
         {
            TrendViewer.ValueScaleMinimum = this.min;
            TrendViewer.ValueScaleMaximum = this.max;
            TrendViewer.Curves[1].IsVisible = true;
            Globals.Tags.InstanceNumber.Value = 1;
         }
         else if (CurrentAnalog == "TT_101")
         {
            TrendViewer.ValueScaleMinimum = this.min;
            TrendViewer.ValueScaleMaximum = this.max;
            TrendViewer.Curves[2].IsVisible = true;
            Globals.Tags.InstanceNumber.Value = 2;
         }
      }
    }
}


2. Second question is regarding the alarm indicator that pop-ups when alarm is active. Is it possible to make an alarm group that is not connected with a alarm indicator. I want to make EVENT list where event doesn't trigger alarm indicator when is active (for ALARM list, alarm indicator remains having its main function)

Thank you in advance for your assistance,

Best regards
Luka


 Profile  
 
 Post subject: Re: Alias trend script + Alarm indicator
PostPosted: Wed Nov 07, 2018 9:23 am 

Joined: Fri Jan 27, 2012 4:20 am
Posts: 172

Offline
It looks like , You want to show on TrendViewer three curves for several signals to choose by operator.
I did similar task differently.
1. In “Edit curves” set Curve1 (tag: Curve1Value), Curve2 (tag: Curve2Value) and Curve3 (tag: Curve3Value) with different colours assigned.
2. In “Trend Dynamics” set tags for Min, Max, span and TimeOffset.
3. Created screen “Selector” with button and 3 combo boxes, to assign signal to each curve. E.g. if the tag Curve1Parameter =1, curve 1 shows signal1 (Inlet Pressure), if Curve2Parameter =3, curve 2 shows signal3 (Temperature) and so on. Clicking button opens another screen with TrendViewer.
4. The 2 scripts were written. One for setting limits for curve 1 only depending which signal assigned, which run once when the TrendViewer screen is opened
5. Another script for refreshing which run every second which assigns Curve1Value=Pressure*Curve1Scale, Curve2Value=Temperature*Curve2Scale…
6. Scales are to be set by operator on the TrendViewer screen. Operator can choose up to 3 from many available.


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: