5 posts in this topic

how to make looping in ladder logic?

but i want to make the data +1 each time until 3 and return back to 0 after reaching 3.

Share this post


Link to post
Share on other sites

There are FOR NEXT loops in most Mitsubishi PLCs.  Or you can use JUMP, but a loop is a better choice.

Share this post


Link to post
Share on other sites

-----Mov K0 D0

-----[FOR K3]

-----INC D0

-----[NEXT]

D0 will be 0,1,2,3. This will happen every scan and you will only be able to use the final evaluated value D0=3 (unless you move the intermediate values to other locations using index registers).

Share this post


Link to post
Share on other sites

I use a more basic but time consuming method.

MOV K0 D0

=K0 D0

Instructions and after MOV K1 D0

=K1 D0 Instructions and after MOV K2 D0

=K2 D0 instructions and after MOV K3 D0

=k3 D0 -> Mov K0 D0 

And it goes in a loop

Share this post


Link to post
Share on other sites
21 hours ago, christophertedjo said:

how to make looping in ladder logic?

but i want to make the data +1 each time until 3 and return back to 0 after reaching 3.

I suspect that you would like to do something in your program depending on the value in your counting register.

Then you might want to increment the value after a time delay or perhaps a status change.

This will change your value after one seconds delay.

|--(M8013)--[INCP D0]- Increment value in D0 on rising edge of M8013 (Seconds pulse in the FX systems)

|--(D0 > K3)--[RST D0]- Clear D0 if the value of D0 is greater than 3.

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