L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 630

Advertising
background image

L-force | PLC Designer

General Editors

628

DMS 4.1 EN 03/2011 TD29

Example
G-Code

N00 G36 D10 (Set counter to 10)
N10 G91 (Relative mode)
N20 G01 X10 Y10 F100 (Motion to the distance 10/10)
N30 G37 D-1 (Decrement counter)
N40 G20 L20 (Jump, if counter != 0)


This example effects that ten lines are concatenated - by the relative mode, which
results in a straight line movement to 100/100.

Example
Regard, that the jump condition is interpreted at the time of decoding. So, if a variable
X in the logic part of the application is programmed in a way, that it gets FALSE, when
the X-axis exceeds the position 15, then it is obvious that the program jumps to
sentence 20 in the first cycle. Currently X is initially TRUE and the X-position is now 10.
In the second cycle you might think, that the condition for X=FALSE is fulfilled, and so
no jump in sentence 20 is done, because the X-position is 20. But actually the loop is
continuously executed, because the evaluation of the condition is performed at the
time of decoding, when the interpolator is not started yet or is engaged in the
processing of the objects from the beginning of the buffer. The decoder can jump out
of this loop, when so many objects have been created that the buffer got full and
started the interpolator with the execution. Then the condition is fulfilled and the
decoder can exit the loop.
G-Code

N0 G92 X0 Y0
N10 G91 (Relative mode)
N20 G01 X10 Y10 F100 (Motion to the distance 10/10)
N30 G20 L20 O$x$ (Jump, if counter != 0 )


Remedy this, use the command G75. This causes, that the decoder pauses as long in
the processing until the interpolator and with it the mechanic reach the appropriate
position.

Advertising