7
andn
m40.3
(and the interlock bit negated)
jmpcn
label8
(jump if false)
mov
bc1 bm3
(select telephone number 0)
mov
bc1 bm19
(select message number 0)
mov
bc3 bm2
(send SMS)
mov
c1 m40.3
(set interlock bit)
jmp
label9
(jump)
label8:
(jump label)
ld
m40.1
(load marker bit)
jmpc
label9
(jump if true)
mov
c0 m40.3
(reset interlock bit)
label9:
(jump label)
The above will fulfil our requirement, except for one problem.
Lets look at the situation when both alarms are generated almost together, both digital inputs
are activated and one second later the analogue input goes higher than 50%. The above
instructions will first send the digital alarm to the GSM modem and then almost immediately
send the analogue alarm. When the GSM modem receives the command to send the analogue
alarm it will not have yet send the digital alarm it received one second earlier. It just has not
had the time! What will happen is that the analogue alarm will overwrite the digital alarm and
the digital alarm will not be sent.
This is clearly not acceptable. Therefore within our B-CON task we must ensure that when one
message is sent, further messages are not sent to the GSM modem, until the modem
acknowledges the success or not of sending the first.
When the modem has finished sending an SMS message it will return one of two states into
marker bits m20.4 and m40.7 which can be explained thus:
m20.4 set true - The SMS message has been successfully sent. This means that the GSM
bearer service has accepted the message for onward transmission. It does guarantee that the
message has been received by the mobile phone concerned, the phone may be turned off!
m20.4 once set true will remain so until the next SMS message is sent, when it will be cleared
down.
m20.7 set true – The sending of the SMS message has failed, the message has not been sent.
This could be because the GSM cell is busy, down etc. Altogether 4 attempts will be made to
send the SMS message, with a 60 second delay between each attempt, after which m20.7 will
be set true. This bit could obviously be used to re-send the SMS message.
Let us then use these bits to ensure that messages are sent one after the other, without
loosing any messages.
We can do this by setting a second, common, interlock bit which when set will make a jump
over the send instructions until being reset when the SMS message has been sent or failed.
Brodersen Controls A/S
●
Industrivej 3
●
DK-4000 Roskilde
●
Tel: +45 46 74 00 00
●
Fax: +45 46 75 73 36
E-mail: [email protected]
●
Internet: www.brodersencontrols.com