CONNECTING PLC WITH GSM MODEM FOR ALARM ANNOUNCEMENT

ASSOCIATION PLC WITH GSM-MODEM

SMS MISSION FOR ERRORS REPORT

How can we have remotely, when an alarm happens, the report of the error in the installation?
Simply, by sending an SMS message alarm from PLC in our mobile.

Below we describe the logic and message sending, reporting an error.

The SmsAlarm.stx program shows us how can we send SMS and find errors. In this program we are able to recognize only three errors, for example. Of course we can identify more, and that depends on the application and severity of errors (Alarms). It is in the hands of each developer to create in the PLC a database-constants, which correspond to specific error-Alarms.

Also this example is not binding, except the codes to send in GSM - MODEM to send the SMS message. Thus it can be changed depending on the application except for certain items to be analyzed.

The application has been made on a series PLC MICRO TSX37. Communication with the GSM MODEM is through the cable programming TSXPCX1031 with the trimmer in option 3. We also need an additional cable, which you must build yourself, but it is very simple.
On the side of GSM - MODEM a male connector VGA 15-pin must be used, while on the side of the PLC, to connect the cable TSXPCX1031 must be used a male serial connector 9-pin, and the connections are:

9 – pin 15 – pin

5 <--> 9

3 <--> 6

2 <--> 2

So Simple

The GSM - MODEM that we have chosen is from the company WAVECOM
The model has code order WMOD2B - M1203A. For anyone interested in more information , on the Site Wavecom.com, can find the manual of the product.

The program distinguish two PRINT_CHAR commands.

In the first command


After selecting a channel in the PLC, (ADR # 0.0.SYS - From TER) the code AT + CMGS is the command necessary for the GSM - MODEM, to send SMS, while the numbers where are between "  " is the number of mobile in which we send out the SMS. The Code $R (CR = 0D - Ascii Hex) is the Return.
The % MW120: 4 is the reference words for communication, which you can change.

NOTE: The channel selection (ADR # 0.0.SYS - From TER), the code, the phone number, and the code $R is absolutely binding and must be placed exactly as you can see them in the command.

In the second command, and after a delay of 500ms (TP = 500ms) as noted in the program


The %MB200: 20 is equivalent to %MW100: 10. In these words, placed as seen in the program, the initial commands  (the command Operate), the constants describe the current message that we want to send. That we putting in %KWs the message we want to send (from the Application Browser select Variables--> Constants --> Words). Caution should be taken, each character must be written with the corresponding HEX code from the ASCII table. Something else to pay attention, is that we must engage a specific length of characters and must in the end of each message to devote a %MW to write the code 16#1A00, which is necessary to convey the message (close this message).

Also in the Hardware Configuration of the PLC in COMMs must be chosen for the Channel 0 "Character Mode" as shown in the program.

 Care must be taken from the developer in every application the code used. It is the rensponsibility of the developer to use the code properly in his application

You could REQUEST for the code