Ewon TechForum
Providing technical solutions to technical requests


Status query and Reset by SMS (Flexy 201)
musfiq Offline
Junior Member
#1
Hi All,

Just to share with you guys. The following script for resetting, tag status query and controlling digital output via SMS works. Can try if want to do so.

ONSMS "Goto Program"
Program:
a% = Getsys Prg,"SmsRead"
If (a%<>0) Then
   a$ = Getsys Prg,"smsfrom"
   b$ = Getsys Prg,"smsmsg"
   c$ = "Reset"
   d$ = "1"
   e$ = "0"
   If (b$ = c$) Then 
   Goto Reset
   Endif
   If (b$ = d$) Then
   Endif
   Goto Control24V
   If (b$ = e$) Then
   Goto Control24V
   Else 
   Goto Alarm
   Endif
Reset:
   n$ = a$+",gsm,0"
   Setsys Prg,"MDMRST",1
   p$ = "Modem Reset Done"
   Sendsms n$, p$
Control24V:
   n$ = a$+",gsm,0"
   If (b$ = d$) Then
   DigitalOutput@ = Val (d$)
   SETIO "DigitalOutput", Val (d$)
   q$ = "Digital Output Value: " +d$
   Sendsms n$, q$
   Endif
   If (b$ = e$) Then
   DigitalOutput@ = Val (e$)
   SETIO "DigitalOutput", Val (e$)
   r$ = "Digital Output Value: " +e$
   Sendsms n$, r$
   Endif
Alarm:
   b% = Alstat b$
   n$ = a$+",gsm,0"
   If (b% = 0) Then
   i$ = "No Alarm for this tag"
   Sendsms n$,i$
   Endif
   If (b% = 1) Then
   j$ = "No Active Alarm"
   Sendsms n$,j$
   Endif
   If (b% = 2) Then
   k$ = "In Alarm"
   Sendsms n$,k$
   Endif
   If (b% = 3) Then
   l$ = "In Alarm but Acknoledged"
   Sendsms n$,l$
   Endif
   If (b% = 4) Then
   m$ = "Return to Normal but not Acknoledged"
   Sendsms n$,m$
   Endif
Endif
End

Thanks Mr. Simon for his help in this regard

Regards

Musfiq
Reply



Possibly Related Threads…
16-06-2020, 03:03 PM
Last Post: simon
15-06-2020, 01:51 PM
Last Post: simon
28-04-2020, 09:42 PM
Last Post: JeroenM
  Flexy and Microsoft Power BI Started by simon
19 Replies - 10.401 Views
10-12-2019, 11:25 AM
Last Post: simon
09-09-2019, 01:43 PM
Last Post: simon
03-09-2019, 02:08 PM
Last Post: simon
  Flexy SMS Alert Started by domash
11 Replies - 3.138 Views
22-08-2019, 12:10 PM
Last Post: simon
  MQTT eWon Flexy 205 Started by RFreist
3 Replies - 1.994 Views
18-07-2019, 12:30 PM
Last Post: simon
20-05-2019, 03:36 PM
Last Post: simon
03-05-2019, 10:38 AM
Last Post: simon



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy