Forum



Anmelden, FAQ, Suche, Mitglieder, Gruppen, Registrieren, Persönlicher Bereich



Ein neues Thema erstellen Auf das Thema antworten  [ 17 Beiträge ]  Gehe zu Seite Vorherige  1, 2
Autor Nachricht
BeitragVerfasst: Do Jun 26, 2014 8:32 pm 
Offline

Registriert: Di Feb 14, 2006 8:05 pm
Beiträge: 15
Hello DIE HARD
Thank you for answer.
You are quite right, with modems. Usual it so look like, but sometime Surprise... :)
Into instruction for MC35i_ATC_V02.00n (page 37) I found the following text:
________________________________________________________
EXAMPLE 2
To set the ME to NON-CYCLIC SLEEP mode enter
AT+CFUN=0
OK
When, for example, an SMS is being received and indicated by an unsolicited result code (URC), the ME wakes up to full operation.
+CMTI: "SM",5
Note that the URC used in this example will appear only, if AT+CNMI=1,1 was configured before.
_______________________________________________________
I checked it. It was only gsm-modem and laptop with Hyper terminal.
I have sent 3 SMS (one by one) and on the Hyper terminal was 3 messages without additional request:
+CMTI: "ME",3
+CMTI: "ME",4
+CMTI: "ME",5
Realy it work so. The Internal memory (ME) is not so big, only for 25 sms and need delete SMS every time after reading.

My main problem is command - IF RXD THEN GOSUB "read sms" – it run nonstop cycle and "bad performs any other commands of main code". Only in case of cable disconnection I can stop the cycle.
And for my understanding, I asked you about IF RXD THEN - how it look like? May be something wrong into my code or cable?
Now I think need set to up a additional function on the gsm-modem (like total deactivation of RS232-interface) time to time.
May be have you other ideas?
Thank you

Code:
' THE MAIN CODE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' =====================================================================================
#xxx
#loop
  if y = 1 then goto label30
  if (day = 1) and (hour = 0) and (minute = 0) then goto label1    ' one time in month
  if (dow = 0) and (hour = 0) and (minute = 0) then gosub synchron ' free of charge time-synchronization
  if         (hour MOD 3 = 0) and (minute = 0) then gosub filter   ' check-read-delete SMS
  if w = ON then goto label30                                      ' was a problem with pump(flag YES/NO)?
  if (e>Tmax) and (hour =  7) and (minute = 0) then gosub water
  if              (hour =  8) and (minute = 0) then e = 0
  if              (hour = 17) and (minute = 0) then gosub water
  if j > 0 then gosub gsm ' the report request SMS(*9=05) or in case of problem with pump

#label30
  if x = ON then goto label40
  if (minute MOD p) > 0 then goto label40 ' if at division on 3 returns the rest, then...
' Measurement of temperatures
  gosub weather ' Wind power, Sun power, Difference T and Gradient T
  if q = ON then goto label40              ' was a problem with motor(flag YES/NO)?
  if T_inside >= Tmax then gosub motorup   ' T higher than 30C
  if T_inside <= Tmin then gosub motordown ' T lower  than 20C
  m = T_inside  ' buffer of temporary storage of internal temperature
  n = T_outside ' buffer of temporary storage of external temperature
  if j > 0 then gosub gsm ' in case of problem with actuator

#label40
' Interval between measurements of temperatures is p minutes (any interval p >= 2)
  if (minute > 58)            then y = 0
  if (minute MOD (p + 1)) = 0 then x = OFF
  e = max(T_inside,m)
  IF RXD THEN GOSUB filter ' EVERY TIME GOSUB TO SUBPROGRAM

' Heating or Ventilation
  if T_inside < Tmin     then Heater = ON
  if T_inside > (Tmin+2) then Heater = OFF     ' Heater
  if T_inside < Tmin     then LED4 = ON
  if T_inside > (Tmin+2) then LED4 = OFF       ' Heater Indication
  if T_inside > Tmax     then Ventilator = ON
  if T_inside < (Tmax-2) then Ventilator = OFF ' Ventilator

' Management keys: F1,F2,F3,F4
  if not F1 then gosub water  ' F1 - manual watering within t seconds
  if not F2 then gosub up     ' F2 - manual open window
  if not F3 then gosub down   ' F3 - manual close window
  if not F4 then gosub filter ' F4 - manual check-read-delete SMS

' Accu voltage control =12V
  if U12 < 110 then j = 1        ' the accu is empty
  if j > 0 then gosub gsm ' the report request with SMS(*9=05) or in case of problem with equipment

' Sunlight control and ON/OFF additional light
  if hour  <  6 then goto label50 ' before 6 Light OFF
  if hour => 19 then goto label50 ' after 19 Light OFF
  if Sun  > 120 then goto label50 ' the Sun power control and
  if Sun  <  80 then Lamp = 1     ' ON/OFF the additional Light
  goto loop

#label50
  Lamp = 0
  goto loop

' The END of main code ----------------------------------------------------------------
' =====================================================================================


Nach oben
 Profil  
 
BeitragVerfasst: Sa Jun 28, 2014 12:12 am 
Offline

Registriert: Do Mär 17, 2005 12:33 pm
Beiträge: 2066
Paul1 hat geschrieben:
Hello DIE HARD
Thank you for answer.
You are quite right, with modems. Usual it so look like, but sometime Surprise... :)
Into instruction for MC35i_ATC_V02.00n (page 37) I found the following text:
________________________________________________________
EXAMPLE 2
To set the ME to NON-CYCLIC SLEEP mode enter
AT+CFUN=0
OK
When, for example, an SMS is being received and indicated by an unsolicited result code (URC), the ME wakes up to full operation.
+CMTI: "SM",5
Note that the URC used in this example will appear only, if AT+CNMI=1,1 was configured before.
_______________________________________________________
I checked it. It was only gsm-modem and laptop with Hyper terminal.
I have sent 3 SMS (one by one) and on the Hyper terminal was 3 messages without additional request:
+CMTI: "ME",3
+CMTI: "ME",4
+CMTI: "ME",5
Realy it work so. The Internal memory (ME) is not so big, only for 25 sms and need delete SMS every time after reading.

