WagoLibSms77_03.lib
Transcription
WagoLibSms77_03.lib
WAGO-I/O-PRO 32 Library WagoLibSms77_03.lib This library provides function blocks for sending SMS messages via provider "www.sms77.de". − Registration at "www.sms77.de" is mandatory − HTTP connection supported (SMS77_Client) − HTTPS connection supported (SMS77_HttpsClient) Remarks: − If platform does not support "WagoLibHttps_01.lib" (e.g. Z750-841), the function block "SMS77_HttpsClient" must be excluded from build: Menu > Project > Options Build -> Exlude objects "SMS77_HttpsClient" Content SMS77_HttpsClient ..................................................................................... 2 SMS77_Client .............................................................................................. 5 eSMS77_TYPE (Enum)............................................................................... 8 SMS77_HttpsClient SMS77_HttpsClient WAGO-I/O-PRO Library elements Category: Name: Type: Library name: Used Librarys Applicable to: Inputparameters: sUser sPwd sTo sText eType xFlash sFrom tTimeOut Communication SMS77_HttpsClient Function block X Program Function WagoLibSms77_03.lib WagoLibHttps_01.lib : Version >= 1.5 WagoLibBase64_01.lib : Version >= 1.1 WagoLibMD5_01.lib : Version >= 0.9 750-88x : Firmware >= 01.05.15(07) 750-820x : Firmware >= 02.02.20(03) Data type: Comments: STRING(30) SMS77 user name STRING(30) SMS77 password STRING(30) Number of receiver STRING(160) Message text eSMS77_TYPE See “eSMS77_TYPE” description BOOL Send SMS as Flash-SMS Parameter is applicable to all SMS types STRING(16) Number of sender, only for eSMS77TYPE_QUALITY and eSMS77TYPE_DIRECT TIME Watchdog-Time, operation interrupts after x Seconds In-/Out parameters: xSend Data type: BOOL Comments: Starts transmission on a raising edge, automatically resets when work is done Outputparameters: diError Data type: DINT sStatus STRING(255) sBalance Graphic display: STRING Comments: Numerical Errorcode, see description for details 0 == Success Information about the current execution state Current balance of SMS77 account 2 – WagoLibSms77_03.lib WAGO-I/O-PRO 32 SMS77_HttpsClient WAGO-I/O-PRO Library elements Function description: This function block utilizes the provider "www.sms77.de" to send a SMS to any recipient. To do so a HTTPS-GET-Request together with the SMS-Message is send to https://gateway.sms77.de. Example: GET https://gateway.sms77.de/?u=benutzer&p=passwort&to=0049160999999999&text=me ine%20erste%20nachricht&type=quality&from=sms77.de The API returns the value 100 in MIME type text/plain in case of successful execution. Otherwise one of the following error codes is returned: Return value diError: 16#00000000 => 'SUCCESS' 16#80001001 => 'TCP-ERROR: DNS-Request failed, could not retrieve servers IP address' 16#80001002 => 'TCP-ERROR: Could not convert servers IP address into dotted format' 16#80002001 => 'HTTPS-ERROR: Server returns "xyz" instead of "200" OK' - visit "http://en.wikipedia.org/wiki/List_of_HTTP_status_codes" for details 16#80002002 => 'HTTPS-ERROR: "Content-Length" not found in response header' 16#80002003 => 'HTTPS-ERROR: Begin of data area [CR;LF;CR;LF] not found in response 16#80004001 => 'TIMEOUT: <actual processed step in state machine>' 16#80770101 => 'SMS77-ERROR 101: Versand an mindestens einen Empfänger fehlgeschlagen'; 16#80770201 => 'SMS77-ERROR 201: Ländercode für diesen SMS-Typ nicht gültig. use "basicplus"'; 16#80770202 => 'SMS77-ERROR 202: Empfängernummer ungültig'; 16#80770300 => 'SMS77-ERROR 300: Bitte Benutzer/Password angeben'; 16#80770301 => 'SMS77-ERROR 301: Variable "sTo" nicht gesetzt!'; 16#80770304 => 'SMS77-ERROR 304: Variable "eType" nicht gesetzt!'; 16#80770305 => 'SMS77-ERROR 305: Variable "sText" nicht gesetzt!'; 16#80770306 => 'SMS77-ERROR 306: Absendernummer ungültig, reale Handynummer im Format 0049...erforderlich!'; 16#80770307 => 'SMS77-ERROR 307: Variable "sUrl" nicht gesetzt!'; 16#80770400 => 'SMS77-ERROR 400: SMS-Type ungültig!'; 16#80770401 => 'SMS77-ERROR 401: SMS-Text zu lang!'; 16#80770402 => 'SMS77-ERROR 402: Reloadsperre - diese SMS wurde bereits innnerhalb der letzten 90 Sekunden versendet!'; 16#80770500 => 'SMS77-ERROR 500: Zu wenig Guthaben vorhanden!'; 16#80770600 => 'SMS77-ERROR 600: Carrier Zustellung misslungen!'; 16#80770700 => 'SMS77-ERROR 700: Unbekannter Fehler!'; 16#80770801 => 'SMS77-ERROR 801: Logo-Datei nicht angegeben!'; 16#80770802 => 'SMS77-ERROR 802: Logo-Datei existiert nicht!'; 16#80770803 => 'SMS77-ERROR 803: Klingelton nicht angegeben!'; 16#80770900 => 'SMS77-ERROR 900: Benutzer/Password-Kombination falsch!'; 16#80770902 => 'SMS77-ERROR 902: HTTP-API für diesen Account deaktiviert!'; 16#80770903 => 'SMS77-ERROR 903: Server-IP ist falsch!'; 16#80770998 => 'SMS77-ERROR 998: Benutzer/Password-Kombination falsch oder zu wenig Guthaben vorhanden!'; 16#80770999 => 'SMS77-ERROR: Unknown HTTP response code received from SMS77"' 3 – WagoLibSms77_03.lib WAGO-I/O-PRO 32 SMS77_HttpsClient WAGO-I/O-PRO Library elements If your platform does not support secure communication (e.g. 750-841 or 750-88x with old firmware version) you possibly see an error message while downloading your project: You can ask [email protected] for an firmware update that provides “WagoLibSSL.lib” capability (e.g. if your 750-88x has firmware version < 7 installed) If your platform definitely has no SSL support (e.g. 750-841), you must use the HTTPbased function block "SMS77_Client". The function block “SMS77_HttpsClient” must be excluded from build: Menu -> Project -> Options -> Build -> Exlude objects "SMS77_HttpsClient” 4 – WagoLibSms77_03.lib WAGO-I/O-PRO 32 SMS77_Client SMS77_Client WAGO-I/O-PRO Library elements Category: Name: Type: Library name: Used Librarys Applicable to: Communication SMS77_Client Function block X Program Function WagoLibSms77_03.lib WagoLibHttp_02.lib : Version >= 2.10 WagoLibBase64_01.lib : Version >= 1.1 WagoLibMD5_01.lib : Version >= 0.9 WagoLibEthernet_01.lib : Version >= 1.7 All WAGO Ethernet Controllers (series 750, IO-IPC's) Inputparameters: sUser sPwd sTo sText eType xFlash Data type: STRING(30) STRING(30) STRING(30) STRING(160) eSMS77_TYPE BOOL sFrom STRING(16) tTimeOut TIME In-/Out parameters: xSend Data type: BOOL Comments: Starts transmission on a raising edge, automatically resets when work is done Outputparameters: diError Data type: DINT sStatus STRING(255) sBalance Graphic display: STRING Comments: Numerical Errorcode, see description for details 0 == Success Information about the current execution state Current balance of SMS77 account 5 – WagoLibSms77_03.lib Comments: SMS77 user name SMS77 password Number of receiver Message text See “eSMS77_TYPE” description Send SMS as Flash-SMS Parameter is applicable to all SMS types Number of sender, only for eSMS77TYPE_QUALITY and eSMS77TYPE_DIRECT Watchdog-Time, operation interrupts after x Seconds WAGO-I/O-PRO 32 SMS77_Client WAGO-I/O-PRO Library elements Function description: This function block utilizes the provider "www.sms77.de" to send a SMS to any recipient. To do so a HTTP-GET-Request together with the SMS-Message is send to http://gateway.sms77.de. Example: GET http://gateway.sms77.de/?u=benutzer&p=passwort&to=0049160999999999&text=mei ne%20erste%20nachricht&type=quality&from=sms77.de The API returns the value 100 in MIME type text/plain in case of successful execution. Otherwise one of the following error codes is returned: Return value diError: 16#00000000 => 'SUCCESS' 16#80001001 => 'TCP-ERROR: DNS-Request failed, could not retrieve servers IP address' 16#80001002 => 'TCP-ERROR: Could not convert servers IP address into dotted format' 16#80002001 => 'HTTP-ERROR: Server returns "xyz" instead of "200" OK' - visit "http://en.wikipedia.org/wiki/List_of_HTTP_status_codes" for details 16#80002002 => 'HTTP-ERROR: "Content-Length" not found in response header' 16#80002003 => 'HTTP-ERROR: Begin of data area [CR;LF;CR;LF] not found in response 16#80004001 => 'TIMEOUT: <actual processed step in state machine>' 16#80770101 => 'SMS77-ERROR 101: Versand an mindestens einen Empfänger fehlgeschlagen'; 16#80770201 => 'SMS77-ERROR 201: Ländercode für diesen SMS-Typ nicht gültig. use "basicplus"'; 16#80770202 => 'SMS77-ERROR 202: Empfängernummer ungültig'; 16#80770300 => 'SMS77-ERROR 300: Bitte Benutzer/Password angeben'; 16#80770301 => 'SMS77-ERROR 301: Variable "sTo" nicht gesetzt!'; 16#80770304 => 'SMS77-ERROR 304: Variable "eType" nicht gesetzt!'; 16#80770305 => 'SMS77-ERROR 305: Variable "sText" nicht gesetzt!'; 16#80770306 => 'SMS77-ERROR 306: Absendernummer ungültig, reale Handynummer im Format 0049...erforderlich!'; 16#80770307 => 'SMS77-ERROR 307: Variable "sUrl" nicht gesetzt!'; 16#80770400 => 'SMS77-ERROR 400: SMS-Type ungültig!'; 16#80770401 => 'SMS77-ERROR 401: SMS-Text zu lang!'; 16#80770402 => 'SMS77-ERROR 402: Reloadsperre - diese SMS wurde bereits innnerhalb der letzten 90 Sekunden versendet!'; 16#80770500 => 'SMS77-ERROR 500: Zu wenig Guthaben vorhanden!'; 16#80770600 => 'SMS77-ERROR 600: Carrier Zustellung misslungen!'; 16#80770700 => 'SMS77-ERROR 700: Unbekannter Fehler!'; 16#80770801 => 'SMS77-ERROR 801: Logo-Datei nicht angegeben!'; 16#80770802 => 'SMS77-ERROR 802: Logo-Datei existiert nicht!'; 16#80770803 => 'SMS77-ERROR 803: Klingelton nicht angegeben!'; 16#80770900 => 'SMS77-ERROR 900: Benutzer/Password-Kombination falsch!'; 16#80770902 => 'SMS77-ERROR 902: HTTP-API für diesen Account deaktiviert!'; 16#80770903 => 'SMS77-ERROR 903: Server-IP ist falsch!'; 16#80770998 => 'SMS77-ERROR 998: Benutzer/Password-Kombination falsch oder zu wenig Guthaben vorhanden!'; 16#80770999 => 'SMS77-ERROR: Unknown HTTP response code received from SMS77"' 6 – WagoLibSms77_03.lib WAGO-I/O-PRO 32 SMS77_Client WAGO-I/O-PRO Library elements If your platform does not support secure communication (e.g. 750-841 or 750-88x with old firmware version) you possibly see an error message while downloading your project: You can ask [email protected] for an firmware update that provides “WagoLibSSL.lib” capability (e.g. if your 750-88x has firmware version < 7 installed) If your platform definitely has no SSL support (e.g. 750-841), you must use the HTTPbased function block "SMS77_Client". The function block “SMS77_HttpsClient” must be excluded from build: Menu -> Project -> Options -> Build -> Exlude objects "SMS77_HttpsClient” 7 – WagoLibSms77_03.lib WAGO-I/O-PRO 32 eSMS77_TYPE (Enum) eSMS77_TYPE (Enum) WAGO-I/O-PRO Library elements Category: Name: Type: Libraryname: eSMS77_TYPE Enumeration X Data type WagoLibSms77_03.lib Declaration: TYPE eSMS77_TYPE : ( eSMS77TYPE_BALANCE, eSMS77TYPE_BASICPLUS, eSMS77TYPE_QUALITY, eSMS77TYPE_DIRECT, ); END_TYPE (* (* (* (* Guthabenabfrage Basis SMS Quality SMS Direct SMS *) *) *) *) Description: eSMS77TYPE_BALANCE: Guthabenabfrage eSMS77TYPE_BASICPLUS: Basis SMS: Weltweiter Versand, keine eigene Absenderkennung möglich. Zustellung zu 99,5% garantiert. eSMS77TYPE_QUALITY: Quality SMS: Weltweiter Versand, eigene Absenderkennung möglich. Zustellung zu 99,5% garantiert. eSMS77TYPE_DIRECT: Direct SMS: Weltweiter Versand, eigene Absenderkennung möglich. Zustellung zu 100% garantiert. Detailierte Informationen zu den einzelnen SMS-Typen: http://www.sms77.de/funktionen/smstypen Jeder SMS-Typ kann auch als "FLASH-SMS" versendet werden. Dazu muss der Eingang "xFlash" des SMS77-FBs gesetzt werden. 8 – WagoLibSms77_03.lib WAGO-I/O-PRO 32