Hello Guest it is April 24, 2024, 03:21:06 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.


Messages - Edison

Pages: 1 2 3 »
1
In order to help more people, I post my  auto tool changer code, hope you can help!



'** File Name:    M6Start.m1s
'** Created By:   Edison_Pan
'** Created date: 2008-12-1
'** Version: 1.0
'** Descriptions: First version

Option Explicit

'Declaraciones
Const   MaxToolNum = 4   'Max number of tools for the changer
Const   CCWTime    = 3
Const   ChangTime  = 10

Const   T1  = Input1
Const   T2  = Input2
Const   T3  = Input3
Const   T4  = Input4

Const   CW  = Output5
Const   CCW = Output6


Dim OldTool,Tool,NewTool
Dim Tim

OldTool = GetOEMDRO (1111)
Tool = GetSelectedTool()

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If
While Tool > MaxToolNum
Tool = Question ("Tool Error, Tool number to large Enter new tool number")
Wend

Call StartTool
SetTimer(1)
While NewTool <> Tool
   Call CheckPins
   While IsMoving()
   Sleep(10)
   Wend
   Tim=GetTimer(1)
   If Tim > ChangTime Then
       DoOEMButton(156)
       DoOEMButton(1021)
       Message ("Tool Error,time out")
   Exit Sub
   End If
Wend

Call StopTool
Call SetUserDRO (1200, NewTool)
SetCurrentTool(NewTool)
'Code "G43 H" & NewTool       




'Subroutines
Sub StartTool
   ActivateSignal(CW)
      While IsMoving()
        Sleep(10)
      Wend
End Sub


Sub CheckPins
   If IsActive(T1) Then
      NewTool = 1
      End If
   If IsActive(T2) Then
      NewTool = 2
      End If
   If IsActive(T3) Then
      NewTool = 3
      End If
   If IsActive(T4) Then
      NewTool = 4
      End If
End Sub


Sub Stoptool
   DeActivateSignal(CW)'Stop the toolchange
      While IsMoving()
     Sleep(5)
      Wend
      Sleep(1000)
   ActivateSignal(CCW) 'Lock tool
      Code "G4 P" & CCWTime    'Lock time
      While IsMoving()
     Sleep(5)
      Wend
   DeActivateSignal(CCW)'Turn off the Lock
      While IsMoving()
     Sleep(5)
      Wend
End Sub         

2
Thank you for help, the problem was finally resolved.
In the origina, lathe where we do not need to control his tool offset, it can according to the code "T0102",
auto-correction tool on the 2nd offset. The M6 macro as like as two peas with the milling.

3
HI,DaveA,
    I used the AutoTool Change, in the macro how to  get offset number? As "T0101 M6" get the number "1".
    Or you has same idea to deal with the offset problem?
Thanks!!
Edison

4
General Mach Discussion / In the Mach3Turn, how to get the lenght offset?
« on: December 29, 2008, 07:44:29 PM »
Hi all,
    In the Mach3Turn, how to get the lenght offset number?
    In the code "T0102 M6",
    Tool = GetSelectedTool()    'Tool=1
    but the lenght offset number howto get??

thanks!
Edison


5
General Mach Discussion / Re: How to set the modbus output signal??
« on: October 15, 2008, 09:30:45 AM »
Hi,Hood:
   Your ModBusSettings send what to the PLC??
   If I want to send  0x0fd to the plc, ....?

Thank
Edison

6
General Mach Discussion / Re: How to set the modbus output signal??
« on: October 15, 2008, 08:24:26 AM »
Hi£¬Hood:
   That's ok,thanks!!
   And how to output the word??

Thanks!!

Edison

7
General Mach Discussion / Re: How to set the modbus output signal??
« on: October 15, 2008, 07:41:10 AM »
Hi£¬Hood£º
    Now£¬I design a board like ModIO, the input signal is test ok, but I cann't understand the output signal setup.
I want set the output like the input and can from a macro.

Thanks!!

Edison

8
General Mach Discussion / How to set the modbus output signal??
« on: October 14, 2008, 12:14:58 PM »
Hi,all:
   In the mach3 the modbus the input signal is set the port is 0 ,
but the output signal is mapping what??

Thanks for help!!

Edison

9
Hi, Gerry:
&#160; &#160;I want to used the vb script code to instead the "run" function¡£


Edison

10
How to use the VB script instead of the Cycle start button?
Thanks!

Edison

Pages: 1 2 3 »