What does G10 L2 P1 mean?+−
Write into the work offset table (L2), in row number 1, which is the G54. P2 would be G55 and so on to P6 = G59; P0 is the common shift added to all of them. The values go after it, in X, Y and Z.
Does G10 replace the value or add to it?+−
It depends on the active mode: under G90 it replaces whatever was in the table and under G91 it adds to it. To set a work offset you use G90; to apply a wear correction measured on the part, G91. Write the mode in the same block as the G10 and do not leave it to whatever modal was there before.
Can you write tool offsets with G10?+−
Yes: on Fanuc, L10 and L11 for length geometry and wear, and L12 and L13 for the radius ones, with P giving the offset number. On a lathe the same block also takes the nose radius with R and the orientation with Q.
Is G10 dangerous to use?+−
It is, to the extent that it modifies permanent data without asking for confirmation and without leaving a visible trace. A wrong P wipes out a properly set work offset, and an inherited G91 shifts the zero on every run. Used with discipline, on the other hand, it takes manual typing out of the loop, which is the other source of errors.
What is the difference between G10 and G52 or G92?+−
G10 writes into the table: the value is stored, visible and available afterwards. G52 and G92 create a shift that lives outside the table and that somebody has to remember to cancel. When the data is permanent, G10; when it is a temporary shift inside a program, G52.