Internet PLC Forum
General => Technical support => Topic started by: kizor on April 18, 2009, 07:27:45 AM
-
HI
I have ceveral custom functions to send out a EMAIL with Xserver and that works great
Only one custom function to send out a mail at a certain time doesn't work properly
I always receive 2 email's in stead of 1
(if time[1]=23 and time[2]=59 and time[3]=58 then setio r1 else clrio r1 endif.)
So when r1 is closed the Email is send out but I always receive 2 emails
What could be the reason of this and how could I avoid this
Maybe there is a better way to send out a mail at a certain time.
Thanks in advance
Kizor
-
Is your r1 drive a differentiated version of custom function? i.e. {dCusF} and not the non-differentiated version {CusFn}. The latter will be executed multiple times as long as r1 is ON. Use the differentiated version if you only want the custom function to be executed just once when r1 turns from OFF to ON.
-
Hi
Yes I use a (dCusF ) like I use for other custom functions to send out a Email.
It is only there where I use a time to send a mail that I always receive 2 mails in stead of one
Could it be that the time between closed and open (r1) is to short or to long?
Greats
Kizor
-
If your PLC scan time is less than 1/2 second you will end up calling your email routine more than once as r1 would not be reset due to the time condition still being true.
I have done the same thing and have had to use a "flag" to indentify that the routine has run. Alternatively you can change the scan time or delay in the email routine if your application allows it.