Page 1 of 1

alarm server intialize

Posted: Wed Feb 27, 2013 11:03 am
by charlyprouteau
Hello,
I've developped an application on a TA150 with no text programmed in "normal"mode. I mean directly on the by alarm server.

The alarm texts are written in alarmserver scrip as :
Globals.AlarmServer.Alarm1.Text = "alarm 01";
But sometimes, at the application restart, alarm texts are empty.
How can I do to initialize my alarm server and to have always alarm texts programmed by my alarmserver scipt?

Re: alarm server intialize

Posted: Wed Feb 27, 2013 11:23 am
by mark.monroe
If you want to change the alarm text at runtime you need to call your code to set the alarm text when the unit first starts up. You can use the screen open event on your startup screen to do that.

Re: alarm server intialize

Posted: Thu Feb 28, 2013 2:43 am
by charlyprouteau
Yes but if the alarm is already triggered I can not modify the alarm text... Is a way to initialize alarmserver at startup?

Re: alarm server intialize

Posted: Thu Feb 28, 2013 8:56 am
by Edmund
Try set the texts from a scriptmodule and the created function.

Below is a scriptmodule called AlarmServerInitialize, when it´s created (at startup) it sets the alarmtext for alarm1.

Code: Select all

namespace Neo.ApplicationFramework.Generated
{
    using System.Windows.Forms;
    using System;
    using System.Drawing;
    using Neo.ApplicationFramework.Tools;
    using Neo.ApplicationFramework.Common.Graphics.Logic;
    using Neo.ApplicationFramework.Controls;
    using Neo.ApplicationFramework.Interfaces;
    
    
    public partial class AlarmServerInitialize
    {
		/// <summary>
		/// Constructor for AlarmServerInitialize
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		/// <returns></returns>
		void AlarmServerInitialize_Created(System.Object sender, System.EventArgs e)
		{
			Globals.AlarmServer.Default_Alarm1.Text = "Whatever";
		}
    }
}

NOTE!
The created function was not fired in previous version of iX (before 2.0), so if you put code in the created function i iX 1.3 nothing will happen.