评论
合作者
如中所示,以下变量可用 vars = {
"prbx" : 0.0,
"prby" : 0.0,
"prbz" : 0.0,
"prbcmd" : "G38.2",
"prbfeed" : 10.,
"errline" : "",
"wx" : 0.0,
"wy" : 0.0,
"wz" : 0.0,
"mx" : 0.0,
"my" : 0.0,
"mz" : 0.0,
"wcox" : 0.0,
"wcoy" : 0.0,
"wcoz" : 0.0,
"curfeed" : 0.0,
"curspindle" : 0.0,
"_camwx" : 0.0,
"_camwy" : 0.0,
"G" : [],
"TLO" : 0.0,
"motion" : "G0",
"WCS" : "G54",
"plane" : "G17",
"feedmode" : "G94",
"distance" : "G90",
"arc" : "G91.1",
"units" : "G20",
"cutter" : "",
"tlo" : "",
"program" : "M0",
"spindle" : "M5",
"coolant" : "M9",
"tool" : 0,
"feed" : 0.0,
"rpm" : 0.0,
"planner" : 0,
"rxbytes" : 0,
"OvFeed" : 100, # Override status
"OvRapid" : 100,
"OvSpindle" : 100,
"_OvChanged" : False,
"_OvFeed" : 100, # Override target values
"_OvRapid" : 100,
"_OvSpindle" : 100,
"diameter" : 3.175, # Tool diameter
"cutfeed" : 1000., # Material feed for cutting
"cutfeedz" : 500., # Material feed for cutting
"safe" : 3.,
"state" : "",
"pins" : "",
"msg" : "",
"stepz" : 1.,
"surface" : 0.,
"thickness" : 5.,
"stepover" : 40.,
"PRB" : None,
"TLO" : 0.,
"version" : "",
"controller" : "",
"running" : False,
}
您可以在 g 代码中使用方括号访问这些变量: |
你好,我希望有人能帮助我。我是 Python 的初学者,无法更进一步。我已经将 GCode 与 % 行 python 代码集成在一起,到目前为止一切正常。我的问题是我的代码中需要轴的当前位置,如何将这些位置保存在变量中?然后我想用 %line python 脚本移动到一个新位置,这可能吗?