Timer events

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
monk duck1
Posts: 1
Joined: Wed Nov 11, 2015 5:45 am

Timer events

Post by monk duck1 »

Hi, I want to get more familiar with the C# scripting, so I'm doing little test:

I have an timer, and I'd like to update tag value (called Led) to tag value (called Button) every time timer ticks.

My timer is exactly like this example:
Board index » iX Developer FAQ » Scripting FAQ » How to create periodic Timers in iX Developer.

Timer works okey, and tags are changed well if I do it like this:

Code: Select all

		private static void TimeOut1(Object myObject, EventArgs myEventArgs) 
		{         	
			Globals.Tags.Tag1.Value = Globals.Tags.Tag1.Value + 1;
			Globals.Tags.Led.Value = Globals.Tags.Button.Value;
		}      
Now if I want to update an value inside Screen1 script every 1000ms (as timer1) what I need to do? How I call timer there, if timer is made in its own script?

User avatar
Jae V
Posts: 118
Joined: Wed Jan 15, 2020 11:00 am

Re: Timer events

Post by Jae V »

Hello,
We understand that this is a very old post. But for your example, you should be able to move the timer script to the screen script. Another option can be to trigger a tag every rising and falling edge of the timer, and to do a action on the value change on the screen. Alternatives would be to use the SystemSecondTag and attach you value change to it so you don't need to make a timer. If there is anyone who require assistance with something similar, please visit us at https://www.beijerelectronics.us/en-US/ ... ___support or give us call at 801.708.6690. Thank you.
Best regards,
Jason
(801) 708-6690
Technical Support
Contact Us



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

Post Reply