background image

 

 

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 

Summary of Contents for RTU8

Page 1: ...tting Started Guide to SMS Funtionality V 1 00 Feb 2006 Doc 40030 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 w...

Page 2: ...lly give the correct commands to the modem manipulation of AT commands being unnecessary Up to 10 different text messages can be sent to up to 50 different telephone numbers Please note that when the...

Page 3: ...ephone Number Scroll down the config tab and double click on the SMS Tel no field A box will appear into which you can enter the telephone number See Fig 1 3 This is the number of the SMS message cent...

Page 4: ...command mov bc0 bm19 move a byte constant of 0 to byte marker 19 and for the second number in the list mov bc1 bm19 When to send the message needs to be decided by the logic within the B CON task and...

Page 5: ...ad 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 m4...

Page 6: ...is 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...

Page 7: ...dem 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 thu...

Page 8: ...abel7 jump label ld m40 1 load marker bit 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 sen...

Page 9: ...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 la...

Page 10: ...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 ld m40 4 load second interlock bit jmpc label10 jump if true...

Page 11: ...c0 m40 3 reset interlock bit label9 jump label label10 ld m20 4 load Message Sent bit or m20 7 or Message Failed bit jmpcn label11 jump if false mov c0 m40 4 reset second interlock bit label11 jump la...

Reviews: