5
Thus to send an SMS message we need only to use three lines of B-CON instructions:
mov bc0 bm3
mov bc0 bm19
mov bc3 bm2
However, in practice we need to do a bit more than this, we have to decide when to send a
message and also control the sending of multiple messages. Let’s make a simple task.
Example
Assume we have a simple requirement. We have two digital inputs, 0 and 1, and one
analogue input, 0. If both digital inputs are activated we need to send message 0 to
telephone number 0 and if the analogue input goes higher than 50% (the analogue input has
a twelve bit resolution, 4095, therefore 50% is 2048) we need to send message 1 to
telephone number 1.
Our control logic for monitoring the digital inputs will be:
ld
i0.0
(load input 0)
and
i0.1
(and input 1)
jmpcn
label1
(jump if false)
mov
c1 m40.0
(set a marker bit(chosen at random))
label1:
(jump label)
ld
i0.0
(load input 0)
and
i0.1
(and input 1)
jmpc
label2
(jump if true)
mov
c0 m40.0
(reset the marker bit)
label2:
(jump label)
The above will set the marker bit true when both digital inputs are active and reset the
marker bit false when either digital input is not active. The marker bit will be used for
triggering the sending of the SMS message.
Our control logic for monitoring the analogue input will be:
ld
wi2000
(load analogue input 0)
gt
wc2048
(greater than 2048?)
jmpcn
label3
(jump if false)
mov
c1 m40.1
(set a marker bit(chosen at random))
label3:
(jump label)
ld
wi2000
(load analogue input 0)
gt
wc2048
(greater than 2048?)
jmpc
label4
(jump if true)
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