Page 1 of 1

access from tag script editor to control

Posted: Sun Feb 15, 2015 2:28 pm
by mAcman
Hello,
I have question how to access to control data (for example: AnalogNumeric1.Value) from tag script editor (for example: from function void TagName_ValueChange () ) ?

Re: access from tag script editor to control

Posted: Fri Jan 24, 2020 1:52 pm
by Russ C.
There isn't a way to access screen objects such as analog numerics from other scripts.

You could access other public methods such as the Tags/Script modules from within the screen.

Or hook the TagName_ValueChange event to a function on the screen:

Code: Select all

}			
		void Screen2_Opened(System.Object sender, System.EventArgs e)
		{
			TagName_ValueChange += myTagName_ValueChanged;
		}

		void myTagName_ValueChanged(System.Object sender, Core.Api.DataSource.ValueChangedEventArgs e)
		{
			MessageBox.Show(AnalogNumeric.Value);
			
		}

		void Screen2_Closed(System.Object sender, System.EventArgs e)
		{
			TagName_ValueChange -= myTagName_ValueChanged;
		}