588,232 active members*
4,208 visitors online*
Register for free
Login
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    10

    Mach3 Macro for axis lubrication

    I edited the CS-Lab macro and would like to make sure I can use the function : GetTickCount() (microsoft function ?)

    The mill is an EMCO VMC-100.



    'lubrication MACRO using CNC4PC C-32 -imcomplete

    Const LastMsDRO = 1300 'DRO for data
    Const StateDRO = 1301 'DRO for data
    Dim CurrentMs As Long
    Dim LastMs As Long
    Dim State As Integer

    '------------------------------------------------------------------------------------------------------------

    Const LubeTime = 100 'Lubrication time
    Const LubeWait = 200000 'Greasing interval
    Const OutLubePump = OUTPUT1 'Digital output C32 oil pump

    '------------------------------------------------------------------------------------------------------------

    Sub Main

    'Read data
    '-------------------------------------------------------

    'milliseconds that have elapsed since the system was started

    CurrentMs = GetTickCount()
    LastMs = GetUserDRO(LastMsDRO)
    State = GetUserDRO(StateDRO)

    If(CurrentMs < LastMs) Then
    State = 0
    End If

    Select Case State
    'Lubrication start
    '-------------------------------------------------------
    Case 0
    ActivateSignal(OUTPUT1)
    LastMs = CurrentMs
    State = 1
    Message"Lubrication START !!!"
    Sleep(1000)
    DeActivateSignal(OUTPUT2)

    'Lubrication and stop
    '-------------------------------------------------------
    Case 1
    If(CurrentMs > (LastMs + LubeTime)) Then
    DeActivateSignal(OUTPUT2)
    LastMs = CurrentMs
    State = 2
    Message"Lubrication STOP !!!"
    End If

    'Wait for lubrication
    '-------------------------------------------------------
    Case 2
    If(CurrentMs > (LastMs + LubeWait)) Then
    State = 0
    End If

    '-------------------------------------------------------
    Case Else
    State = 0
    End Select

    'Data record
    '-------------------------------------------------------
    SetUserDRO(StateDRO, State)
    SetUserDRO(LastMsDRO, LastMs)

    End



    Thanks!

  2. #2
    Join Date
    May 2007
    Posts
    10

    Re: Mach3 Macro for axis lubrication

    The Macropump that is macropump.m1s file should be placed in „C:\Mach3\macros\name of the file we use” folder, so it could start running we have to only activate „Config\Generlal Config\Run Macro Pump” function and restart Mach3.

Similar Threads

  1. ATC MACRO MACH3
    By Machinaria in forum Auto Tool Changer
    Replies: 3
    Last Post: 06-10-2017, 05:13 PM
  2. Custom Macro for Mach3
    By visual14cnc in forum Mach Software (ArtSoft software)
    Replies: 8
    Last Post: 01-19-2015, 08:30 PM
  3. Another RF45 CNC Conversion - lubrication and Z axis
    By analogman in forum Benchtop Machines
    Replies: 4
    Last Post: 09-03-2014, 06:39 PM
  4. TL2 x axis lubrication problem
    By garylb in forum Haas Lathes
    Replies: 6
    Last Post: 10-08-2012, 03:27 PM
  5. Axis Lubrication - Multus
    By zooloader in forum Okuma
    Replies: 8
    Last Post: 08-18-2009, 04:02 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •