Hello Guest it is March 28, 2024, 10:14:01 AM

Author Topic: Mill Turning_Need Advice with Mach3 Work Offsets!  (Read 6129 times)

0 Members and 1 Guest are viewing this topic.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #10 on: April 02, 2021, 12:42:21 PM »
Looks great so far, let's see what the testing will bring up.

as mentioned earlier, if you put this code in M6 and a:

Code: [Select]
newtool = GetSelectedTool() ' get the newtool

at the begining a Standard postprocessor should be ok.

good luck for testing. :)
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #11 on: April 02, 2021, 01:00:47 PM »
Ah yes that is already there but in this case it just updates the tool number but no offsets are applied to the tools. All the offsets are handled within the M1002 macro and output as G52 X Y Z offsets.
Let's see what the tests give
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #12 on: April 02, 2021, 01:35:41 PM »
Post Processor modied accordingly to output M1002 Px based on the tool comment section

Exemple below:
%
(OP1 TEST G52)
(MACHINE)
(  VENDOR OPTIMUM)
(  DESCRIPTION OPTIMUM BF20L LATHE)
(T0101 NR=0.4 - ZMIN=-0.577 - GENERAL TURNING)
(T0202 NR=0.4 - ZMIN=-38.762 - GENERAL TURNING)
G90 G94 G18
G21
G53 G0 Z-5.   //when a tool change or new operation is issued it outputs a G53 Z-5 command to clear the field

(FACE1 3)
T0101         //tool change
(G52P0)      //corresponding tool comment
M1002 P0    //calls the 1002 macro with P0 meaning G52 X0Y0Z0
M7
G94
G97 S1100 M3
G0 Y0.        // always call a Y0 to compensate for the different Y positions
G0 X48.5 Z5.
G0 Z1.337
X44.5
G1 X43.328 F160.
X40.5 Z-0.077
X-0.8
X2.028 Z1.337
G0 X44.5
Z1.237
G1 X43.328 F160.
X40.5 Z-0.177
X-0.8
X2.028 Z1.237
G0 X44.5
Z1.137
G1 X43.328 F160.
X40.5 Z-0.277
X-0.8
X2.028 Z1.137
G0 X44.5
Z1.037
G1 X43.328 F160.
X40.5 Z-0.377
X-0.8
X2.028 Z1.037
G0 X44.5
Z0.937
G1 X43.328 F160.
X40.5 Z-0.477
X-0.8
X2.028 Z0.937
G0 X44.5
Z0.837
G1 X43.328 F160.
X40.5 Z-0.577
X-0.8
X2.028 Z0.837
G0 X48.5
Z5.
M9
G53 G0 Z-5.

(PROFILE FINISHING1 3)
M1
T0202
(G52P1)      //new tool same story
M1002 P1    // P1 would be G52 X Y Z based on the user DRO in Mach3 screenset
M7
G94
G97 S1100 M3
G0 Y0.
G0 X60.5 Z5.8
G0 Z1.933
X14.24
G1 X13.11 Z0.015 F160.
X19.05 Z-5.434
Z-20.404
X38.1 Z-35.647
Z-38.762
X40.5
Z-36.762
X42.1
G0 X60.5
Z5.8

M9
G53 G0 Z-5.
M30
%


Time for testing!

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #13 on: April 02, 2021, 09:20:51 PM »
You could if you want use the fixture offsets to hold the G52 XY & Z values and read them using #5221 onward.

If you then want to change an offset on the fly its easy to change the fixture value.

Without engineers the world stops
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #14 on: April 03, 2021, 03:45:13 AM »
You could if you want use the fixture offsets to hold the G52 XY & Z values and read them using #5221 onward.

If you then want to change an offset on the fly its easy to change the fixture value.


Damn didn't know 😅. The fixture offsets table seemed be capable of holding only the standard offsets G54, G55 ecc... Still not sure how can I log those?
Do you have a shortcut to open the fixture offset table? Or a OEM code to make a button? In the 1024 screenset I only found the save button and not always I want to press it to open the table.

That is the thing. Is there a repository where I can find the VB script variables, the OEM codes, pictures like the one you posted know. I often read screen hunter as title of picture but never found anything containing all this info.
I only have an excell file with all the OEM code found but no no more. For the VB parameters I open several macros and try to find what I need.

Thanks a lot for the help

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #15 on: April 03, 2021, 05:20:08 AM »
dont know a OEMButton to open fixture table, but:

Code: [Select]
  DoMenu(1, 9)

should do the same.

here: https://www.machsupport.com/forum/index.php?topic=19482.0
is an other list i use.
« Last Edit: April 03, 2021, 05:23:35 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #16 on: April 03, 2021, 05:56:52 AM »
Thank you very much. This helps a lot!
Still not clear how I can save the G52 offset in the tool table but I will have a look.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #17 on: April 03, 2021, 07:29:01 AM »
for the moment i am sure what you realy try to do.

now you are talking of the tool table?

to store values in the tooltable in lathe mode the following will store X/Z

Code: [Select]

SetToolParam(ToolNo,3,XOffset) 'write X
SetToolParam(ToolNo,4,YOffset) 'write Y
DoOEMButton(316) 'save tooltable


but there is nothing for Y to store.

you can use one of the wear values
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #18 on: April 03, 2021, 08:01:57 AM »
for the moment i am sure what you realy try to do.

now you are talking of the tool table?

to store values in the tooltable in lathe mode the following will store X/Z

Code: [Select]

SetToolParam(ToolNo,3,XOffset) 'write X
SetToolParam(ToolNo,4,YOffset) 'write Y
DoOEMButton(316) 'save tooltable


but there is nothing for Y to store.

you can use one of the wear values


Sorry, my bad. I meant how to store the G52 offset in the work offsets table. Not the tool table.
Graham mentioned that is possible to save the G52 offsets in the work offsets table.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #19 on: April 03, 2021, 08:17:23 AM »
this will read G52 (X/Y/Z) and write G54

Code: [Select]
X=GetVar(5211)
Y=GetVar(5212)
Z=GetVar(5213)

SetVar(5221,X)
SetVar(5222,Y)
SetVar(5223,Z)

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.