Hello Guest it is August 14, 2020, 01:44:28 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - drumsticksplinter

Pages: 1
1
VB and the development of wizards / Turn tool turret macro
« on: April 21, 2020, 05:32:54 AM »
Hello,

I'm working on a tool changer turret for a lathe, but I'm having an issue I can't seem to overcome.

I have PLC controlling all of the logic behind the tool changer and this works absolutely perfectly! I am using a brain to send the value from CurrentTool through modbus. This works if I manually put a value in the Tool No DRO. However, If I run my macro, the Tool No DRO does not change and the PLC does not get the new tool number.

I input in the MDI: M6 T0101 for example

Am I missing something obvious here please?

Thanks,

M6 Start macro:

Code: [Select]
'-----------------------------------------------------------------------
'CYCLONE - Auto tool changer (8 pos turret type)
'V1.0
'-----------------------------------------------------------------------

'-----------------------------------------------------------------------
'CONFIG
'-----------------------------------------------------------------------


Tool = GetSelectedTool()
OldTool = GetCurrentTool()
NewTool = Tool
MaxToolNum = 8 'Max number of tools for the changer

'-----------------------------------------------------------------------
'MACRO START
'-----------------------------------------------------------------------
IsActive(INPUT1)
DeActivateSignal(OUTPUT6) 'Make sure signal to PLC is negative
'code"G91 G28 Z0" 'set incremental, return home via X first
'While IsMoving()
'Wend

While NewTool > MaxToolNum 'Dont allow tool number greater 8
Message("MAX TOOL NUMBER = 8")
Wend

While NewTool < 0 'Dont allow tool number less than 1
Message("INVALID TOOL NUMBER")
Wend

If NewTool = OldTool Then
Call ToolComplete
Else
If IsActive(INPUT1) Then 'ok signal from PLC
Call DoToolChange
Else
Message("TURRET NOT READY!")
End If
End If
End

'----------------------------------------------------------------------
'TOOL CHANGE
'----------------------------------------------------------------------

Sub DoToolChange()

SetCurrentTool(NewTool) 'Update the tool DRO
Call ActivateSignal(OUTPUT6) 'Set tool change allowed signal to PLC
SetTimer(1)
t = GetTimer(1)
sleep 10

If Not IsActive(INPUT1) Then  'If input goes low, turret is moving

While Not IsActive(INPUT1) 'While the turret is moving, count down

If IsActive(INPUT1) Then 'If input goes high again, tool has cycled
Call ToolComplete
Else
If t > 4000 Then
Call ToolFailed
End If
End If

sleep 10
Wend

End If


End Sub
     
 

'----------------------------------------------------------------------
'TOOL COMPLETE
'----------------------------------------------------------------------

Sub ToolComplete()
DeActivateSignal(OUTPUT6)
End Sub


'----------------------------------------------------------------------
'TOOL FAILED
'----------------------------------------------------------------------

Sub ToolFailed()
f = 1
DeActivateSignal(OUTPUT6)
While f = 1
Message("TURRET TIMEOUT")
Wend

End Sub               

2
Brains Development / Modbus Click PLC Brain
« on: December 08, 2017, 07:08:09 PM »
Hi Guys,

I'm working on a machine where I have a turret tool changer controlled by a Click PLC. The PLC works fine and I can connect to it via the modbus settings (test modbus) to read and write to and from the holding registers, which all checks out ok. I want to use a simple brain that writes the new tool number into my PLC's holding register via modbus.

I've tried putting together a brain that passes the current tool DRO value through modbus to my PLC, but I can't seem to get it to do anything... The values change to that of the current tool, but it doesn't get written in to the register. I have tried all possible settings in the brain terminator but nothing works. I know modbus is working, because I can read and write to the registers in the test modbus page. I've even thought about handling this in the macro with some VB script, but I can't find anything about writing to registers via Modbus, there is info on reading from them though strangely...

Thanks!




3
CS-Lab / CSMIO/IP-A Mach4 lathe retrofit
« on: May 04, 2016, 04:46:05 PM »
Hi guys,

I'm doing a retrofit of a small lathe using the csmio/ip-a module, plus the enc & mpg modules once they arrive. I've just got a few queries regarding the functionality of the mach4 plugin cslabs have provided. I've tried setting up my spindle today, but can't seem to get any analog voltage. I reverted back to mach3 briefly and can get the spindle running easily. The setup is slightly different in mach4 and I'm not familiar with it yet. I just wondered if anyone has already got a machine running on the same setup? I've read that threading and rigid tapping aren't supported so far and will be coming in a later upgrade, any ideas when these updates are likely to be?

Thanks.

4
Mach4 General Discussion / MPG Functions?
« on: January 02, 2015, 03:24:01 PM »
Hi Guys,

I'm just wondering about the MPG function in Mach4 Hobby Demo. I'm just playing around in the simulation mode at the moment, hoping to get my pokeys working with the Beta plugin but no luck so far. I'm still trying to get used to the new layout and can't find any mention of an MPG, I'm also having issues with keyboard jogging, can't seem to get the button to turn to 'on'? Any Ideas?

Thanks,

5
General Mach Discussion / Turn A Axis problem Auto Toolchanger
« on: March 12, 2010, 09:25:45 AM »
Hi all!

I'm quite new to all this so I'm sorry if my question is really obvious...

I have a small lathe similar to an Emco compact 5 and I'm using a compact 5 auto toolchanger to be driven from the A axis.
My problem is that my A axis in mach3 turn is playing up. At first i was using X-Z and Y just to test the movement of the toolchanger, which was fine.
I have now come to set up my axis properly using A as a rotary axis and my motors don't like it at all. I get a high screeching noise from any motor i use from the A axis.
I have tried changing the port and pin settings, but it seems to be a problem with the actual A axis in mach3 itself? Maybe i have to change some settings somewhere?

I have modified the emco toolchanger by mounting a stepper motor and slotted disk with opto sensor for tool location feedback.

If anyone has any ideas where i might be going wrong i would really appreciate the help.
I will try and add some pics soon, as my lathe is nearly finished and lookin good  :)

Thanks,

Adam

Pages: 1