Sign in to follow this  
Followers 0
Guest Guest_jim5

SMS

6 posts in this topic

Does anyone have a program for sending SMS messages from a mitsubishi FX Plc. It can not be in function block because i only have GX Developer 8, Which won't let me use them. The only help Mitsubishi would give is that they infact have the program on their site. but it infunction block.. Im a novice at writing Programs for PlC's So Any Help would be great. I have all the hardware set up (gsm modem - comm card(rs 232)- Plc). thanks Jim

Share this post


Link to post
Share on other sites
Hello, I have an example in Melsec Instruction List using FX-system with 232-BD com-card, but I have to warn you that it isn't so advanced, but It works - in Sweden, you´ll probably be forced to do some adjutments (e.g phonenumberlength etc.). If you give me your e-mailaddress then I can send it to you... If you want to try yourself you´ll need to configure the port (I guess 232-BD?), you can achieve this by sending e.g hexadecimal 81 to D8120 (8 bits, none parity, 1 stop and 9600 bps). Then you have to create a AT-command for sending the SMS... AT+CMGS=07525855<CR> (where 07525855 is the telephonenumber, <CR> = hexadecimal D) and place in the sendarea. If using 232-BD you´ll need to use the RS-instruction for sending the messages, by setting M8122 the RS-instruction sends out what is located in the sendarea. When sending is completed M8122 will be reset automaticly. Now a timer is needed in order to give the modem a chance to answer. At last you´ll need to place the textmessage in the sendarea, you´ll also need to add <ctrl-z> (hexadecimal 1A) at the end of the textstring. Then set M8122 and if all is properly configured a sms will be send. I think that you also have to create an own cable between the modem and FX communication card, does anyone know how it should look? Good Luck!! Patrik

Share this post


Link to post
Share on other sites
Thanks very much for your reply. I have already created a program that does exactly what your saying. It takes my message and number from there original location and puts them in to a type of transmission zone for sending and then sends the to the modem in the correct order. But when i was tested it, it worked fine for the first time i sent a message but after the message was sent, i tryed it a second time but all that my mobile phone recieved was a blank screen. So some how the message is getting lost.. I messed around with the delays but to no avail. im just wonder if anyone knows a solution to this. Its probably something really simple im over looking. If you need more info ill post it asap Thanks Jim

Share this post


Link to post
Share on other sites
Hello Jim, I've written a lot of SMS-programs for different Mits-systems and have never encountered the same problem. When you are trying out your program does it always work the first time? If you want to you can mail your program to me so can I check if i find any logical mistakes in the code. I attach an easy example written in Melsec Instructionlist. (*Setup of communication parameters for 232-BD, 8 databites, 1 stopbit, no parity*) LD M8002 MOV H81 D8120 (* RS-instruction to send and receive data, activated later in the program with M8122 *) LD M8000 RS D101 D100 D200 K20 (*Pulse on M0 when input X0 goes on rising edge, is used as condition for program-part 1*) LD X0 PLS M0 (*Program-part 1*) (* AT-command AT+CMGS= is transformed in to ASCII-characters and moved in to the sendarea *) LD M0 MOV H5441 D101 MOV H432B D102 MOV H474D D103 MOV H3D53 D104 (* The telephonenumber (located in D10-D14) is moved in to the sendarea *) LD M0 BMOV D10 D105 K5 (* Character <CR> is moved in to the sendarea *) LD M0 MOV HD D110 (* The length of ASCII-string 1 is moved in to the first place in the sendarea*) LD M0 MOV K19 D100 (* ASCII-string 1 is sent and porgrampart 2 is activated *) LD M0 SET M8122 SET M1 (* Programpart 2 *) (* Start of delayment so that the GSM-modem has a chance to answer *) LD M1 OUT T0 K10 (* Messagetext (located in D0-D9) is moved in to the sendarea*) LD T0 BMOV D0 D101 K10 (* The character <ctrl-z> is moved in to the sendarea *) LD T0 MOV H1A D111 (*The length of ASCII-string 2 is moved in to the sendarea*) LD T0 MOV K21 D100 (* ASCII-string 2 is sent and programpart 2 is reset *) LD T0 SET M8122 RST M1 I hope this can help you out a little, please let me know how it went!! Best regards Patrik

Share this post


Link to post
Share on other sites
Thanks for the reply Patrik. Yeah my program is the same. I have my modem set the same also. could it be something to do with flow control. Could it also be that i have left slightly to long of and memory area for the number and text. like setting it to k22 or the like... would this casuse such a problem...If you want ill send on the project to see if it works on your sytem. Thanks again Jim

Share this post


Link to post
Share on other sites
Hello, You can send your program to my e-mail: tde01031@stud.mah.se, I think you better zip the file so that the firewall dosen't remove it! Best regards Patrik

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0