9
jmpcn
label11
(jump if false)
mov
c0 m40.4
(reset second interlock bit)
label11:
(jump label)
Please note that when you have set the second interlock bit it is import that you
unconditionally jump over the reset instructions (at label10) to label11. The reason being that
at this point in time either m20.4 or m20.7 will be set true, from the last sending.
We also need to introduce a delay, on power up, of around 10secs. This gives the GSM
modem time to initialise, before we start to send SMS messages. A one shot 10 second delay
can created by the following B-Con instructions (assuming the scan time is set to 100msecs):
ld
m152.0
(load interlock)
jmpc l
abel4a
(jump if interlock is set)
ld
wm50
(any free marker word)
add
wc1
(increment by 1 each scan (100 msec))
st
wm50
(store counter)
ld
wm50
(load counter)
lt
wm100
(less then 100? 100 x scan (100msecs)
jmpc
label17
(jump if yes)
mov
c1 m152.0 (set interlock when counter > 100)
label4a:
Thus 10 seconds after power up the counter will reach 100 and the jump, over the SMS send
commands, will not be made. Likewise as the interlock is never reset, this jump will only ever
happen once, after power up.
Our complete B-CON task will thus be:
main:
mov
c0 bm2
(reset Command Register)
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)
Brodersen Controls A/S
●
Industrivej 3
●
DK-4000 Roskilde
●
Tel: +45 46 74 00 00
●
Fax: +45 46 75 73 36
E-mail: bc@brodersencontrols.com
●
Internet: www.brodersencontrols.com