Page 1 of 1

Data trigger

Posted: Thu Oct 11, 2012 1:37 am
by antoineA
Hi everybody,

I have a panel with lot of string arrays which i would read only when screen is opened. In order to do that, i have tried to set a data trigger called "DataTrigger1" mapped to an internal tag called "trigg_name". Also, I have set the "When?" column of data exchange to DataTrigger1 for all concerned string array. I have seen in the reference manual that when the trigger tag changed to a value other than 0, triggers data exchange. So i have added in the Opened section of the concerned screen this code :

Code: Select all

	
Globals.Tags.trigg_name.Value = 1;
Globals.Tags.mesure_instant_ch.Value = get_sensor_name(Globals.Tags.MEASURE_CFG_TRIGG_CH.Value);
Globals.Tags.mesure_instant_din.Value = get_din_name(Globals.Tags.MEASURE_CFG_TRIGG_DIN.Value);
Globals.Tags.mesure_instant_mes.Value = get_measure_name(Globals.Tags.MEASURE_CFG_TRIGG_MEAS.Value);
Globals.Tags.trigg_name.Value = 0;
But despite of trigger tag value (0 at the end of "Opened" code), all string arrays are polled. Is it a bad using of data trigger? Is there a way to control when tags are polled to the controller?

Thanks a lot,

AntoineA

Re: Data trigger

Posted: Thu Oct 11, 2012 8:08 am
by mark.monroe
The data exchange is used to exchange data between two different controllers. It is not used to exchange data between the HMI and a controller. That is handled automatically if the tag is used on a screen.

In your case, I would use the open screen event and then put your code in it. You can call the Read method on a Tag and that will force the HMI to read the data from the controller.

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 Screen1
    {
		
		void Screen1_Opened(System.Object sender, System.EventArgs e)
		{
			Globals.Tags.Tag1.Read();
		}
    }
}

Re: Data trigger

Posted: Fri Oct 12, 2012 2:58 am
by antoineA
Hi Mark Monroe!

Thank you for your reply!! It works fine!!

AntoineA.