GSM communication principle and application based on FATEK PLC
Abstract: Based on FATEK PLC, this paper realizes remote control of equipment through GSM communication module. It can solve the control problems of mobility and remote.
Key words: Fatek PLC, telecommunication, GSM, GPRS
Abstract: :
In this paper, we introduce The GSM communication module of FATEK PLC. Through GSM communication module, Remote control problems can be solved
Key Words: FATEK PLC Remote Control GSM GPRS
1. Introduction
With the acceleration of China’s industrialization process, PLC (programmable controller) is more and more applied in the industrial field, and even in many smart home fields. The application field of PLC is also a leap from logic control to digital control, monomer control to motion control, process control to distributed control, and in distributed control, the way of communication control is also changing, the traditional RS-232 serial communication can only reach 15 meters away at most, and the RS-485 communication can only reach more than 1200 meters away at most. Although Ethernet communication can be remotely controlled, but must be connected to the network cable, in some poor environmental conditions, the device is far from the network connection point, or the device needs to move the occasion also limits its use. The latest GSM connection module, through SMS SMS or GPRS data connection using TCP/IP protocol, uses mobile, Unicom has built a good 2G/3G network to achieve nationwide coverage, so as to achieve the purpose of remote reporting of equipment operating status, data analysis and processing and remote control.
Unnamed.jpg
Figure 1.1 GSM module connection diagram of FATEK PLC
2. Fatek PLC GSM module communication function introduction
FBs-CMGSM is one of the communication modules provided by FATEK PLC series. This module can be used to transmit data via GSM communication network. This module provides a four-band (850/900/1800/1900 MHz) GSM communication band. It also uses a lithium iodine battery with a capacity of 1.7 amps per hour to receive and send text messages continuously when the main power supply is lost. Under the same line width, there are two different ways to operate:
The first is the use of SMS for monitoring and remote control. FBs-CMGSM periodically reads the register containing the “sendSMS” flag. If the flag is set, FBs-CMGSM reads the target phone number and string (text), sends an SMS, and resets the flag. If an SMS is received by FBs-CMGSM, it will be written to a register containing another flag “SMS received” to be accessed by the PLC program. Finally, the PLC program will reset the flag. Therefore, these operated SMS must be able to be accessed by the PLC program during the sending and receiving process.
The second method of FBs-CMGSM communication over the GSM network is GPRS data connection using the TCP/IP protocol. FBs-CMGSM opens the connection through TCP client mode. Any SIM card that can be connected to the Internet over a GSM network can be used. The IP address and hardware port of the FBs-CMGSM connection are specified by the PLC or by a dedicated SMS. A key point worth mentioning is that this connection can only be opened in the direction from FBs-CMGSM to PC. The PC cannot open a connection to FBs-CMGSM because it does not have a common IP address. The connection command can be sent and received via SMS using the fixed IP address it is connected to. A simple SMS command “Connect” or a voice or data call to a FBs-CMGSM phone number will cause FBs-CMGSM to read the destination IP address from the PLC register and establish a TCP/IP connection. GPRS is transmitted through data packets with a transmission delay of 1 to 10 seconds.
3. Use FATEK PLC communication module
3.1 Mode 1-SMS Working mode:
1.jpg
Figure 3.1 Schematic diagram of GSM module SMS configuration
3.1.1: SMS working mode – Sending SMS:
1. Do a good job of hardware links, network communication is smooth (GSM yellow light);
2. Set the SMS sending number can be changed by a program (D3810)
3. Set the sending content, which can be changed by PLC program according to needs;
4. Write 1 to D3800 to start sending. Other steps are performed automatically by CM-G
5. You can obtain the D3800 flag
2.jpg
Figure 3.2 Flow chart of information sent by GSM module
3.1.2: SMS working mode – Accepting SMS messages:
Note: 1. D3700 needs to be reset after accepting;
2. Make format regulations according to requirements;
3. Make full use of the received content for control
3.jpg
FIG. 3.3 Flowchart of receiving information of GSM module
3.2 Mode 2-GPRS Working mode:
4.jpg
PLC parameters are set to: 9600bps, 7bit, EVEN, 1stop, station number 1.
Module FBs-CM-G configuration and command format (stored in the register at the beginning of D3900) : Command format description is as follows:
Command description
CMGSM3; Module-specific configuration start string
APN=cmnet; GPRS access point: CMNET- Mobile, UNINET- Unicom
SERVER = 183.12.129.149; Remote Server IP(FATEK TCP protocol)
PORT=5700; TCP link port (depending on the SERVER, default 5700)
ACODE=1234; SMS control passcode
$End of configuration character
5.jpg
Table 3.1 Description of GPRS link command of GSM module
In the PLC, you need to create a text table, the table address points to D3900, that is, the PLC sends the command to the GSM module. Through the control word D3510 to achieve the establishment of GPRS link, and link to the remote SERVER. The reference table is as follows:
6.jpg
Figure 3.6 Table of GPRS control commands in GSM module
Its work flow chart is as follows:
7.jpg
Figure 3.7 Working flow chart of GPRS control in GSM module
GSM module work notes:
A.prs access data through IP/TCP, this module only provides Client mode; (IP float of CM-G)
b. The remote must act as a SERVER and combine with related graphics control software to carry out PLC monitoring
c. Support FATEK TCP protocol (FATEK protocol plus TCP/IP HEAD file)
The ideal rate of D.PRS is 171.2Kbps, the actual rate is 40Kbps, and the transmission delay is 1~10S
e. The connection must be initiated by FBs-CM-G. After success, the PLC can be operated by picture control
4 Closing remarks
Fong Hong PLC’s GSM module uses the existing communication network of mobile or Unicom, can achieve nationwide coverage, unlimited access locations, can meet the remote control needs of mountainous areas, townships and cross-regions, and the cost is only the SMS fee generated by the mobile company’s mobile phone card purchased by users, and the monthly fee when using GPRS can achieve low-cost communication.