Fanuc 5t Post Processor System Fusion Help! (Or JavaScript help!?)
I've posted on a few forums including the Fusion help forum. I am hoping that someone here has an old Fanuc 5t or similar and has a solution for this?
I am facing 2 problems (that I know of) One is the 5t does not recognize decimal points. The other problem is the G Code that is being out put drops any trailing zeros.
I have edited my post processor Script with the following. But is only has the desired effect in part and is a poor and dangerous band aid in my opinion. X is pretty close to what it needs to be unless it ends in zero/s. The other z, etc sometimes get rounded up and also suffer the same problem with zeros being omitted.
var xFormat = createFormat({decimals:0, scale:2000}); // diameter mode
var yFormat = createFormat({decimals:0, scale:1000});
var zFormat = createFormat({decimals:0, scale:1000});
var rFormat = createFormat({decimals:0, scale:1000}); // radius
var feedFormat = createFormat({decimals:0, scale:1000});
Maybe there's some one here who is good with JavaScript? Or maybe another solution? If we can make it always post digits to the tenth I can manually edit out the decimals if need be. I've lost several days to trying to figure this out... Any help would be very greatly appreciated!
Re: Fanuc 5t Post Processor System Fusion Help! (Or JavaScript help!?)
We'd need to see that createFormat() method, which is what computes the outputs, not the var.
Also post a few lines example of the current Gcode you are getting and the desired one, just so we understand what you are after.
Re: Fanuc 5t Post Processor System Fusion Help! (Or JavaScript help!?)
Maybe an external app? ... like this :
[url]https://www.kentechinc.com/kipwarexc.html[/url]
You could output the G code using some generic post ... like Fanuc ... then run the G code file through this to auto-convert the format to the format you need.
Lots of decimal point conversion options ... see attached.
Re: Fanuc 5t Post Processor System Fusion Help! (Or JavaScript help!?)
I posted in a few places looking for help with this to no avail. I am going to try and update those threads for anyone this may help. Hopefully this is correct it seems to work as intended in preliminary tests
Ok so I have finally figured out how to assure that trailing Zeros are not dropped using a trim command, I have also added a forceDecimal command but for some reason it has no effect. I will say that I do not really know JavaScript so if you use the following edits please beware. I will just use the search and replace feature in note pad to delete the decimals. It would be nice if that were a user definable feature and I am sure it could be easily done. But I think I am happy for now. Hopefully this helps someone with a fanuc 5t or like machine.
If anyone has any ideas for upgrades or edits I would be interested to hear.
I have had to ad a space in every line of the code posted here between : ( so it will not display an emoji in this thread posting. These charecters are found between the words Decimal and Unit in the code.
var spatialFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var xFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false}); // diameter mode
var yFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var zFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var rFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var feedFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
Re: Fanuc 5t Post Processor System Fusion Help! (Or JavaScript help!?)
I posted in a few places looking for help with this to no avail. I am going to try and update those threads for anyone this may help. Hopefully this is correct it seems to work as intended in preliminary tests
Ok so I have finally figured out how to assure that trailing Zeros are not dropped using a trim command, I have also added a forceDecimal command but for some reason it has no effect. I will say that I do not really know JavaScript so if you use the following edits please beware. I will just use the search and replace feature in note pad to delete the decimals. It would be nice if that were a user definable feature and I am sure it could be easily done. But I think I am happy for now. Hopefully this helps someone with a fanuc 5t or like machine.
If anyone has any ideas for upgrades or edits I would be interested to hear.
Please note I have added a space between the characters : ( found between the words Decimal and Unit, so that they do not post to this thread as an emoji...
var spatialFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var xFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false}); // diameter mode
var yFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var zFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var rFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
var feedFormat = createFormat({decimals: (unit == MM ? 3 : 4), trim:false, forceDecimal:false});
I am sure the post processor could still use refinement. I hadn't seen this (link below) and found it use full. Thanks for the help and ideas!