Hello all I wrote my first g code program and it happens to be a thread milling one and I have a bit of trouble with it though. I called it up in Mazatrol as a sub program and when i tryed to run it, it says Soft Limit +Z error and the machine freezes? This is for a 1.25X11.5 NPT that is 1" deep. The tool has a diameter of 1.1024. Here is my program

T31
M06
G90 G54 G00 X0 Y0 S1698 M3 T31
G43 Z4.0 H02 M08 ( i didnt do the M08 because i was doing a dry run)
Z-1.0
G41 X0.6024 Y-0.0515 D52 ( heres where my problems may begin i dont know what a D52 does but it was in the book i was using to do this)
G03 X0.5512 Y0 Z-0.9782 I0 J0.0515 F3
Z-0.89125 I-.5512 J0
X0.6024 Y-0.0515 Z-0.869515 I-0.0515 JO
G40 G00 X0 Y0 M09
G28 Z1.0 M05
M30

I took alot of this information of codes from a book but im not 100% sure of the purpose of all of them. Any help would be appreciated!!!!!