Hello Guest it is March 28, 2024, 03:18:02 PM

Author Topic: LUA help  (Read 3182 times)

0 Members and 1 Guest are viewing this topic.

LUA help
« on: June 12, 2017, 05:26:12 PM »
I would like to know if you could give me a price quote for a LUA script for
my M6 Tool changer on a Hardinge CHNC lathe. I just received a licence for
Mach 4 and would like to retrofit my lathe.

In order to make the turret work properly I need 5 input signals and 2 output
signals.

inputs = 4 for the turret encoder and one for the turret down switch
outputs = 1 to lift and rotate the turret 2 is to activate turret stop dog.

normal operations are as follows:
get tool number
activate turret (lift and rotate)output A
wait for encoder to reach desired station
activate turret stop (stop dog)output B
deactivate turret (stop rotation and lock down)
check turret down switch (fifth input)
deactivate turret stop
recheck encoder position
if encoder is correct end
if encoder is not correct go back to activate turret line.
end


Here is a list of the conditions of the 4 wires coming from the turret
encoder.

0 = 0 VOLTS AND 5 = 5 VOLTS

common binary code

WIRE (input)   1   2   3   4

STATION 1    0   5   5   5
STATION 2    5   0   5   5
STATION 3    0   0   5   5
STATION 4    5   5   0   5
STATION 5    0   5   0   5
STATION 6    5   0   0   5
STATION 7    0   0   0   5
STATION 8    5   5   5   0

condition between stations is 0 volts

I also noticed while playing with the software you use tool 1 for a master
tool and all other tools are ref from that tool. Hardinge used a simular
approch only using tool 0 as the master, tool 0 would be the face of the
turret. that way if you need to change tool 1 it won't effect other tools.
Is this something that I can change?

thanks
Art
Re: LUA help
« Reply #1 on: August 02, 2017, 09:06:31 PM »
I have a similar setup in my mori seiki. I too am having trouble with writing the code needed to get this to function. Have you had any luck?