Sign in to follow this  
Followers 0
MikeBUSA

Function Block Best Practices Debate

5 posts in this topic

I have two employees who can't agree on a design. Maybe the good people here at Mr. PLC can help. The debate is how to design the function blocks we know we need. What is the "best practice"?

We have a small assembly machine. Module 1 starts the assembly. When it's complete, the part is indexed via a turn table to Module 2. When Module 2 is complete, the part is indexed to Module 3. When Module 3 is done, the part is released. Simple enough so far, right?

This machine can be expanded to 4 groups of those 3 modules. The customer can purchase the machine in any configuration of 1 to 4 groups. To recap, one group assembles the part.

Here's the debate.

Employee A feels like each module - not the entire group - should be a function block. He wants to create structures for each Module and map variables in and out of it individually with only what is needed. He thinks each  variable should be tightly controlled. So we would have one function block for Module 1 duplicated 4 times. Another function block for Module 2 is created, duplicated 4 times. So on and so forth. The function block would only contain logic for one module. One group would be 3 function blocks.

Employee B feels this is too complicated. He thinks a function block for 3 modules - Module 1, Module 2, and Module 3 should be created. The I/O and variables needed for all 3 modules need to be mapped to the function block. So a function block for Module 1, Module 2, and Module 3 would be duplicated 4 times. Since Omron doesn't support multiple ladder routines, the logic for all 3 modules would be in one routine. A newer version of Sysmac appears to allow navigating through long ladder logic.

An important consideration. Some variables are shared by each module. Employee A thinks that's ok and just need mapped as read-only on the shared function so only the Module sharing information writes to it. Employee B thinks it's too complicated and all variables should be shared unconditionally.

We are at a loggerheads here. We know both ways will work. But nobody knows the way this should be done. Both employees think they are correct and adamant about it. How do I decide?

Share this post


Link to post
Share on other sites

I prefer A's idea.  Provides the most flexibility.  When the functionality of  Module needs to change it would only affect that Module.  The remaining module function blocks stay the same.

Share this post


Link to post
Share on other sites

I'm with A.  One FB per module.  That way if a change has to be made, only one FB is affected.

What do you mean by 'Omron doesn't support multiple ladder routines'?

Share this post


Link to post
Share on other sites
1 hour ago, Crossbow said:

I'm with A.  One FB per module.  That way if a change has to be made, only one FB is affected.

What do you mean by 'Omron doesn't support multiple ladder routines'?

As I understand it, you can only have one ladder routine in a function block. I thought it was odd that someone would want to make a 200 rung ladder routine with multiple modules in it instead of one with only 50 rungs. Maybe it's an Omron thing and I'm trying to learn more. Thanks very much for your feedback.

 

1 hour ago, Crossbow said:
13 hours ago, pcmccartney1 said:

 

 

Share this post


Link to post
Share on other sites

One program of either ladder or structured text is a function block, but in Sysmac the ladder can be broken into multiple sections.  If you were writing scan programs, there is no limit to the number, but yes, a function block is made of one program.

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