Sign in to follow this  
Followers 0
Damica

Need Program Structure Ideas

4 posts in this topic

Hello: I'm not sure how to go about creating the structure of this program, would like some ideas/help. I have a program that checks/reads 8 analog inputs and compares each input against 4 different settings, if the value is outside any of these settings the program runs a subroutine to send out an email for (Alarm/Event) notification for that particular input. The way the program is structured now is that it reads analog input 0 first and checks against the settings if the reading is not in range it will call a subroutine to send out email for that sensor(analog AI:0.0) then it will return and read for Analog input #1 and check reading and if it needs to it will call another subroutine to send out email for that sensor(analog AI:0.1) and so forth. What I need to add, is a way to count how many times a sensor(input) has sent the alarm email because I want to limit this to 5 notifications after that, stop sending emails. Now this has to be done for each sensor(input).(Note: I would also like to have a timer involved so that it will only send emails about every 15 minutes for 5 counts.) I need this because the plc will send out emails until the error for the sensor has been corrected, this could take a few hours and if I don't have some sort of control, that would result in 1000's of emails being sent and world probably get shut down for spamming. Would like some ideas on how I should go about this. I am using a micrologix 1100 and rslogix 500 software. Thanks

Share this post


Link to post
Share on other sites
I have a few questions: 1. Is it separate rungs for each of the checks or are you using indirect addressing and a loop? 2. Is it live numbers or are you just polling the checks every once and awhile? 2B. If it's live do you have any timers on time between each email sent per device? If not you may want to do that as well. It's possible even if you are using one shots that once and awhile the number will be bouncing in and out of spec. And potentially send all 5 emails in a second. (Example: If it's temperature your measuring and your scaled limit is a max of 100 degrees when your actual temperature is around 100 your AI will likely be bouncing back and forth 99.999 100.001 etc) It depends on how many significant bits you are using but you get the rough idea. 3. Do you still need to call the subroutine on alarm states even if you don't want to send an email? - One way you could limit individual sensors (Making assumptions on the answers to the other questions) is: * As your AI goes into alarm state you can also enable a counter up (CTU). * If the CTU ACC is greater then 0, start a timer. * When the counter reaches 5 then have your done bit false (XIO in this case) the line that triggers both the email and the CTU. * When the 15 minutes on the timer is done activate a CTD on the same counter * If the counter acc is greater than 0 (GRT) restart the timer. (This would allow 5 emails to be sent at your polling rate for the alarms then an additional one every 15 minutes after the first event). (If it reached the max of 5 then after 30 mins of inactivity it would allow 2 emails at alarm polling rate again). * Then repeat that logic for each analog input. Edited by Giarc

Share this post


Link to post
Share on other sites
I want to thank you for your input, I have worked some of this out and your input showed me the direction I needed to go. This is a on-going project will keep you posted.

Share this post


Link to post
Share on other sites
Cool, let me know if you have any problems. Edited by Giarc

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0