Hi, I'm having some real basic problems with a CustomToolParam for my plasma cutter. I'm trying to define an offset to my touchoff probe value, because it can be off by a bit depending on the tool. I'm writing a custom post for this.
At the top of the post I have this:
Code: Select all
post.DefineCustomToolParam("PlasmaTool", "Probe offset", "probeOffset", sc.unitLINEAR, 0, -20, 20)
Later on my code, in OnPenDown():
Code: Select all
post.NonModalNumber("G92 Z", -probeOffset * scale, format)
Yet when I run the post, I get:
Code: Select all
The post has thrown an error:
... attempt to perform arithmetic on global 'probeOffset' (a nil value)
What's going on here? How do I define this as a tool parameter? I've noticed that some of the built-in post-processors do the post.DefineCustomToolParam thing twice, but I'm not sure why. The post documentation (which is extremely vague, btw) offers no insight into this.