
6
mov
c0 m40.1
(reset the marker bit)
label4:
(jump label)
The above will set the marker bit high when the analogue input is greater than 2048 and
reset the marker when the analogue input is equal to or less than 2048. The marker bit will
be used for triggering the sending of the SMS message.
We now have the logic to decide when to send our SMS messages, the triggers being the
marker bits m40.0 and m40.1. Lets now use these bits to send the SMS messages.
We could use:
ld
m40.0
(load marker bit)
jmpcn
label5
(jump if false)
mov
bc0 bm3
(select telephone number 0)
mov
bc0 bm19
(select message number 0)
mov
bc3 bm2
(send SMS)
label5: (jump label)
This will send message 0 to telephone number 0, but it will also keep sending it as long as the
marker bit is high, effectively for as long as the two digital inputs are active. Hundreds of
messages could be sent! This is clearly not what we want. We only require one message to be
sent when both digital inputs go active, in other words to detect the leading edge.
This can be achieved by using an interlock bit, set at the same time as the Cammand Register
is set. The next time the instructions are executed the AND gate will not be true, the interlock
bit being true, but negated in the AND gate and the instructions sending the SMS message
will be jumped over. When the alarm has cleared the interlock bit will be reset:
ld
m40.0
(load marker bit)
andn
m40.2
(and the interlock bit negated)
jmpcn
label6
(jump if false)
mov
bc0 bm3
(select telephone number 0)
mov
bc0 bm19
(select message number 0)
mov
bc3 bm2
(send SMS)
mov
c1 m40.2
(set interlock bit)
jmp
label7
(jump)
label6:
(jump label)
ld
m40.0
(load marker bit)
jmpc
label7
(jump if true)
mov
c0 m40.2
(reset interlock bit)
label7:
(jump label)
ld
m40.1
(load marker bit)
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