Hi, I'm searching how to send an alarm wich doesn't need to be send each time (slow sequence). If an alarm send for one threshold don't need to be send again in the next loop, but if another one appear it had to be sent. One alarm can be resend 6H later. Don't know how to make that...
Sub Zero
BrHalf (ZDeplacement(),6,mV2500,1,Vx1,6,2500,True ,0,50,-26.31,0)
CallTable (UUUUU)
Delay (0,30,Sec)
EndSub
Sub SMSAlarm
For K=1 To 2 Step 1
SMS_Msg="Alarme, la centrale vous informe que le capteur " + FormatFloat(J,"%1.0f ")+ " sa course s'est deplace de :" "+FormatFloat(Fissure(J),"%5.2f")+"mm"
SerialOpen (SMSPORT,9600,3,10000,100)
SerialOut (SMSPORT,"AT+CMGS=" + CHR(34) + SMSphone(K) + CHR(34) + CHR(13),">",0,100)
SerialOut (SMSPORT,SMS_Msg,"",0,100)
SMSResult=SerialOut (SMSPORT,CHR(26),"+CMGS:",1,10000)
SerialFlush (SMSPORT)
SerialClose (SMSPORT)
Next K
EndSub
'Main prog
BeginProg
Call Zero
Scan(TempScrut,UnitScrut,1,0)
'ARG100 Pluviometre
PulseCount(Pluie_mm,1,1,2,0,0.2,0)
'6 Fissuro
BrHalf (Deplacement(),6,mV2500,1,Vx1,6,2500,True ,0,_50Hz,26.337,0)
For I=1 to 6 step 1
Fissure(I)=ABS(Deplacement(I)+ZDeplacement(I))
Next I
CallTable(TTTTTTT)
NextScan
SlowSequence
Scan(TempAlarm,UnitAlarm,0,0)
[do not re-send SMSAlarm with (J) parameter until 6H]
For J=1 To 6 Step 1
If =Fissure(J) > Sfissu(J) Then Call SMSAlarm
Next J
NextScan
EndProg
Best regards.
* Last updated by: CEBTP on 4/10/2013 @ 3:14 AM *
Suggest you use the timer instruction. Set it to start when you get an alarm and and don't let the alarm be sent again unless timer >= 360 minutes, then reset he timer and start over. I'd use minutes rather than hours for a little better resolution.