Alias trend script + Alarm indicator

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
Lukas0204
Posts: 7
Joined: Fri Jun 15, 2018 4:45 am

Alias trend script + Alarm indicator

Post by Lukas0204 »

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: Select all

    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

wlederer
Posts: 175
Joined: Fri Jan 27, 2012 4:20 am

Re: Alias trend script + Alarm indicator

Post by wlederer »

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.

Post Reply