Sign in to follow this  
Followers 0
Guest curielj

subroutines

5 posts in this topic

jay, I usually use allen bradley in automation application, but right now I'm inmerse in a project where the PLC is a cqm1-21. The way you can program a subroutine in allen bradley is very simple but in omron it's quite different. Have you an example that use at least two subroutines so I could understand how it works. The application that I'm gonna do start 8 motors using only one softstarter (saftronics as6) so the start bit it's a common parameter for every subroutine. I'm from Dominican Republic that 's why my poor english, sorry. thanks, jorge Edited by curielj

Share this post


Link to post
Share on other sites
I've never used Subroutines in AB PLC's however I have used them in Omron PLC's. I have attached a very simple example. One thing to be careful of though is the the defined subroutine with SBN and associated RET must be the last bit of code in the program just before the END instruction. Also may i suggest that if you are looking to replicating code with (ie the same type of code for a number of motors) then may i suggest that you look at the MACRO instruction. Used correctly this can save a lot of time and can econmise on logic usage. SBN.PDF
1 person likes this

Share this post


Link to post
Share on other sites
is it possible to call subroutine that contains TIMER by macro function? i meant, sharing a timer for different inputs and outputs it seemed unlogical to me, well just try my luck to see if there's any wonder~~

Share this post


Link to post
Share on other sites
No, it is not possible to call a MCRO routine with a timer embedded. Forget MCRO. Concentrate on SBS, SBN and RET.

Share this post


Link to post
Share on other sites
maybe this will help you , this is a program I wrote some time ago for a CPM2A, you will find the subroutines in "main11" and the macro in "main10", its for Syswin 3.4, or convert to CX, there are some functions that wont work between subroutines MANIF04B.swp

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