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 :
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?
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.
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();
}
}
}