Powerchamp

Adding To Current Routine VS Creating New Routine

4 posts in this topic

Hi all,

Has anyone seen any documentation or have any insight into what overhead is added by creating a new routine versus adding logic to an existing one?

I.E what are the pro's and con's of splitting a monster routine into several smaller ones?

Many thanks in advance.

Share this post


Link to post
Share on other sites

I break my program into small routines. I assume that it depends on what the PLC is controlling but I only worked in one business. We have pumps, valves, scaled analogs, alarms, shutdowns... things like that. Each pump gets it's own routine, each valve gets it's on routine. If a tech needs to know why a certain pump doesn't run, all he has to do is check the routine. It could be that the starter tripped. He or she will see that in the failed to start trip. Maybe it's low suction pressure or the valves failed to sequence properly, in which case the tech would then go to the valve routine. You can do the one massive routine program but you're throwing away one of the good parts of the CLX design (and SLC for that matter).

 

PS - what platform are you using?

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites

I would say that using subroutines to subdivide code into easier-to-read pieces is worth any overhead hit it might cause.

IMHO, if your processor is so strapped for resources that subroutines push it over the edge, you probably need a bigger processor anyway.

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