Sign in to follow this  
Followers 0
brandict

Need For Help! Please...

5 posts in this topic

hi...need for urgent help!! i'm using FX1N PLC and work together with Wavecom Fastrack M1206 GSM modem. Before that, here my project brieftly. I would like to get an msg when X0 push button are press and Y0 LED are light on. In order to let me know X0 are running. Beside that, i would like to remote control the Y0 by sending a msg back to GSM modem and tell the PLC switch off the Y0. But i have try for many many times, i still cannot get the msg when the push button are pressed. So i here to ask for advice from who know this programming. Here is my problem: 1) Is that i need using parameter to set the baud rate,parity and etc? 2) Is that i need to put the STX and ETX before and after the message i set to send? 3) I also would like to know how to know the length of device memory (k)? is that count by column? means if i use 10column, i put k10? And i also want to know, is that anyone have example for me to refer on? Thanks Brandict.

Share this post


Link to post
Share on other sites
Hello, I have an example in Melsec Instruction List using a 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.). You also need to init your modem so that it's using the correct baudrate, parity etc. I've only used a Westermo GD-01 so I don't know if the AT-commands are the same (?) ATE0 //Echo off AT+IFC=2,2 //Flowcontrol AT+CMGF=1 //Ascii-format AT+IPR=9600 //9600 bps AT+ICF=3,4 //8 databits, 1 stopbit, no parity AT&W //Save the settings You'll also need to create a cable between the PLC and GSM-modem, but I don't know the pin-configuration for the modem-brand you are using. 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 sent. Good Luck!! Patrik

Share this post


Link to post
Share on other sites
Hello again, An example: (*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 Best regards Patrik

Share this post


Link to post
Share on other sites
And one last thing, to be able to receive messages you'll need to use an AT-command that sets up the modem to send out all information that it receive on the COM-port, then you will need to learn to format for this message and find a way to "mask" out the "real" message, tomorrow, at work I'll see if I can find the AT-command! Best regards //Patrik

Share this post


Link to post
Share on other sites
hello....yesterday i have try to sending and read the msg from PLC by a simply programming. But the data i receive back is in unknown form. So i guess is my baud rate problem, from the modem manual book it's ask me to use factory setting where bps=115200, data bits=8, parity= none, stop bits= 1, flow control= hardware. But in PLC i only can set in FX parameter by following: protocol=non procedural, data length=8, parity= none, stop bits=1, and bps=9600. Am i set wrongly in FX parameter? Is that the baud rate for modem and PLC not match therefore the data i receive is in unknown form? and how can i solve this problem to let the data i receive back convert to hexadecimal form? Thanks. Brandict

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