As usual, I know what I want to do but now how to do it in a PLC.

Say I have the a number ... 25, 299 (Rx)

I want to subtract 1000 till I get below 1000 (so it is a three digit number .... 999 or less). I am keeping track of how many times I do this so I know how many 1000's I have.

The command is simple ... if Rx is greater or equal to 1,000 ... subtract 1,000 and save to the same location Rx (so Rx now equals 24,299) ... and add 1 to a counter (say Ry ... now equals 1)

Now, I want to just back to the same command before going ahead to the next.

I want ....... if Rx is greater or equal to 1,000 ... subtract 1,000 and save to the same location Rx (so Rx now equals 23,299) ... and add 1 to a counter (say Ry ... now equals 2)

I want to continue this till ... Rx now equals 299 ... and Ry ... now equals 25

So, how do I do this?

I don't want to loop through the entire program as the next rung on the ladder requires me to use the Ry value (25).

I looked at GOTO and at LOOP ... neither of these seem to do what I want.

What I need is something that will say if Rx is greater or equal to 1,000 go to rung XX (jump back to the previous rung) ... if less then do nothing and continue with the program.

Thanks ..... Mike

Say I have the a number ... 25, 299 (Rx)

I want to subtract 1000 till I get below 1000 (so it is a three digit number .... 999 or less). I am keeping track of how many times I do this so I know how many 1000's I have.

The command is simple ... if Rx is greater or equal to 1,000 ... subtract 1,000 and save to the same location Rx (so Rx now equals 24,299) ... and add 1 to a counter (say Ry ... now equals 1)

Now, I want to just back to the same command before going ahead to the next.

I want ....... if Rx is greater or equal to 1,000 ... subtract 1,000 and save to the same location Rx (so Rx now equals 23,299) ... and add 1 to a counter (say Ry ... now equals 2)

I want to continue this till ... Rx now equals 299 ... and Ry ... now equals 25

So, how do I do this?

I don't want to loop through the entire program as the next rung on the ladder requires me to use the Ry value (25).

I looked at GOTO and at LOOP ... neither of these seem to do what I want.

What I need is something that will say if Rx is greater or equal to 1,000 go to rung XX (jump back to the previous rung) ... if less then do nothing and continue with the program.

Thanks ..... Mike

## Comment