access from tag script editor to control

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
mAcman
Posts: 5
Joined: Sun Feb 15, 2015 2:21 pm

access from tag script editor to control

Post 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 () ) ?

User avatar
Russ C.
Posts: 213
Joined: Thu Nov 16, 2017 3:32 pm
Contact:

Re: access from tag script editor to control

Post 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;
		}
Best regards,

Russ
(801) 708-6690
Technical Support
Contact Us

Beijer Electronics AB
http://www.beijerelectronics.us

Post Reply