Author Topic: SEND EMAIL WITH XSERVER  (Read 11722 times)

kizor

  • Newbie
  • Posts: 15
    • View Profile
SEND EMAIL WITH XSERVER
« 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

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:SEND EMAIL WITH XSERVER
« Reply #1 on: April 18, 2009, 12:24:55 PM »
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.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

kizor

  • Newbie
  • Posts: 15
    • View Profile
Re:SEND EMAIL WITH XSERVER
« Reply #2 on: April 18, 2009, 01:03:18 PM »
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

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:SEND EMAIL WITH XSERVER
« Reply #3 on: April 19, 2009, 12:45:27 PM »
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.