toolClass set incorrectly
toolClass set incorrectly
Linux 6.1.57. toolClass appears not to be getting set until after the post runs. Created the attached minimal post to demonstrate. I've got a job with three operations: two using a plasma tool and one using a plate marker. First I ran the plate marker operation, and you can see that the toolClass shows up as 'nil' (delteme-scribe.tap). Next I run the post on both plasma operations (deleteme-plasma.tap), and toolClass == 'MarkerTool'. Then I ran it on the plate marker operation again and I got PlasmaTool.
- Attachments
-
- deleteme-scribe.tap
- (36 Bytes) Downloaded 77 times
-
- deleteme-plasma.tap
- (43 Bytes) Downloaded 91 times
-
- deleteme.scpost
- (116 Bytes) Downloaded 76 times
- Les Newell
- Site Admin
- Posts: 3667
- Joined: Thu May 11, 2006 8:12 pm
Re: toolClass set incorrectly
That is to be expected. toolClass is set just before OnToolChange() is called.
The sequence of calls is:
OnNewPart()
OnNewOperation()
---- toolClass is set here -----
OnToolChange()
The sequence of calls is:
OnNewPart()
OnNewOperation()
---- toolClass is set here -----
OnToolChange()
Re: toolClass set incorrectly
Thanks Les. Maybe setting it back to nil at the end of a post run and a mentioning in the toolClass post docs about when it gets set would help future head-scratchers.
More generally, I'm trying to get linuxcnc not to turn on the torch when I'm running a toolpath for the (unpowered spring) scribe. Is there a standard way to do that? Otherwise I'm thinking I should, like, put the torch on the coolant channel and explicitly turn it on when toolClass is PlasmaTool. What function do I want in the post to catch all the times when the torch should be on?
More generally, I'm trying to get linuxcnc not to turn on the torch when I'm running a toolpath for the (unpowered spring) scribe. Is there a standard way to do that? Otherwise I'm thinking I should, like, put the torch on the coolant channel and explicitly turn it on when toolClass is PlasmaTool. What function do I want in the post to catch all the times when the torch should be on?
Re: toolClass set incorrectly
Huh, okay, looks like the default LinuxCNC.scpost doesn't have an OnPenDown(), so that's why I wasn't seeing M03 in the generated code when using that post, and looks like the other variants do have that and conditionally send it based on tool type, which is what I wanted.
- Les Newell
- Site Admin
- Posts: 3667
- Joined: Thu May 11, 2006 8:12 pm
Re: toolClass set incorrectly
It sounds like you weren't looking at a plasma post. Milling/routing posts don't generally use OnPenDown/OnPenUp.