My main problem is command - IF RXD THEN GOSUB "read sms" – it run nonstop cycle and "bad performs any other commands of main code". Only in case of cable disconnection I can stop the cycle.
And for my understanding, I asked you about IF RXD THEN - how it look like? May be something wrong into my code or cable?
Now I think need set to up a additional function on the gsm-modem (like total deactivation of RS232-interface) time to time.
May be have you other ideas?
Thank you

Code:
' THE MAIN CODE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' =====================================================================================
#xxx
#loop
  if y = 1 then goto label30
  if (day = 1) and (hour = 0) and (minute = 0) then goto label1    ' one time in month
  if (dow = 0) and (hour = 0) and (minute = 0) then gosub synchron ' free of charge time-synchronization
  if         (hour MOD 3 = 0) and (minute = 0) then gosub filter   ' check-read-delete SMS
  if w = ON then goto label30                                      ' was a problem with pump(flag YES/NO)?
  if (e>Tmax) and (hour =  7) and (minute = 0) then gosub water
  if              (hour =  8) and (minute = 0) then e = 0
  if              (hour = 17) and (minute = 0) then gosub water
  if j > 0 then gosub gsm ' the report request SMS(*9=05) or in case of problem with pump

#label30
  if x = ON then goto label40
  if (minute MOD p) > 0 then goto label40 ' if at division on 3 returns the rest, then...
' Measurement of temperatures
  gosub weather ' Wind power, Sun power, Difference T and Gradient T
  if q = ON then goto label40              ' was a problem with motor(flag YES/NO)?
  if T_inside >= Tmax then gosub motorup   ' T higher than 30C
  if T_inside <= Tmin then gosub motordown ' T lower  than 20C
  m = T_inside  ' buffer of temporary storage of internal temperature
  n = T_outside ' buffer of temporary storage of external temperature
  if j > 0 then gosub gsm ' in case of problem with actuator

#label40
' Interval between measurements of temperatures is p minutes (any interval p >= 2)
  if (minute > 58)            then y = 0
  if (minute MOD (p + 1)) = 0 then x = OFF
  e = max(T_inside,m)
  IF RXD THEN GOSUB filter ' EVERY TIME GOSUB TO SUBPROGRAM

' Heating or Ventilation
  if T_inside < Tmin     then Heater = ON
  if T_inside > (Tmin+2) then Heater = OFF     ' Heater
  if T_inside < Tmin     then LED4 = ON
  if T_inside > (Tmin+2) then LED4 = OFF       ' Heater Indication
  if T_inside > Tmax     then Ventilator = ON
  if T_inside < (Tmax-2) then Ventilator = OFF ' Ventilator

' Management keys: F1,F2,F3,F4
  if not F1 then gosub water  ' F1 - manual watering within t seconds
  if not F2 then gosub up     ' F2 - manual open window
  if not F3 then gosub down   ' F3 - manual close window
  if not F4 then gosub filter ' F4 - manual check-read-delete SMS

' Accu voltage control =12V
  if U12 < 110 then j = 1        ' the accu is empty
  if j > 0 then gosub gsm ' the report request with SMS(*9=05) or in case of problem with equipment

' Sunlight control and ON/OFF additional light
  if hour  <  6 then goto label50 ' before 6 Light OFF
  if hour => 19 then goto label50 ' after 19 Light OFF
  if Sun  > 120 then goto label50 ' the Sun power control and
  if Sun  <  80 then Lamp = 1     ' ON/OFF the additional Light
  goto loop

#label50
  Lamp = 0
  goto loop

' The END of main code ----------------------------------------------------------------
' =====================================================================================



Well, what i can tell u about IF RXD THEN ....
When the modem issues a messge, RXD will be TRUE and that
will cause this request to jump to the "read sms" subroutine.
(RXD will become TRUE if an unread byte is in the 8 byte buffer,
RXD turns false after all bytes in this buffer were read. It is a FIFO. Reading one byte shifts the buffer and makes space for one more byte to receive and buffer. Overrun the buffer will drop all bytes after buffer is full)
So far so good. The old version has 8 byte serial buffer,
what means the full message is lost.
You only can use that IF RXD THEN... as a indicator that
the modem has issued a sms reveive message, and then
flush the buffer (read until it is empty, and RXD false)
and then retrieve the message or sms with a proper read command
sent to the modem. And then immediately compute and evaluate the
modem response in a time that is fast enough to make sure that the 8 byte buffer has no overrun during evaluation of each byte
while the modem continues to send the message.

well, i hope that details are helpful in some way.


Nach oben
 Profil  
 
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 17 Beiträge ]  Gehe zu Seite Vorherige  1, 2

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Sie dürfen keine neuen Themen in diesem Forum erstellen.
Sie dürfen keine Antworten zu Themen in diesem Forum erstellen.
Sie dürfen Ihre Beiträge in diesem Forum nicht ändern.
Sie dürfen Ihre Beiträge in diesem Forum nicht löschen.

Suche nach:
Gehe zu:  

Powered by phpBB © 2001, 2012 phpBB Group
Deutsche Übersetzung durch phpBB.de

© 2004 - 2012 tappertzhofen. Alle Reche vorbehalten.
Seitenanfang | Impressum