Page 1 of 1

Time functions

Posted: Thu Oct 13, 2011 7:34 am
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

Re: Time functions

Posted: Wed Oct 19, 2011 10:36 am
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".

Re: Time functions

Posted: Sun Nov 13, 2011 9:11 am
by bastian_c
works perfekt
thx alot!

Re: Time functions

Posted: Thu Apr 18, 2013 8:35 am
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