plasma THC define custom tool parameter for THC set volts

Having problems with or questions about SheetCam? Post them here.
Post Reply
retropower
Posts: 7
Joined: Thu Nov 09, 2023 9:58 am

plasma THC define custom tool parameter for THC set volts

Post by retropower »

Hi Folks,

please bear with me I'm an absolute know-nowt regarding gcode and post processors!

I run a plasma table with a Razordance THC unit.

I can set the desired cut volts for this via the S word in my gcode on tool changes

I want to be able to do this via the tools set in sheetcam

I'm led to believe that I can do this by defining a custom tool parameter which is done in the post processor, then calling this parameter at tool changes in the post processor.

To that end I have added this line:

post.DefineCustomToolParam("PlasmaTool", "THC volts", "setvolts", sc.unit0DECPLACE, 49, 0, 200)

and then this is my tool change section:

function OnToolChange()
post.Text (" M06 T")
post.Number (tool, "0")
post.ModalNumber(" F",feedRate * scale,"0.#")
post.Text (" S")
post.Number (setvolts, "0")
post.Text (" (", toolName, ")\n")
end

This doesn't work, when I try to save the post processor edit it says that this bit is wrong: post.DefineCustomToolParam("PlasmaTool", "THC volts", "setvolts", sc.unit0DECPLACE, 49, 0, 200)

pardon my probable stupidity! Does that line need to be in a particular context? What have I done wrong?

thanks in advance!
retropower
Posts: 7
Joined: Thu Nov 09, 2023 9:58 am

Re: plasma THC define custom tool parameter for THC set volts

Post by retropower »

this is the error i get
Attachments
IMG-53251.jpg
IMG-53251.jpg (1.38 MiB) Viewed 58793 times
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: plasma THC define custom tool parameter for THC set volts

Post by djreiswig »

Which section did you insert the define in? I believe it has to be in a certain place. Look at another post that has a custom parameter and see where it goes.
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: plasma THC define custom tool parameter for THC set volts

Post by Les Newell »

DefineCustomToolParam should be outside of any functions. Code that is outside of a function will execute immediately when the post is selected in machine options, or when an edited post is saved.

Having said that, even if you do have that code inside a function you should not get that error. I just pasted that line into a post here and it ran fine.
Just a thought, is there an error in the code immediately preceding line? In some cases you can get an error where preceding code is actually the problem. Missing brackets in particular can cause some odd errors.

If you can't find the issue send me a copy of the post and I'll take a look at it.
retropower
Posts: 7
Joined: Thu Nov 09, 2023 9:58 am

Re: plasma THC define custom tool parameter for THC set volts

Post by retropower »

Thanks Les,

I have sent you a message with a copy of the post processor.

I tried with DefineCustomToolParam inside and outside functions, and in various places within the post. When it was within a function obviously it didn't immediately run so the error didn't show, but obviously it didn't work either.

I've checked brackets and formatting and can't see anything amiss.

Removing the custom tool parameter line restores the post processor to its former operation which has always been perfect

It's very odd!

as a background to this, I have run my plasma table since 2017 without the THC (this was never set up by the supplier, who just said that it didnt have thc, in reality it was incorrectly installed and didn't work) since it's z touchoff and I don't cut many huge parts its never been a real problem. Recently we have been looking at laser cutters to improve cutting on smaller parts, but we cant really stretch to a nice fibre laser, and an older co2 laser is a bit power hungry and won't really work with our power supply situation. off the back of that i gained the impetus to actually get the razordance THC working. Having rewired it, re-installed mach 3 and done a few other changes I now have working DTHC and its absolutely amazing, literally faultless. At the moment I have to set the volts manually though and that's whats prompted me to try and set the volts in sheetcam so my guys have an easy to use system and I don't get a daily questioning on how to use it.
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: plasma THC define custom tool parameter for THC set volts

Post by Les Newell »

I just tried your post here and it worked. What version of SheetCam are you using?
retropower
Posts: 7
Joined: Thu Nov 09, 2023 9:58 am

Re: plasma THC define custom tool parameter for THC set volts

Post by retropower »

just checked, I'm on version 4.0.2
retropower
Posts: 7
Joined: Thu Nov 09, 2023 9:58 am

Re: plasma THC define custom tool parameter for THC set volts

Post by retropower »

can I just install a newer version with my existing licence?

thanks
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: plasma THC define custom tool parameter for THC set volts

Post by Les Newell »

As long as you have SheetCam TNG then yes, your license will work with the latest version.
retropower
Posts: 7
Joined: Thu Nov 09, 2023 9:58 am

Re: plasma THC define custom tool parameter for THC set volts

Post by retropower »

Thanks Les!!

problem is solved!

Yes, updated sheetcam and now everything is perfect!

Much appreciated

thanks again

Nat at Retropower
finyuk2005
Posts: 12
Joined: Wed Mar 27, 2024 5:06 pm

Re: plasma THC define custom tool parameter for THC set volts

Post by finyuk2005 »

hope you dont mind me hijacking this thread,
But i am struggling to get my Razordance THC to work, and wondered if you have any tips/things to look out for?

cheers!
Post Reply