Hello Guest it is April 16, 2024, 07:53:55 PM

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 - beezerlm

Pages: « 1 2 3 4 5 6 »
21
Mach4 General Discussion / Re: Rename A axis to U axis?
« on: October 01, 2016, 10:17:45 AM »
Craig - That is what I want to change.  The axis is technically the "U" axis.  It is an auxiliary axis that runs parallel to the X axis.  I have already changed the buttons etc...  but then the G-code still needs to see "A".  I would like to change the axis letter globally throughout the system so it is recognized as "U".

22
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: October 01, 2016, 10:13:23 AM »
Yes that looks nice and clean.

23
Mach4 General Discussion / Rename A axis to U axis?
« on: September 29, 2016, 01:04:00 PM »
There is probably something simple I am missing here, but I would like to rename the "A axis" to "U axis" throughout the system.  Is there a simple way to change the letter of an axis in Mach 4?

24
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: September 28, 2016, 12:56:30 PM »
Quote
This does not do any error checking and the time it waits for the input to go high is indefinite (neither of which are very good ideas) and it does not take your "In automatic Cycle" into account but it should be all that is needed to do what you were looking for originally.

Could you recommend the proper error checking for this? I have been neglecting that too much while focusing on getting the code to work.

25
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: September 28, 2016, 11:22:56 AM »
Actually I am using input 20 as a "In automatic Cycle" signal. The M100 is interacting with the PLC script to monitor the Z-axis encoder and change direction when necessary.  I am still working on the Z axis reciprocation and automatic grinding cycle part at the moment, but as of now, yes the input 20 is setting the output_1 high in the PLC script which sends the Z axis home.

Yes your sample works also.

26
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: September 28, 2016, 10:51:52 AM »
Here is the code that works:

Code: [Select]

function M100()
    
    local inst = mc.mcGetInstance()
    local input_20 = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT20) -- Get handle for input 20
    local input_20_State = mc.mcSignalGetState(input_20) -- Get input 20 state
    local z_home_sig = mc.ISIG_INPUT21 -- Get Signal ID for Z axis home switch
    
    if input_20 == 0 then
        wx.wxMessageBox("Could not locate signal!")

    else

        if input_20_State == 1 then --If input_20_State equals 1, then the signal is active.
            wx.wxMessageBox("Signal is already active!")

        else    --If input_20_State does not equal 1, then the signal is inactive.
            --wx.wxMessageBox("Setting input_20 high")
            mc.mcSignalSetState(input_20, 1)
            mc.mcSignalWait(inst, z_home_sig, 1, 0)
        end
    end
end

if (mc.mcInEditor() == 1) then
    M100()
end


27
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: September 28, 2016, 10:38:49 AM »
I got mcSignalWait to work.  I was wrong API does not say to use handle.  It worked by putting the signal ID.

28
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: September 28, 2016, 10:28:15 AM »
I looked at mc.mcCntlGcodeExecuteWait. I don't know how I could use it because the Z axis is not controlled via G-code.

29
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: September 28, 2016, 09:58:52 AM »
Daz - I mapped the Z home signal to Input_21 and I still can't get mc.mcSignalWait to work? The API says to use the signal handle, are you using the handle?  I haven't tried the others yet.

Current M100:

Code: [Select]
function M100()
   
    local inst = mc.mcGetInstance()
    local input_20 = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT20) -- Get handle for input 20
    local input_20_State = mc.mcSignalGetState(input_20) -- Get input 20 state
    local z_home_sig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT21) -- Get handle for Z axis home switch
    --local z_home_sig_state = mc.mcSignalGetState(z_home_sig) --Get state of  signal

    if input_20 == 0 then
        wx.wxMessageBox("Could not locate signal!")

    else

        if input_20_State == 1 then --If input_20_State equals 1, then the signal is active.
            wx.wxMessageBox("Signal is already active!")

        else    --If input_20_State does not equal 1, then the signal is inactive.
            --wx.wxMessageBox("Setting input_20 high")
            mc.mcSignalSetState(input_20, 1)
            mc.mcSignalWait(inst, z_home_sig, WAIT_MODE_HIGH, 20)
        end
    end
end

if (mc.mcInEditor() == 1) then
    M100()
end


30
Mach4 General Discussion / Re: Macro - Pause until input triggered
« on: September 27, 2016, 04:29:36 PM »
Is there a function to inhibit motion?  I looked through the API but didn't see one. If there is, maybe I could inhibit motion somehow until the Z home signal goes high?  The Z would still move home even if all motion is inhibited since it is a pneumatic cylinder and mach4 only controls up/down via output_0 and output_1.

Pages: « 1 2 3 4 5 6 »