RS Logix 5000 - FOR block called routine keeps looping

mejadiaz

Member
Join Date
May 2020
Location
San Juan
Posts
9
Hello,
I am programming a ladder routine that finds a part on a conveyor that has a given part number. I am having no problem finding the part and assigning a tag to its position. However, then I need to compare it with another pointer tag and calculate how much I need to move my conveyor to reach the position of that compared to tag. And then I need to update an offset tag that moves around a few pointer tags in the conveyor. The problem I am having is that I use a FOR block that executes as many times as I will need to move my conveyor and it evaluates the value in the offset tag. Since it is a cyclical conveyor, if the tag has a value of 18, I move the value to 0. If the offset has a value less than or equal to 16, I sum 2 to the tag. In other words. If I need to move my conveyor 3 times, I will sum 6 to the offset. But if the offset is at 18, I need to reset it to 0 before I sum 2 more. The FOR executes and exits fine. But the offset value keeps having +2 added and reset to 0 infinitely. It doesn't stop after the FOR loop is done.
 
Last edited:
Nevermind, I finally found where the loop was occurring. It was somewhere else. But it was so fast that the only value that changed was the one corresponding to the offset tag being modified by the FOR loop.
 

Similar Topics

Hello, I am struggling to find a block that does the exact same thing. the A/M block has everything a PID has except for the CV and PV. the (A)...
Replies
1
Views
2,373
While troubleshooting control issues due to windup, it would be helpful to be able to view the error term due specifically to the error term in...
Replies
5
Views
1,886
I had an and block that wasn't anding today. Inputs were true but the output wasn't true. Please see picture. I ended up going into editing...
Replies
2
Views
2,134
Hi guys, I have a Project with PID block, but When I config Parameters, only Ki effect to system, others are not... I don't know how to control...
Replies
2
Views
2,524
Hello. I'm a constant visitor to this forum but this is my first post. I searched previous threads but didn't find anything related to my question...
Replies
1
Views
1,749
Back
Top Bottom