英字刻印 NCマクロ
- A〜Zのアルファベットを刻印できるマクロです。
- 引数Sを変更することで、様々な大きさの文字に対応できます。
- メインのプログラムに「G65P_A_F_S_U_X_Y_」を追加するだけ。
マクロ % O11(A-Z MOJI MACRO) (A=MOJI 1-26) (F=KAKOU SPEED) (S=MOJI SIZE) (U=KAKOU FUKASA) (X=X POSITION) (Y=Y POSITION) GOTO#1 N1 G01X#24Y#25F5000 X[0-0.18*#19+#24]Y[0-0.32*#19+#25]F3000 Z10. Z1.F1000 Z#21F#9 X#24Y[0.34*#19+#25] X[0.18*#19+#24]Y[0-0.32*#19+#25] X[0.1173*#19+#24]Y[0-0.09*#19+#25] X[0-0.1173*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N2 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.32*#19+#25] X#24 G03Y[0.03*#19+#25]R[0.175*#19] G01X[0-0.16*#19+#24] X#24 G03Y[0.34*#19+#25]R[0.155*#19] G01X[0-0.16*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N3 G01X#24Y#25F5000 X[0.17*#19+#24]Y[0.17*#19+#25] Z10. Z1.F1000 Z#21F#9 G03X[0-0.17*#19+#24]R[0.17*#19] G01Y[0-0.15*#19+#25] G03X[0.17*#19+#24]R[0.17*#19] G01Z10.F1000 Z50.F3000 GOTO900 N4 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.32*#19+#25] X[0-0.09*#19+#24] G03X[0.16*#19+#24]Y[0-0.07*#19+#25]R[0.25*#19] G01Y[0.09*#19+#25] G03X[0-0.09*#19+#24]Y[0.34*#19+#25]R[0.25*#19] G01X[0-0.16*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N5 G01X#24Y#25F5000 X[0.15*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X[0-0.15*#19+#24] Y[0.04*#19+#25] X[0.12*#19+#24] X[0-0.15*#19+#24] Y[0-0.32*#19+#25] X[0.16*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N6 G01X#24Y#25F5000 X[0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X[0-0.16*#19+#24] Y[0.04*#19+#25] X[0.09*#19+#24] X[0-0.16*#19+#24] Y[0-0.32*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N7 G01X#24Y#25F5000 X[0.17*#19+#24]Y[0.17*#19+#25] Z10. Z1.F1000 Z#21F#9 G03X[0-0.17*#19+#24]R[0.17*#19] G01Y[0-0.15*#19+#25] G03X[0.17*#19+#24]R[0.17*#19] G01Y[0-0.32*#19+#25] Y[0.02*#19+#25] X[0.05*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N8 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0-0.32*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0.34*#19+#25] Y[0.05*#19+#25] X[0.16*#19+#24] Y[0.34*#19+#25] Y[0-0.32*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N9 G01X#24Y#25F5000 X[0-0.05*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X[0.05*#19+#24] X#24 Y[0-0.32*#19+#25] X[0-0.05*#19+#24] X[0.05*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N10 G01X#24Y#25F5000 X[0.17*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.15*#19+#25] G02X[0-0.17*#19+#24]R[0.17*#19] G01Z10.F1000 Z50.F3000 GOTO900 N11 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.32*#19+#25] Y[0-0.05*#19+#25] X[0.12*#19+#24]Y[0.34*#19+#25] X[0-0.04*#19+#24]Y[0.1171*#19+#25] X[0.17*#19+#24]Y[0-0.32*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N12 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.32*#19+#25] X[0.16*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N13 G01X#24Y#25F5000 X[0-0.17*#19+#24]Y[0-0.32*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0.34*#19+#25] X[0-0.12*#19+#24] X#24Y[0-0.32*#19+#25] X[0.12*#19+#24]Y[0.34*#19+#25] X[0.17*#19+#24] Y[0-0.32*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N14 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0-0.32*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0.34*#19+#25] X[0.16*#19+#24]Y[0-0.32*#19+#25] Y[0.34*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N15 G01X#24Y#25F5000 X[0-0.17*#19+#24]Y[0.17*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.15*#19+#25] G03X[0.17*#19+#24]R[0.17*#19] G01Y[0.17*#19+#25] G03X[0-0.17*#19+#24]R[0.17*#19] G01Z10.F1000 Z50.F3000 GOTO900 N16 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0-0.32*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0.34*#19+#25] X#24 G02Y#25R[0.17*#19] G01X[0-0.16*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N17 G01X#24Y#25F5000 X[0-0.17*#19+#24]Y[0.17*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.15*#19+#25] G03X[0.17*#19+#24]R[0.17*#19] G01Y[0.17*#19+#25] G03X[0-0.17*#19+#24]R[0.17*#19] G01Z10.F1000 X[0.04*#19+#24]Y[0-0.13*#19+#25] Z1.F1000 Z#21F#9 X[0.15*#19+#24]Y[0-0.34*#19+#25] G01Z10.F1000 Z50.F3000 GOTO900 N18 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0-0.32*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0.34*#19+#25] X#24 G02Y[0.02*#19+#25]R[0.16*#19] G01X[0-0.16*#19+#24] X[0.0311*#19+#24] X[0.16*#19+#24]Y[0-0.32*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N19 G01X#24Y#25F5000 X[0.15*#19+#24]Y[0.19*#19+#25] Z10. Z1.F1000 Z#21F#9 G03X[0-0.0507*#19+#24]Y[0.0488*#19+#25]R[0-0.15*#19] G01X[0.0574*#19+#24]Y[0.01*#19+#25] G02X[0-0.17*#19+#24]Y[0-0.15*#19+#25]R[0-0.17*#19] G01Z10.F1000 Z50.F3000 GOTO900 N20 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X[0.16*#19+#24] X#24 Y[0-0.32*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N21 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 Y[0-0.16*#19+#25] G03X[0.16*#19+#24]R[0.16*#19] G01Y[0.34*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N22 G01X#24Y#25F5000 X[0-0.17*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X#24Y[0-0.32*#19+#25] X[0.17*#19+#24]Y[0.34*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N23 G01X#24Y#25F5000 X[0-0.19*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X[0-0.095*#19+#24]Y[0-0.32*#19+#25] X#24Y[0.34*#19+#25] X[0.095*#19+#24]Y[0-0.32*#19+#25] X[0.19*#19+#24]Y[0.34*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N24 G01X#24Y#25F5000 X[0-0.14*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X[0.17*#19+#24]Y[0-0.32*#19+#25] Z10.F1000 X[0-0.17*#19+#24]Y[0-0.32*#19+#25] Z1.F1000 Z#21F#9 X[0.14*#19+#24]Y[0.34*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N25 G01X#24Y#25F5000 X[0-0.15*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X#24Y[0.02*#19+#25] X[0.15*#19+#24]Y[0.34*#19+#25] X#24Y[0.02*#19+#25] Y[0-0.32*#19+#25] Z10.F1000 Z50.F3000 GOTO900 N26 G01X#24Y#25F5000 X[0-0.16*#19+#24]Y[0.34*#19+#25] Z10. Z1.F1000 Z#21F#9 X[0.16*#19+#24] X[0-0.18*#19+#24]Y[0-0.32*#19+#25] X[0.18*#19+#24] Z10.F1000 Z50.F3000 GOTO900 N900 M99 %
メインプログラム例 % O2(A-Z MOJI MAIN) G17 G90 G00G54X0Y0 G43Z50.H1 M3S4000 M8 G65P11A1.F200S10.U-0.5X0Y0 G65P11A2.F200S10.U-0.5X5.Y0 G65P11A3.F200S10.U-0.5X10.Y0 G65P11A4.F200S10.U-0.5X15.Y0 G65P11A5.F200S10.U-0.5X20.Y0 G65P11A6.F200S10.U-0.5X25.Y0 G65P11A7.F200S10.U-0.5X30.Y0 G65P11A8.F200S10.U-0.5X35.Y0 G65P11A9.F200S10.U-0.5X40.Y0 G65P11A10.F200S10.U-0.5X45.Y0 G65P11A11.F200S10.U-0.5X50.Y0 G65P11A12.F200S10.U-0.5X55.Y0 G65P11A13.F200S10.U-0.5X60.Y0 G65P11A14.F200S10.U-0.5X0Y-15. G65P11A15.F200S10.U-0.5X5.Y-15. G65P11A16.F200S10.U-0.5X10.Y-15. G65P11A17.F200S10.U-0.5X15.Y-15. G65P11A18.F200S10.U-0.5X20.Y-15. G65P11A19.F200S10.U-0.5X25.Y-15. G65P11A20.F200S10.U-0.5X30.Y-15. G65P11A21.F200S10.U-0.5X35.Y-15. G65P11A22.F200S10.U-0.5X40.Y-15. G65P11A23.F200S10.U-0.5X45.Y-15. G65P11A24.F200S10.U-0.5X50.Y-15. G65P11A25.F200S10.U-0.5X55.Y-15. G65P11A26.F200S10.U-0.5X60.Y-15. M9 M5 G91G28Z0 M02 %
引数
- A …刻印する文字(1〜26 → A〜Zに対応)
- F …送り速度
- S …文字サイズ(文字高さmm 小数点可)
- U …Z軸加工位置
- X …文字中心X座標
- Y …文字中心Y座標
NCマクロ一覧
刻印 |
---|
記号刻印 |
数字刻印 |
英字刻印 |
芯出しプログラム |
3点で円の芯出し |
丸穴 |
穴あけヘリカル |
穴仕上げ |
穴あけドリルサイクル |
穴あけノンステップ |
ヘリカルステップ |
丸穴チョッピング |
丸穴ジグ研削 |
長穴 |
長穴ヘリカル |
長穴仕上げ |
長穴チョッピング |
角穴 |
四角穴 |
ねじ |
めねじヘリカル1ピッチ |
めねじヘリカル2ピッチ |
おねじヘリカル1ピッチ |
めねじヘリカル 単玉工具用 |
おねじヘリカル 単玉工具用 |
丸外周 |
丸外周ヘリカル |
丸外周仕上げ |
角外周 |
四角外周 コーナーR |
その他 |
四つ角 C面 |
トロコイド |
複合マクロ |
円 内外周+面取り |
長円 内外周+面取り |
四角 内外周+面取り |
直線加工+面取り |
円弧 内外周+面取り |
お知らせ
- 当サイトのPDF版を作成しました。教育資料やリファレンスとして使用して頂ければと思います。
→ NCプログラムの教科書 - 上級編も作成しました。
→ NCプログラム上級編