CAM Warning meaning

CAM Warning meaning

timothyhinessr
Advocate Advocate
1,988 Views
8 Replies
Message 1 of 9

CAM Warning meaning

timothyhinessr
Advocate
Advocate

After making the first run of some wheel spacers I designed, I decided to replace some edge chamfers with a radius using a 1/4 round end mill.  This required adding the radius feature to the CAD model after having already generated all the tool paths for the other operations.  I have three different variations of the spacer so making the changes to each required a fair amount of work.  Now when I post process the programs, I get the following warning:

 

Warning: (/Users/Tim/Autodesk/Fusion 360 CAM/Posts/PPWithProbing.cps:1898) redeclaration of function onParameter

 

I've searched the forum, YouTube and Google and can't find an explanation for this warning.  I'm using a post processor from David Loomes for my Tormach 1100MX.  It appears to post process fine and everything acts the same as before.  I'm not able at this time to actually run the program so I don't know if this is going to be a problem when it comes time to actually make the parts.  I've attempted to attach the file to this post.  Any suggestions would be appreciated.

 

Thanks, Tim

0 Likes
Accepted solutions (1)
1,989 Views
8 Replies
Replies (8)
Message 2 of 9

serge.quiblier
Autodesk
Autodesk

Hello @timothyhinessr 

 

Apparently there is an error inside the post processor.

It seems that two version of the function onParameter are defined in the post.

As the post is not in our library, i can't give a deeper analysis.

You can open the cps file using a text editor, then search for the string "function onparameter" (ignoring the case)

You will find several (at least 2) definitions according to the error message.

 

Have a nice day.

 

Regards



Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes
Message 3 of 9

seth.madore
Community Manager
Community Manager

@timothyhinessr if you could also share your post processor, that would allow other community members to take a peek at the settings and perhaps figure out what's going wrong.

Question though; is the generic Tormach post processor that Autodesk provides insufficient for your needs?


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 4 of 9

timothyhinessr
Advocate
Advocate

I've attached the post processor.  Also, it's not that the generic Tormach post processor is insufficient for my needs, I just like the added flexibility the Loomes post processor provides for retract moves.

0 Likes
Message 5 of 9

serge.quiblier
Autodesk
Autodesk
Accepted solution

Hello @timothyhinessr 

 

As expected, brutal copy and paste, without checking after action.
First occurence, in the main body
function onParameter(name, value)
{
if (name == "display")
{
writeComment("MSG, " + value);
}
}

 

Second occurence grabed from an inspection post
function onParameter(name, value)
{
if (name == "probe-output-work-offset")
{
probeOutputWorkOffset = inspectionRunning ? 1000 : ((value > 0) ? value : 1);
}
}

 

A function can only be defined once with a unique name.

 

It should be grouped in order to have 1 function supporting the 2 fonctionnalities.

function onParameter(name, value)
{
if (name == "display")
{
writeComment("MSG, " + value);
}
if (name == "probe-output-work-offset")
{
probeOutputWorkOffset = inspectionRunning ? 1000 : ((value > 0) ? value : 1);
}
}

 

Please fiind attached the revised post.

Please warn the original provider about the potential issue.

 

Regards.

 


______________________________________________________________

If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!



Serge.Q
Technical Consultant
cam.autodesk.com
Message 6 of 9

timothyhinessr
Advocate
Advocate

Attached is a screenshot of the line of code referenced in the warning message, Line 1898.  There is only one other line of code identified in my search that contains "function on parameter", that being line 1160, see second screenshot attached.  I know virtually nothing about coding so I don't know what if anything this reveals as it pertains to the warning.

0 Likes
Message 7 of 9

timothyhinessr
Advocate
Advocate

Thanks Serge, the post you provided seems to work properly, no warnings displayed upon post processing.  Mr. Loomes found the problem about the same time you did and has also corrected it.  Thanks so much for the help, you guys at AutoDesk provide the best customer service I've experienced pretty much anywhere.

 

Tim

Message 8 of 9

serge.quiblier
Autodesk
Autodesk

Hello @timothyhinessr 

 

As javascript may analyse and interprets the cps file from top to bottom, when it encounter the "excess" declaration of the same named function, it complain on the copy, by without referencing the line of the previous definition.

Without going into too much details, the interpreter may create a list of functions names, but without storing the actual location in the cps file.

In VSCode with the HSM post extension, it's only firing a warining not an error, but it can be missed, if not looking close into the log file.

sergequiblier_0-1632386442226.png

Regards.



Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes
Message 9 of 9

timothyhinessr
Advocate
Advocate
So much to learn, so little time!

Thanks again for the help.
0 Likes