Jan 2, 2014

Delta PLC Interfacing with GSM Module

GSM Modems are playing very important role in every industry and automation industry is too effected by it. GSM modules are largely used in automation industry for providing communication between PLC and other applications like SCADA and HMI's. In this tutorial we will tell you how to connect a Delta PLC to GSM modem. Subscribe to Automation-Talk by Email.




Delta PLC Communication with GSM Modem

To communicate Delta PLC with GSM modem you will have to follow below steps and should have below hardware and software.

Requirements for this tutorial

1. Delta PLC with Rs485 or Rs232 port
2. GSM Modem
3. RS232 to RS485 Convertor
4. Delta PLC Programming software


For interfacing between Delta PLC and GSM modem, we have used RS-485 communication port at PLC side and RS232 port at GSM modem side. And to connect both these we have used a RS-232 to RS-485 convertor as shown above. For this communication to happen successfully we will first have to make communication settings in program and then send commands by Serial communication instructions.

Communication settings in Delta PLC :

1. COM ports (COM1: RS-232; COM2: RS-485) in ES/EX/SS/SC/SA/SX and COM ports (COM1: RS-232; COM2: RS-232/RS-485/RS-422) in EH support MODBUS ASCII/RTU communication format with speed of up to 115,200bps. COM1 and COM2 can be used at the same time. COM3: RS-232/RS-485 in EH supports MODBUS ASCII communication format with speed of up to 38,400bps.

2. We have used COM2: RS-485 for our interface. For RS 485; communication format is set in D1120. Communication format for different ports:-

Communication Format Settings:

COM1: Communication format is set in D1036, (b8 ~ b15) do not support. Communication setting in M1138 remains and M1139 is set in ASCII/RTU mode.

COM2: Communication format is set in D1120, Communication setting in M1120 remains and M1143 is set in ASCII/RTU mode.

COM3:Communication format is set in D1109, (b0 ~ b3, b8 ~ b15) do not support and Communication setting in M1136 remains.


Now you will have to set data length, parity bits and for that you can use D1120 data register. Follow below charts for your help.




How To Send Commands to GSM Modem

You can send commands to your GSM modem with the help of PLC instruction and this can be easily done as follows.

1. Set M1122; whenever you are sending commands to GSM MODULE. M1122 is sending request flags M1122 for COM2. It has to be enabled in advance for obtaining correct operation.

2. For sending commands use following instruction and operands.


Instruction to send commands to GSM Modem

Now to send AT command from PLC use the instruction as shown in below image.

PLC instruction to send AT Command

To Set M0 bit, we have to send ASCII commands. RS instruction will transfer the AT commands to GSM modem. For that write ASCII value of commands in D408 to D410. We have written ASCII value of command in following register, see below image.


ASCII for sending AT Command

If GSM Modem is working properly, it will responds to AT command. And we get below data in D2200 to DD2206 register.


AT command reply from GSM Modem

If we receive OK from the GSM Modem, then we can send below commands from our PLC.

Related Article: Reading Messages of Modem Connected with PLC

AT+CMGF=1
AT+CMGR="9900123456”
(Phone number to send SMS)

Similarly you can send your message from PLC and get response from GSM modem. Suppose you have to send "Hello". Here we have sent five letters only. It needs to send ctrl+z to send your message. So we have sent five data register for our message and one for ctrl+z. ASCII code for ctrl+z is H1A. If your message contains more letters then write appropriate value in instructions; if message contains 16 letters then use 16 data register for message and plus one data register for ctrl+z; so use total 17 data register including ctrl+z. If you have any issue you can comment below. This tutorial is send by one of our Facebook Fan Vijaysinh Rahevar and we are very thankful to him. If you also want to submit your tutorial, just get in touch with us on Facebook.

Advertisements :-

3 comments:

  1. what if i want to make a 2 gsm modem in twoo ways to communicate between 2 plcs ???

    ReplyDelete
  2. Hello. Friends i new on plc programing and looking friends to exchange programs exemple and want be learn more. zago1819@yahoo.com

    ReplyDelete

Get New Updates

Enter your email address:

Delivered by FeedBurner

Receive all updates via Facebook. Just Click the Like Button Below