dan_lorentz Posted December 9, 2011 Report Share Posted December 9, 2011 I am using SMS communication and allowing the PLC to receive text messages. I am using a storing the message received by the PLC into MI's and that leads to my question. Is there a maximum number of characters that the PLC can receive? Is there a way to cap the number? Thanks, Dan Link to comment Share on other sites More sharing options...
Ofir Posted December 11, 2011 Report Share Posted December 11, 2011 Hi, A message containing only English characters may contain up to 160 characters. A message containing non-English characters may contain up to 70 characters. Link to comment Share on other sites More sharing options...
dan_lorentz Posted December 12, 2011 Author Report Share Posted December 12, 2011 Is there a way to cap the number? Or do you have to make sure that there is enough memory allocated for the maximum number of characters? Do I need to only allocate half (80) MI registers to store the message as a result of a MI holding 2 ASCII characters? Right now a long message will run over different parameters that the user has set, regardless of whether the number is in the phone book or now. I just want to be sure that when I move the MI registers I allocate the appropriate amount of space. Thanks, Dan Link to comment Share on other sites More sharing options...
AlexUT Posted December 12, 2011 Report Share Posted December 12, 2011 Hi Dan, You need allocate memory for a maximum characters in string + 1 for <0> (null) terminator. SMS message will be shortest, but allocated space will warrant that any message will be processed. If you use your own algorithm to process SMS - I will recommend you to work with Data Table, where you will define fields, one or more if you need. There is a set of operations with a table rows, which will simplify you task. Standard SMS functions have 16 strings with a fixed SMS messages structure. Link to comment Share on other sites More sharing options...
Ofir Posted December 13, 2011 Report Share Posted December 13, 2011 Hi, Basically if you are using the function which receives SMS to vector then you need to configure in SI199 the Start of Vector address of MI. Of course it is recommneded to allocate length of 80 MIs in case you will receive a message with 160 characters long. You can find example in VisiLogic example Project examples\Communications\SMS\V570_Display_any_SMS.vlp Link to comment Share on other sites More sharing options...
dan_lorentz Posted December 13, 2011 Author Report Share Posted December 13, 2011 Thanks Ofir. That is is exactly what I was looking for. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now