G21 Writing a parameter field synchronously

Question:

What does synchronous writing of parameters with G21 mean?

Answer:

In contrast to the direct assignment with ': Pnnnn=Wert)' the value is not assigned in advance by the interpreter, but time synchronously to the program execution in the coarse interpolator. The G21 can  consequently be used in order to store time critical files in the parameter field.

The following example shows the difference between the 'simple' parameter field assignment and the G21. For this purpose, in the following the values from a table with 15 entries are supposed to be registered to the PLC as of P1510 step by step via P1500:

N10 P1501=1510 Initialise loop counter
N20 G21 E1500 X=PP1501 Value from the table to P1500
N30 M25 Signal to SPS
N40 P1501=P1501+1 Increase loop counter
N50 G27 X20 Z15 Jump to N20

In '20' the value is taken from the table by the interpreter and a command for writing P1500 is entered in the loading puffer of the coarse interpolator. Then the M-function is written in the loading puffer. Consequently, the correct order of P-field-writing and M-function execution is ensured.

As said already, the G21 is only intended to be used for writing parameters, which are required by the PLC synchronously to the program execution in the interpolator!

URL for linking this AKB article: https://www.lenze.com/en-de/go/akb/200704793/1/
Contact form