According to my list, the M41 is Spindle Gear Range 1, but I don't see a M3 (Spindle CW) or M4 (Spindle CCW) on your picture which is a bit odd. But understand I am no expert on Okuma or Fanuc for that matter. G33 (Fixed thread cutting cycle) by the description seems like a G32, but I'm not sure. In the example code below, the idea is to make a pass everytime a G32 is commanded, with a fadeout at the end of the thread. X and Z reposition at the start of the thread for each successive pass. Conversely, G71 combines this all into one line of code using a number of parameters. As near as I can tell, the M33/M34 tells the controller to fadeout the thread at the end (or not), not sure where this is invoked. Fusion 360 has a switch to fadeout or not.


This is a Haas turning post from Fusion 360, 9mm x 1.25 thread, 1 inch long converted to Imperial units. 5 passes with a spring pass. This will run on my lathe, but your lathe might choke on it. If you choose to try this be very careful, turn the feed and rapid way down.

(Thread1)
N15 T100
N16 G99
N17 M22
N18 G97 S200 M3
N19 G54
N20 M8
N21 G0 X1.154 Z0.1969
N22 G1 Z0.246 F1.5748
N23 X0.3323
N24 G32 Z-0.9916 F0.0492
N25 X0.3491 Z-1. F0.0492
N26 G1 X1.154 F1.5748
N27 Z0.246
N28 X0.3155
N29 G32 Z-0.9832 F0.0492
N30 X0.3491 Z-1. F0.0492
N31 G1 X1.154 F1.5748
N32 Z0.246
N33 X0.2987
N34 G32 Z-0.9748 F0.0492
N35 X0.3491 Z-1. F0.0492
N36 G1 X1.154 F1.5748
N37 Z0.246
N38 X0.2819
N39 G32 Z-0.9664 F0.0492
N40 X0.3491 Z-1. F0.0492
N41 G1 X1.154 F1.5748
N42 Z0.246
N43 X0.2651
N44 G32 Z-0.958 F0.0492
N45 X0.3491 Z-1. F0.0492
N46 G1 X1.154 F1.5748
N47 Z0.246
N48 X0.2651
N49 G32 Z-0.958 F0.0492
N50 X0.3491 Z-1. F0.0492
N51 G1 X1.154 F1.5748
N52 Z0.1969