background image

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

Summary of Contents for FBs-CMGSM

Page 1: ...just to set several PLC registers No PLC program support is necessary for CSD and GPRS operation LEDs for indication of the CMGSM status and data flow signalization Unlimited number of logical and analog inputs and outputs can work with one CMGSM PLC network 1 GSM antenna connector 2 IO connector 3 SIM card holder 4 USB connector 5 DIN rail holder 6 FUNC button 7 Indication LEDs Rx Tx 8 Flat cable...

Page 2: ...800 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 use...

Page 3: ...respond with confirmation SMS and restart itself PLC is not affected This command is used after change of configuration in PLC register to accept the changes by CMGSM CONFIG Device will respond with current configuration Current configuration is a default configuration with some values changed by configuration string in PLC see Chapter 5 Configuration FACTORY CMGSM will respond with confirmation S...

Page 4: ...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 0x...

Page 5: ...re shown in table below Unknown keys are ignored no spaces are allowed inside keys or values Order of pairs is not important Keys are not case sensitive values are case sensitive Maximum length of configuration string is 200 characters At the end of each part MUST be character semicolon after last pair MAY be character semicolon and MUST be character dollar 5 2 Basic parameters Key Description Def...

Page 6: ...ct your LAN against an attack from Internet Port It is a number of a service in your computer Complete address needed to connect your computer is composed from IP address and Port number and may be seen as 11 22 33 44 5700 IP ADDRESS PORT 7 2 Simple Use We recommend this scenario for your first step with CMGSM Internet Firewall Your computer in LAN of your company GSM Network LAN FBs CMGSM FATEK P...

Page 7: ...998877 because CMGSM reads the configuration until the first character 10 Warranty General warranty period is 12 months after purchase when eventual malfunction device will be repaired free of charge in SEA company while shipping to SEA is paid by customer and SEA pays for shipping back to customer For SW there is 24 months warranty under following conditions Both CPU and PC software is sold as is...

Reviews: