Sign in to follow this  
Followers 0
namang

Functions in Ladder Logic

2 posts in this topic

Hello,

I wanted to know if it is possible to create a user defined function in Ladder Logic when programming through Studio 5000. I intend to write a specific logic, then move it all into one single block (the "function"). Can I then just call this one single block later into the program, instead of having to write all the logic once again?

Thanks.

Share this post


Link to post
Share on other sites

Studio5000 supports user defined function blocks, referred to as Add-On Instruction (AOI).  AOIs are built in Studio5000, where one declares the global variables going in and coming out, then you select the new AOI to go into it and add the code.

Once you have created the AOI, you can reference using it anytime.  You can export the block and import into other projects.

A good rule to go by is to use the tagnames within your AOI the same as they interface outside of the AOI.  It is possible, and I have seen people do this, to change the names of the tags within the AOI.  This makes considerable grief for whoever comes along behind you to troubleshoot the code.  Much like C/C++, one can pass an array of tags into and out of a sub-program and change the name of the tags within the program.

http://literature.rockwellautomation.com/idc/groups/literature/documents/pm/1756-pm010_-en-p.pdf

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