Time functions

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
bastian_c
Posts: 5
Joined: Sat Oct 01, 2011 2:23 pm

Time functions

Post by bastian_c »

Hello,
My situation is the following.
I have an Beijer Touchpanel with a visualisation configured with the ix developer.
My PLC is a Wago to which I communicate via Modbus TCP.
I need to know on my PLC if the touchpanel is still alive or not.
In most cases this is not time sensitive for example it is ok for me to get an alarm after 90seconds.
So I made a funktion with the scheduler that every minute a bool tag is set and reset and these changes are transfered to the plc.
In the PLC I check for a bit change and if this change doesnt occur in 90 seconds, I know that the touchpanel is not running any more.
Now I have the situation that i need to recognize immediately (max 5 seconds) that if the touchpanel isnt working any longer.
Is there a way to create a script that changes a boolean bit every second because with the scheduler the shortest interval is one minute.

Greetings from germany

Bastian

User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: Time functions

Post by Ron L. »

Using code from the attached example workspace, you can modify the Timout1 function like this.

Code: Select all

private static void TimeOut1(Object myObject, EventArgs myEventArgs) 
		{	
			if (Globals.Tags.Tag1.Value.Int == 0) {
				Globals.Tags.Tag1.Value = 1;
			}
			else {
				Globals.Tags.Tag1.Value = 0;
			}
		}
You may need to change the tags (Tag1) settings to be "Always Active".
Attachments
SimpleFormTimer.zip
(30.56 KiB) Downloaded 870 times
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

bastian_c
Posts: 5
Joined: Sat Oct 01, 2011 2:23 pm

Re: Time functions

Post by bastian_c »

works perfekt
thx alot!

Jan.Eckert
Posts: 7
Joined: Wed Mar 27, 2013 1:55 pm

Re: Time functions

Post by Jan.Eckert »

Ron L. wrote:Using code from the attached example workspace, you can modify the Timout1 function like this.

Code: Select all

private static void TimeOut1(Object myObject, EventArgs myEventArgs) 
		{	
			if (Globals.Tags.Tag1.Value.Int == 0) {
				Globals.Tags.Tag1.Value = 1;
			}
			else {
				Globals.Tags.Tag1.Value = 0;
			}
		}
You may need to change the tags (Tag1) settings to be "Always Active".
Sorry my question didn't come through.
I am wondering where within an iX project would you place a function like TimeOut1 as described above to be executed repeatedly ?

Thanks
Jan

Post Reply