=========== Sounds like a fun programming project with some real utility.
What cnc dialect are you using?
Can you post me a sample cnc program? Try to include one with as many options/functions as possible. Macros may be a problem. Do any of the programs use macros?
Use the email address shown.
Unka' George [George McDuffee]
------------------------------------------- He that will not apply new remedies, must expect new evils: for Time is the greatest innovator: and if Time, of course, alter things to the worse, and wisdom and counsel shall not alter them to the better, what shall be the end?
Francis Bacon (1561-1626), English philosopher, essayist, statesman. Essays, "Of Innovations" (1597-1625).
F. George McDuffee wrote in news: snipped-for-privacy@4ax.com:
Right away I need a quick solution for one of my customers who is switching to metric. They can afford to buy something if need be. But I was hoping for a freeware solution.
I was scrounging around on my computer because I was sure I had a program that does this. Turns out I do. I just needed John to remind me. But I'm sure a freeware or shareware solution from you would be welcome, if you're looking to do some hobby programming. I'll refer them to that and whatever else turns up.
It's Just G and M-code.
They do. But Macros shouldn't be a big problem. Even if you had to go through and check them for inch values that need to be converted, it would be a smaller task than converting everything by hand.
To make it truly useful though you should make it so any word address could be selected to be converted or not. On some machines an axis, say the "B" axis might be linear, while on others, it would be a rotary axis. Obviously you wouldn't want to convert rotary axes to metric. Since there are loads of machines and configurations out there making the program configurable to convert only the specified word addresses would make it vaulable to a wider audience.
While this isn't from one of the machines in question, it's similar. It's a short simple part and there's a video on the web you can refer to. Here is the path 1 program:
The other trick is dealing with addresses in canned cycles. Unfortunately these were written with CAM software so there are no canned or multi repetitive cycles being used. Other than the threading anyway. Also the dwell command (G04) uses the word address "U". "U" is also used as an incremental word address for the "X" axis. So when "U" appears with a G04 you wouldn't want it converted. But you would want it converted in any other case.
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.