Dear admin,
Im using DT80M for my project, using functions:
- modbus TCP master to poll two sensors
- web server dex for remote access and retrieve data
- serial sensor port for Request-Response SMS.
After reading manuals, help, forum, i wrote code for SMS, it's OK, modbus poll OK, Dex still access however very slow than before,
i don't know reason is my code or hardware not process fast enough. here my code:
BEGIN"ABC"
10$="+84988287168"
11$="+84983650852"
1..10CV=-1
20CV("A_Level")
21CV("B_Level")
RB10S
'convert time to send via serial port
T(=1CV)
3CV(W)=1CV%60
4CV(W)=(1CV/60)%60
5CV(W)=(1CV/3600)%24
'check sms pattern 1SERIAL("{AT+CMGF=1\013}\w[500]") 1SERIAL("\e{AT+CMGL=\034REC UNREAD\034\013}") 1SERIAL("{AT+CMGD=0,4\013}") 1SERIAL("\m[+CMGL: ]\m[\034REC UNREAD\034,\034]%12s['+84988287168','+84983650852',6CV=2]\m[\034,,\034]%*21s\013\010%3d[7CV]") IF(6CV<2)AND IF(7CV==123){1SERIAL("{AT+CMGF=1\013}\w[500]{AT+CMGS=\034}") 4MODBUS(AD"192.168.1.100",R4:01,=8CV) 4MODBUS(AD"192.168.1.101",R4:01,=9CV)} IF(6CV==0)AND IF(7CV==123){1SERIAL("{%s[10$]\034\013}\m[\062]{Upstream\032Level=%d[8CV]cm\059Downstream\032Level=%d[9CV]cm at %2d[5CV]:%2d[4CV]:%2d[3CV]\026\013}\m[CMGS]\e}") 6CV=-1 7CV=-1 } IF(6CV==1)AND IF(7CV==123){1SERIAL("{%s[11$]\034\013}\m[\062]{Upstream\032Level=%d[8CV]cm\059Downstream\032Level=%d[9CV]cm at %2d[5CV]:%2d[4CV]:%2d[3CV]\026\013}\m[CMGS]\e}") 6CV=-1 7CV=-1 } 'logging modbus data RD"WaterLevel"("b:",ALARMS:OV:100KB:W60,DATA:OV:1MB)30s 4MODBUS(AD"192.168.1.100",R4:01,"A_Level(cm)") 4MODBUS(AD"192.168.1.101",R4:01,"B_Level(cm)")
LOGOND
END
Please help me for this problem or advice if not handling.
Thanks advance.
VungGV
Dear admin,
Im using DT80M for my project, using functions:
- modbus TCP master to poll two sensors
- web server dex for remote access and retrieve data
- serial sensor port for Request-Response SMS.
After reading manuals, help, forum, i wrote code for SMS, it's OK, modbus poll OK, Dex still access however very slow than before,
i don't know reason is my code or hardware not process fast enough. here my code:
BEGIN"ABC"
10$="+84988287168"
11$="+84983650852"
1..10CV=-1
20CV("A_Level")
21CV("B_Level")
RB10S
'convert time to send via serial port
T(=1CV)
3CV(W)=1CV%60
4CV(W)=(1CV/60)%60
5CV(W)=(1CV/3600)%24
'check sms pattern
1SERIAL("{AT+CMGF=1\013}\w[500]")
1SERIAL("\e{AT+CMGL=\034REC UNREAD\034\013}")
1SERIAL("{AT+CMGD=0,4\013}")
1SERIAL("\m[+CMGL: ]\m[\034REC UNREAD\034,\034]%12s['+84988287168','+84983650852',6CV=2]\m[\034,,\034]%*21s\013\010%3d[7CV]")
IF(6CV<2)AND IF(7CV==123){1SERIAL("{AT+CMGF=1\013}\w[500]{AT+CMGS=\034}") 4MODBUS(AD"192.168.1.100",R4:01,=8CV) 4MODBUS(AD"192.168.1.101",R4:01,=9CV)}
IF(6CV==0)AND IF(7CV==123){1SERIAL("{%s[10$]\034\013}\m[\062]{Upstream\032Level=%d[8CV]cm\059Downstream\032Level=%d[9CV]cm at %2d[5CV]:%2d[4CV]:%2d[3CV]\026\013}\m[CMGS]\e}") 6CV=-1 7CV=-1 }
IF(6CV==1)AND IF(7CV==123){1SERIAL("{%s[11$]\034\013}\m[\062]{Upstream\032Level=%d[8CV]cm\059Downstream\032Level=%d[9CV]cm at %2d[5CV]:%2d[4CV]:%2d[3CV]\026\013}\m[CMGS]\e}") 6CV=-1 7CV=-1 }
'logging modbus data
RD"WaterLevel"("b:",ALARMS:OV:100KB:W60,DATA:OV:1MB)30s
4MODBUS(AD"192.168.1.100",R4:01,"A_Level(cm)")
4MODBUS(AD"192.168.1.101",R4:01,"B_Level(cm)")
LOGOND
END
Please help me for this problem or advice if not handling.
Thanks advance.
VungGV