I built a mill turn setup similar to simpson36's "inturn" or the tormach rapid turn (except mine is servo driven for index milling) and I need a few macros to get everything working the way I want. I already have the swap axis stuff figured out, now I need a few other things to handle the gang tooling offsets and coolant nozzles. Both follow similar logic so let's start with the coolant macro.
Basically I want 8 individual coolant nozzles that are chosen based on tool number. I'll write out how it needs to happen and hopefully you guys can help me convert that to proper vb language
Get selected tool
If tool number < 100, activate signal output 1
Else
If tool number = 100, activate signal output 2
Else
If tool number = 101, activate signal output 3
Else
Etc, up to 8 outputs. The reason I have tools 1-99 grouped into 1 output is because those will be used in main milling spindle and all use the same nozzle. The rest will have their own specific location on the gang plate and need their own nozzle, however I may want to also use small groups of possible tools for a specific gang location. For example I might want something like:
if tool number > 104 and < 111, activate signal output 3
or something like that. As far as I know, mach3 won't allow me to modify m7, but it's easy enough to go into my post processor and assign a new m code for coolant. I'll also need a code to turn off all coolant outputs. I assume it will just look like this?
Deactivate output signal 1
Deactivate output signal 2
Deactivate output signal 3
Etc up to 8
I'll also need to have this happen in the m30
My tool change macro will have similar logic, but instead of activating signals, it will apply work offsets for specific tools or tool groups. I could use g52 offsets instead so the work offset can be moved around and have g52 tool offsets follow, but decided to go with work offsets instead since my zero position will always be the nose of the mill turn spindle and it will be easier to set up and make adjustments to tools. If I used g52, I would have to go into the macro to make ajustments.
Any help is greatly appreciated. I think once I see a few examples of how to write out these if then else statements, like the ones I listed above, i should be able to get going on these.