Sign in to follow this  
Followers 0
got

General ladder programming (big doubt)

8 posts in this topic

hi, i program in ladder an have a net like that : is it normal that when MI208 is equal to 19 and i push MB 153 my value goes to 1 and not to 20. infact the "first" line is execute and the the second too. i thought that in ladder when the first line is executethe second wasn't. Am i wrong ... Thanks

Share this post


Link to post
Share on other sites
It definitely depends on how your PLC scans. It seems as though you are scanning left to right, then down one row, then left to right, etc. That would explain the result. If you change your >= instruction to a > instruction your code would probably work as you expect, assuming you want it to count up to 20 then on the next scan reset back to 1.

Share this post


Link to post
Share on other sites
As long as the condition in front is true, the next object will execute. So in your example if you turn on MB153 both of those lines become active.

Share this post


Link to post
Share on other sites
But whith a |p| this means it's active with a pulse so only during on plc cycle... thank you for the solution but there is a lot of one the probleme was a general problem with ladder coding. i wanted to know what is the right way to do. i heard about an IEC 1031 that explain the rules but it seems to be non-free thank you

Share this post


Link to post
Share on other sites
Don't know anything about IEC 1031, but IEC 1131 (now 61131-3) covers PLC programming languages. All the |P| contact does is activate for one scan, so all the logic after it will happen once. Not one line, one entire scan of the PLC program.

Share this post


Link to post
Share on other sites
yes this is IEC 1131 that was a mistake. For the pulse that's what i tought so if the pulse is active for one plc scan only, then there will only be the incrementation bu not the test after it?

Share this post


Link to post
Share on other sites
The P in this case would also indicate to me a postivie edge trigger where an N would be a negative edge

Share this post


Link to post
Share on other sites
No. Everything connected after the pulsed contact will run once, not just one line... That would include all of the logic in your picture. But it will only run once on the rising edge of address MB153.

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