Data trigger

Discussion of configuring and troubleshooting communication to PLC's or other devices using iX Developer.
Post Reply
antoineA
Posts: 20
Joined: Fri Dec 02, 2011 8:22 am

Data trigger

Post 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

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Data trigger

Post 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();
		}
    }
}
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

antoineA
Posts: 20
Joined: Fri Dec 02, 2011 8:22 am

Re: Data trigger

Post by antoineA »

Hi Mark Monroe!

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

AntoineA.

Post Reply