140903 FBs-CMGSM User's Manual EN v3-04
Page #
4 of 7
4.6
Diagnostic
Diagnostics values are written to
Diagnostic Record
, standard base D3500. Structure
of the record is in following table:
Registers
Caption
Description
D3500.0
DiagCnct
0=no connection to PLC, 1=connection to
PLC OK
D3500.1
DiagRQueue
0=no SMS in receive queue, 1=at least one
SMS in receive queue
D3500.8-15
DiagGsmReg
result of command AT+CREG:
0=not registered, not searching
1=registered, home network
2=not registered, searching
3=registration denied
5=registered, roaming
D3501.0-7
DiagSigQuality
Signal quality in percent (0-100) or 255 if
unknown.
D3501.8-15
DiagSigErr
Signal BER (0-7) or 255 if unknown.
D3502
DiagAlive
CMGSM writes value 0x0001 whenever
diagnostic record is refreshed (cca 6
seconds). This is intended for PLC program
to check if CMGSM is alive. In this case PLC
program will write a 0x0000 into this
register and wait for 0x0001 here.
D3503
DiagVersion
Version of CMGSM3, in high byte is high
version number, in low byte is low byte is
low version number
D3504
0x0000
For future use
D3505
DiagReset
If PLC writes value
0xF3A5
to this register
the CMGSM will make reset of itself.
D3506
DiagAtFlag
0x0000
– Idle
0x0001
– Execute
command
in
DiagAtCmd (written by program in PLC)
0x0003
– Command is about to execute
(written by CMGSM)
0x0000
– Command executed successfully
(written by CMGSM)
0x0004
– Exception while executing the
command (written by CMGSM)
D3508-D3509
DiagUpTime
32 bit counter which is incremented
whenever CMGSM updates DiagRegisters
area in PLC. The counter is cleared after
restart of CMGSM. The counter value
indicates in a certain way how long the
CMGSM is running without restart (so
called Uptime).
D3510-D3529
Gprs ...
Reserved for GPRS diagnostics
See chapter “TCP over GPRS” for details
D3530-D3539
DiagOperator
String with name of operator when
registered. Empty string if not registered.
Length 20 characters.
D3540-D3549
DiagCredit
Reserved
D3550-D3699
DiagAtCmd
Sending AT commands to modem directly.
Write a command to this place and set
D3506 (DiagAtFlag) to 0x0001. Command
is executed and result is placed in this
place (overwriting original command). In
D3506 (DiagAtFlag) is signalized end of
execution. The system is the same as with
sending SMS.
This range of registers cannot be used for any other purposes!
Notation
D3500.x
means x-th bit of D3500 register. For example D3500.0 is the
least significant bit in register D3500. Another example D3500.8-15 are eight most
significant bits in register D3500 (high byte).
Base of
Diag Record
(D3500) may be changed to another D or R register via
configuration key REGDIAG.
5.
Configuration
5.1
How to
Configuration for CMGSM is located inside PLC Fatek. Range of internal PLC registers
D3900 – D3999 is used. Configuration itself is a string of characters. This string is
created via WinProladder (software from PLC FATEK manufacturer), see following
images. This range of registers cannot be used for any other purposes!
Step 1 – Right click on Table edit - ASCII Table
and select “New ASCII Table”
Step 2 – Enter Table Name „cfg“ and Table starting address „D3900“.
Then click “OK”.
Step 3 – Enter configuration string
“CMGSM3;PIN=7608;ACODE=998877;$” into field “ASCII Editor” and
click on button “Output Preview”. !!! Warning: Change PIN according your
real SIM card !!!
Step 3 (GPRS) – Enter configuration string
“CMGSM3;PIN=7608;APN=internet;SERVER=test.server.com;PORT=5700
;ACODE=998877;$” into field “ASCII Editor” and click on button “Output
Preview”. !!! Warning: Change PIN according to your real SIM card !!!
PLC1.ir