![FATEK FBs-CMGSM Скачать руководство пользователя страница 2](http://html.mh-extra.com/html/fatek/fbs-cmgsm/fbs-cmgsm_user-manual_546542002.webp)
140903 FBs-CMGSM User's Manual EN v3-04
Page #
2 of 7
3.4.1
IO Connector
IO connector has 6 terminals. Terminals “+” “-” are intended for service purposes
only - for test of an internal accumulator. Terminals IN (“IN1”) are for digital input.
Terminals OUT (“DOUT2”) are for digital output.
8 to 30
V
DC
*)
OUTPUT (e.g.relay)
CMGSM
IN
OUT
4V
50 Ohm
GSM-PWR12
or
GSM-PWR1
GSM-RELE-OUT1
3k9
1k
MAX *)
35V
AC
/70mA
50 V
DC
/100mA
TEST
ACC.
INPUT
(e.g. button or mg. contact)
*) Please, see the technical
specifications for details
+
-
4.
Function of the device
4.1
SMS
One of the primary functions of the
CMGSM
is to send and receive SMS messages.
There are 2 kinds of SMS, which have different functions and purposes:
SMS for and from PLC FATEK, see chapters 4.1.1. and 4.1.2
Service SMS commands processed by CMGSM, see chapter 4.3
Outgoing SMS from PLC FATEK are sent by PLC program, that writes the text and
destination phone number into PLC registers and orders CMGSM to send the
message by write special value to another register (
SendFlag
). CMGSM sends SMS
and writes result of the sending to PLC register (
SendFlag
). Incoming messages for
PLC FATEK are received by CMGSM and the text and origin phone number are
written into PLC registers. Subsequently in another register (
RecvFlag
) is written
value, that signalizes new received SMS. PLC program analyzes the registers and
deactivates flag
RecvFlag
. All the SMS structure and security features must be done
by PLC program, including confirmation, that SMS was received, if required.
SMS messages, which contains characters “#!” (hash and exclamation) followed by
access code, are sent and received by CMGSM itself and their function, structure
and security features cannot be changed by user or PLC program. Incoming SMS of
this kind are described in chapter 4.3
Service SMS Commands
and are used to get
information about CMGSM status, to reset CMGSM or to get current CMGSM
configuration. Outgoing SMS of this kind are described in chapter 4.5
Events
. Events,
it is information about emergency status of CMGSM module like lost communication
with PLC. These events are sent to a predefined phone number (
Master
in
configuration).
4.1.1
Sending a SMS
CMGSM periodically tests the first register of the
Send Record
, standard base is
D3800. The
Send Record
is an area in PLC registers which must be filled by program
in PLC in order to send a SMS message. For structure of the record see the following
table.
Registers
Caption
Description
D3800
SendFlag
0x0000
– Idle
0x0001
– Command to send (written by
program in PLC)
0x0003
– SMS is sending (written by
CMGSM)
0x0000
– SMS sent successfully (written
by CMGSM)
0x0004
– Failed while sending SMS
(written by CMGSM)
D3810-D3819
SendDestAddress
Phone number where to send the
message. Length 20 characters.
D3820-D3899
SendUserData
Text of the message. Length 160
characters.
This range of registers cannot be used for any other purposes!
How does the CMGSM send a message:
START
? D3800
WAIT 5s
WRITE
0x0003
INTO D3800
0x0001
ELSE
READ
D3810-D3819
Phone number
READ
D3820-D3899
Text
SENDING
? RESULT
WRITE
0x0000
INTO D3800
WRITE
0x0004
INTO D3800
OK
ERROR
Every register of
Phone number
or
Text
contains two characters. String of
characters ends with special character 0x00. Examples:
String with one character – “A”: D3820 = 0x0041
String “TEXT”: D3820 = 0x4554, D3821 = 0x5458, D3822 = 0x0000
String “HELLO”: D3820 = 0x4548, D3821 = 0x4C4C, D3822 = 0x004F
If the length of a phone number is exactly 20 characters (or 160 characters of text)
then the character 0x00 at the end is omitted!
Base of
Send Record
(D3800) may be changed to another D or R register via
configuration key REGSEND. Only register
SendFlag
(D3800) is changed during
sending a message.
Example of sending a message “WE ARE THE CHAMPIONS!” to phone “123465”:
(Check register D3800 – SendFlag for value 0x0000 before sending the message!)
Register
Value
Description
D3810
0x3231
SendDestAddress, characters “1” and “2”
D3811
0x3433
SendDestAddress, characters “3” and “4”
D3812
0x3635
SendDestAddress, characters “5” and “6”
D3813
0x00
00
End of string
D3820
0x4557
SendUserData, characters “W” and “E”
D3821
0x4120
SendUserData, characters “ ” (space) and “A”
D3822
0x4552
SendUserData, characters “R” and “E”
D3823
0x5420
SendUserData, characters “ ” (space) and “T”
D3824
0x4548
SendUserData, characters “H” and “E”
D3825
0x4320
SendUserData, characters “ ” (space) and “C”
D3826
0x4148
SendUserData, characters “H” and “A”
D3827
0x504D
SendUserData, characters “M” and “P”
D3828
0x4F49
SendUserData, characters “I” and “O”
D3829
0x534E
SendUserData, characters “N” and “S”
D382A
0x
00
21
SendUserData, characters “!” and end of string
D3800
0x0001
SendFlag: send command
4.1.2
Receiving a SMS
Incoming SMS messages are saved into registers of PLC in
Recv Record
, standard
base D3700. Structure of the record is in following table.
Registers
Caption
Description
D3700
RecvFlag
0x0000
– Idle (written by PLC program)
0x0001
– Message received (written by
CMGSM)
D3710-D3719
RecvOrigAddress
Phone number of the message sender
(originator). Length 20 characters.
D3720-D3799
RecvUserData
Text of the message. Length 160
characters.
This range of registers cannot be used for any other purposes!
PLC1.ir