Rob Nelson

Programming Question

8 posts in this topic

Hello all and thank you for letting me post on your Forum...

                           I am somewhat new to PLC programming and have been tasked to add a 4th stand to a POKA YOKE machine we are currently using.  I basically copied another stands logic and added new address names and what not.  I can not find anything wrong with my ladder logic, but for some reason it is not turning any of my OTE's on.  I am pretty sure it is something I am doing wrong, being kind of new to this.  Just wondered if any experienced programmers could take a look at what I have and see what they think could be the problem.  Please see the attached picture.  Note that B11:17/0  DOES  turn on properly when the HMI button is pressed.  59761cee8e1ec_MANIFOLDPOKAYOKEPLCISSUE1.

 

Thank you!!

                         Rob

Edited by Rob Nelson

Share this post


Link to post
Share on other sites

Have you checked Lad 2 (Main) to make sure there is a JSR instruction for your new subroutine Lad 10?

3 people like this

Share this post


Link to post
Share on other sites

What you believe is that B11:19.0 is not going HIGH long enough for the N7:4 indexer to be incremented, correct?  

What makes B11:17.0 go HIGH?  Put a counter branched around B11:19.0 coil to track if/when the bit is going HIGH.

Share this post


Link to post
Share on other sites

AndrewG,  

              I did not add the JSR to LAD 2.  I will try to add this and see if that helps.  Thanks!!

Share this post


Link to post
Share on other sites

Rob,

The SLC-500 and MicroLogix operating system executes only LAD2 automatically. 

The STI (timed interrupt) and DII (discrete interrupt) routines can also execute routines.

But otherwise, every subroutine needs to be called from another routine.    Probably 90% of all MicroLogix programs include a section of LAD2 that's nothing but JSR's to run the other program routines.

 

Share this post


Link to post
Share on other sites

Thanks for the help guys!  I added the JSR instruction and everything started working properly!  

Share this post


Link to post
Share on other sites

Glad it worked, after forgetting to add the JSR instruction in my logic about 3-4 times in the past it's one of the first things I check when I'm having issues.

Share this post


Link to post
Share on other sites

To Andrew's point, I used to forget two couple other "standards" for RSLogix500 programs.

First, the very last rung in LAD2 should be an OTU of S:5/0, the math overflow trap.  This allows you to determine the math overflow without faulting the processor.

Second, I always have rung somewhere about halfway through LAD2 tied to trigger an SVC on Channel 0 (a service communication interrupt).  For no other reason than to interrupt the scan long enough for the HMI to update and to allow your PC to get refreshed values.

Edited by pcmccartney1
1 person likes this

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