I am trying to make my first mill/turn post for a Haas ST30Y and running into a couple issues.

First question... I'm using the tutorial 5 axis post source as a starting point. Is that a good idea or is there a better source file to start from?

Second question: Trying to understand how they calculate things between all the different files. I'm trying to put the live tool rpm in with a P instead of an S. How do I get the variable for the Spindle speed? I tried this:

Code:
:T:IF OPR_SPEED>0 THEN <N><G!:97><M!:SPINDLE_DIR><P!:OPR_SPEED_RPM><EOL>ENDIF
in my :SECTION=SUB_TOOL_CHANGE_MILL and get this output:

Code:
G97 M133 P1   (<--Supposed to be P5000)
The tutorial Post uses <S!> to output S and the spindle speed (S5000 in this example). I can't follow exactly what is happening with it. I think that it is calling the attribute S in the millturn.lib file which is calling the CALC_DEC_REGISTER section? I tried imitating this with a P attribute but didn't work out for me.

Any help would sure be appreciated.