Home > Forum > IEC 61131 Programming (LogicLab) > A solution for sending multiple SMS
tagged: MultipleSMS
- This topic has 7 replies, 4 participants and was last updated 2 years, 4 months ago da Sergio Bertana.
-
AuthorPost
-
October 7, 2013 at 6: 26 am #35428AuthorlessIdle
I've been trying to create a function block for days that allows sending multiple messages to multiple recipients. What I want to achieve is to be able to send different messages to multiple phone numbers. In practice, in a control system, I want the people in charge of maintenance to be alerted via SMS on alarm conditions.
I made several attempts using the library eModemLib but I can not get the operation, do you have any suggestions?
October 7, 2013 at 6: 33 am #37819Sergio BertanaAdministrator ForumUsing multiple instances of the function block ModemSMSSend_v2 it is possible to send multiple SMS messages to multiple numbers as indicated in IEC61131-3 Programming Manual. Of course, if the messages to be sent are many and if the numbers to which to send them are many, the number of instances of the FB necessary for sending grows and therefore, as you rightly suggest, it is preferable to build a special FB.
Here is a project in which the FB MultipleSMS allows you to send up to 32 messages to up 32 numbers (Print e Download program). Messages and phone numbers are passed via the address of an array of pointers Messages e PhNumbers, in this way memory occupation is optimized as it is possible to size the array as desired and messages such as telephone numbers are strings saved in code memory.
The DWORD variables MsgSelector e PNrSelector, allow to send only the messages whose relative bit is active to the telephone numbers whose relative bit is active. Do this before activating the command Send By acting on these two variables, it is possible to define which messages to send and to which numbers to send them.
activating Send the messages are sent, after which it is activated Done, to carry out a new transmission must be deactivated Send and then reactivate it.
October 22, 2019 at 12: 31 pm #50279neptuniumParticipantGood evening! I'm new to the forum, I must say that I have recently entered the world of PLCs.
Having to use the function block ModemSMSSend_v2 in multi SMS configuration I came across during a search on the forum in one of his programs where there is an FB MultipleSMS dated 2013. After loading it on Logiclab I get a compilation error with the following errors:
ModemPhoneCall_v1 (102) - warning S1314: Duplicate value in the CASE definition
ModemSMSSend_v2 (153) - warning S1314: Duplicate value in the definition of the CASEOctober 22, 2019 at 12: 58 pm #50303Sergio BertanaAdministrator ForumIn fact, I tried to compile the old project and there were two errors you complain. So being a very old project I decided to update it using the new version of the library eLLabModemLib_F100.
I rewrote the main program in FBD, but I have not tried the project, I leave it to you to test it and possibly tell me if you have problems, I leave you the project MultipleSMS_v1 for the download.
October 25, 2019 at 6: 10 am #50353neptuniumParticipantIn the meantime, thank you for the prompt reply, the example edited by you works perfectly. implemented in my program, it dialed the few numbers entered by sending the relative assigned messages.
My intention is to connect at least 2 by duplicating the FB do you think it will work?
October 25, 2019 at 6: 20 am #50375Sergio BertanaAdministrator ForumI don't understand why the need to duplicate the FB, if you need more numbers or more messages just add them to the FB.
The FB can send up to 32 different messages, just define them in the array Message setting the relative bit in the variable MsgSelector.
MsgSelector:=16#00000007; (* Message selector *) Message[0]:=ADR('Messaggio 0'); Message[1]:=ADR('Messaggio 1'); Message[2]:=ADR('Messaggio 2');
Each message can be sent up to 32 different numbers, just define them in the array PhoneNr setting the relative bit in the variable PNrSelector
PNrSelector:=16#00000003; (* Phone number selector *) PhoneNr[0]:=ADR('+39123456789'); PhoneNr[1]:=ADR('+39123456789');
If you have different needs in the project there is the source code of the FB just modify it to adapt it to your needs.
December 7, 2021 at 7: 41 am #62468GABRIELEGALLIParticipantSome time ago I used the fully functional MultipleSMS module. Unfortunately today dusting off a project I no longer find the relative library then called eMultiSMS (composed of eLEN, VBit Test, the Function Block MultipleSMS and the STartUP program).
Is it possible for me to have it?
December 7, 2021 at 7: 42 am #62471Sergio BertanaAdministrator ForumJust download the program MultipleSMS_v1 that you find a couple of posts before this ...
-
AuthorPost
- You must be logged in to reply to this topic.