Author Topic: Send SMS Message  (Read 18631 times)

FQ-ONG

  • Jr. Member
  • Posts: 61
    • View Profile
Send SMS Message
« on: April 25, 2011, 03:10:37 AM »
Is it possible to send SMS message from F-series PLC with Ethernet Port connect with Internet linked network without the GSM modem?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Send SMS Message
« Reply #1 on: April 25, 2011, 08:09:55 AM »
Many cellphone service provider in the US accept emails with username in the form of the subscriber phone number and will then relay the email to the cellphone as SMS:

http://www.makeuseof.com/tag/email-to-sms/

There may be some paid SMS gateway services that will send SMS messages for you if you send it instruction via TCP/IP.

http://www.smsgateway.ca/Instructions.aspx#get

You can use the F-series PLC  PRINT #4 <TCPCONNECT xxx.xxx.xxx.xxx:yyy>  command to make a connection to the gateway and then send the GET commands by following HTTP protocol format. You will be able to use the INPUT$(4) to read the return string from the Gateway.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

FQ-ONG

  • Jr. Member
  • Posts: 61
    • View Profile
Re:Send SMS Message
« Reply #2 on: April 28, 2011, 11:26:50 PM »
Is it possible to use the HTTP POST method?
« Last Edit: April 28, 2011, 11:32:35 PM by FQ-ONG »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Send SMS Message
« Reply #3 on: April 29, 2011, 12:59:33 PM »
HTTP POST is usually used for sending large amount of data. If the strings can be kept within the PLC's 70 characters limit per string you can certainly send via the HTTP POST protocol.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

FQ-ONG

  • Jr. Member
  • Posts: 61
    • View Profile
Re:Send SMS Message
« Reply #4 on: May 11, 2011, 02:21:14 AM »
A$ = INPUT$(4)
I think this is exceed the 70 characters limit per string, I got 1 time the A$ show the return string just in a few last letter, for other short A$ return string is work well. (e.g. It should be A$="ABCDEF......UVWXYZ", but I get A$="XYZ")

Anyone know how to split the long INPUT$(4) return string into two string(A$,B$)?
Or just get the front portion of return string in 70 characters only? (I just need the front portion only)
Or any other solution to solve this problem?
« Last Edit: May 11, 2011, 02:29:05 AM by FQ-ONG »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Send SMS Message
« Reply #5 on: May 11, 2011, 08:50:59 AM »
I assume you are referring to the data returned from the SMS gateway? Are you sure it is because of the 70 characters limit? Can you try connecting to the gateway using the TELNET command from the PC and examine the incoming data to see what you would actually would receive.

As long as each CR-terminated string returned from the service is less than 70 characters INPUT$(n) should receive it correctly. The buffer can hold up to 256 characters which means multiple strings can be held in the buffer.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

FQ-ONG

  • Jr. Member
  • Posts: 61
    • View Profile
Re:Send SMS Message
« Reply #6 on: May 11, 2011, 06:34:16 PM »
Yes, I'm getting the data returned from the SMS gateway, and assign each line of the return string into B$, C$, D$ ... ...
I have check the return string with PC, this should be 3 lines of return string. In PLC, first line and second line are missing, third line just show the last few letter. When I total up this 3 line, it is about 77 characters. I think, may be something wrong with the CR-terminated string in the first and second line of return string, then it join become 1 line.

How to read out the string from the buffer?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Send SMS Message
« Reply #7 on: May 11, 2011, 09:55:23 PM »
each time you execute INPUT$(4), if there is a complete string with CR-termination it will return to you the string. If there is incomplete string then it will return an empty string. So you can check periodically to ensure that you don't miss out the return string.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:Send SMS Message
« Reply #8 on: May 15, 2011, 11:54:38 AM »
Does the input$(4) only detect CR or it detects CRLF or LF too? I'm using it and i know the data I'm receiving comes with CRLF at the end of the string, however it seems like this function can't detect CRLF. Also, how big is the ethernet buffer where the input$ function gets the data from?

Thanks,
Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Send SMS Message
« Reply #9 on: May 15, 2011, 05:28:24 PM »
INPUT$(4) treats CR and CR+LF the same. i.e. Incoming string can be terminated either by CR alone or CR+LF.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:Send SMS Message
« Reply #10 on: May 15, 2011, 06:26:50 PM »
Thanks for the quick reasponse. The test im running, the data comes from a web mail server. The server terminates the data with CRLF and each segment are less than 70 chars long, however I think the data is arriving too fast or the nano internal buffer is over flowing and overwriting the strings. Is the internal buffer also has a max of 70 chars? Or is that even a possibility?

I can only retrieve the end of the message.

Thanks,
Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Send SMS Message
« Reply #11 on: May 15, 2011, 07:23:13 PM »
The incoming data are buffered in 256 byte buffer, so if the file is larger than 256 bytes (including all the CR+LF) then some of the data will be lost.

TCPCONNECT is really not meant for you to download web data. It is meant for handling messaging with a remote server that exchange small amount of data per transaction.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:Send SMS Message
« Reply #12 on: May 16, 2011, 03:36:20 AM »
Thank you, would this be a functionality that could be added to these products in the near future?

Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.