gazza29 Posted January 8, 2022 Report Share Posted January 8, 2022 hi have a programme thats sends an alarm via sms when there is a problem the trouble is i cant figure out how to make the sms send once and not constantly any help would be most grateful thanks Gary Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted January 8, 2022 MVP 2022 Report Share Posted January 8, 2022 The main problem in your program is not sending SMS. The main problem is alarm management. When an error occurs, you use the error bit as a sign that sends the message. In my opinion, the bit of a certain error should set (via transition) the bit of sending the appropriate SMS message which will be automatically reset after its transmission. The main thing to understand - you should not operate with the alarm status. You must use only the fact of its change - transition to set and transition to reset SMS send bit for manage messages. That is, operating in this way you will receive as many messages as the number of times the error occurred. You are now sending a message all the time when the error is active. Quote Link to comment Share on other sites More sharing options...
gazza29 Posted January 9, 2022 Author Report Share Posted January 9, 2022 hi Kratmel, not sure i understand what you mean have you got ann example to show me please Gary Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted January 9, 2022 MVP 2022 Report Share Posted January 9, 2022 On this image i try to explane.... I do not know how you build alarms in your project. On image - if alarm source is active - "ALARM_1_ACTIVE" bit is enabled. If alarm source is disabled - ALARM_1_ACTIVE bit still enabled. Only "RESET ALARMS" - disable "ALARM_1_ACTIVE" bit. "ALARM_1_ACTIVE" bit Positive transition -|P|- set "Send SMS_bit". "Send SMS_bit" is reset after SMS sended to user. Then SMS is sended once, next one is sended only if "ALARM_1_ACTIVE" bit is reset (by user) and set by alarm source. P.S. Please note - this sample only for idea demonstration. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.