Hello Guest it is April 25, 2024, 04:26:02 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 - mark4

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »
41
Mach4 General Discussion / Re: Z Axis Homing setting
« on: May 30, 2018, 01:56:34 AM »
i have had enough fun with Z on occasion. question the z is moving in the minus direction but which direction is the dro moving. go to the middle and zero then go down are the numbers
counting up negative. then try the same above zero and see if the numbers are counting positive. it sounds like you are backwards.
mark

42
Mach4 General Discussion / Re: MPG strange behavior
« on: May 08, 2018, 04:20:35 PM »
thank you that was the boost i needed it works fine now.
mark

43
Mach4 General Discussion / Re: MPG strange behavior
« on: May 08, 2018, 12:13:40 PM »
you guys went way over my head so i programmed it into the screen load and plc script with a few modifications

screen load
--2CNC433--Mach4 4381
pageId = 0
screenId = 0
testcount = 0
machState = 0
machStateOld = -1
machEnabled = 0
machWasEnabled = 0
inst = mc.mcGetInstance()

---------------------------------------------------------------
-- Signal Library
---------------------------------------------------------------
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
    machEnabled = state;
    ButtonEnable()
end,

[mc.ISIG_INPUT0] = function (state)
    if (state == 1) then
        wx.wxMessageBox('Way Oiler Empty Add Oil')
    end
end,

[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then   
        CycleStart()
    end
end,
[mc.ISIG_INPUT2] = function (state)
    if (state == 1) then
        mc.mcCntlFeedHold (0)
    end
end,
[mc.ISIG_INPUT3] = function (state)
    if (state == 1) then   
        CycleStop()
    end
end,
[mc.ISIG_INPUT4] = function (state)
    if (state == 1) then   
        mc.mcCntlEStop(0)
        wx.wxMessageBox('Vfd Fault')   
    end
end,
[mc.ISIG_INPUT5] = function (state)
    if (state == 1) then   
       mc.mcCntlEStop(0)
       wx.wxMessageBox('Drive Fault')
    end
end,
[mc.ISIG_INPUT9] = function (state)
    if (state == 1) then   
        AxisSelect()
    end
end,
[mc.ISIG_INPUT10] = function (state)
    if (state == 1) then   
        AxisSelect()
    end
end,
[mc.ISIG_INPUT11] = function (state)
    if (state == 1) then   
        AxisSelect()
    end
end,
[mc.ISIG_INPUT12] = function (state)
    if (state == 1) then   
        AxisSelect()
    end
end,
[mc.ISIG_INPUT13] = function (state)
    if (state == 1) then   
        AxisSelect()
    end
end,
[mc.ISIG_INPUT14] = function (state)
    if (state == 1) then   
        IncSelect()
    end
end,
[mc.ISIG_INPUT15] = function (state)
    if (state == 1) then   
        IncSelect()
    end
end,
[mc.ISIG_INPUT16] = function (state)
    if (state == 1) then   
        IncSelect()
    end
end,


and this is my plc modifications

--2CNC433--Mach4 4381
local inst = mc.mcGetInstance()
local rc = 0;
testcount = testcount + 1
machState, rc = mc.mcCntlGetState(inst);
local inCycle = mc.mcCntlIsInCycle(inst);

-------------------------------------------------------
--  Coroutine resume
-------------------------------------------------------
if (wait ~= nil) and (machState == 0) then --wait exist and state == idle
   local state = coroutine.status(wait)
    if state == "suspended" then --wait is suspended
        coroutine.resume(wait)
    end
end
---------------------------------------------------------------
--Axis Selection
---------------------------------------------------------------
function AxisSelect()
    local hsigInput9, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT9)
    local NoneSelected, rc = mc.mcSignalGetState(hsigInput9)
    local hsigInput10, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT10)
    local Xselection, rc = mc.mcSignalGetState(hsigInput10)
    local hsigInput11, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT11)
    local Yselection, rc = mc.mcSignalGetState(hsigInput11)
    local hsigInput12, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT12)
    local Zselection, rc = mc.mcSignalGetState(hsigInput12)
    local hsigInput13, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT13)
    local Aselection, rc = mc.mcSignalGetState(hsigInput13)
    if NoneSelected == 1 then
        mc.mcMpgSetAxis(inst, 0, -1)
        --mc.mcCntlSetLastError(inst, "No Axis Selected")
    elseif Xselection == 1 then
        mc.mcMpgSetAxis(inst, 0, 0)
        --mc.mcCntlSetLastError(inst, "X Selected")
    elseif Yselection == 1 then
        mc.mcMpgSetAxis(inst, 0, 1)
        --mc.mcCntlSetLastError(inst, "Y Selected")
    elseif Zselection == 1 then
        mc.mcMpgSetAxis(inst, 0, 2)
        --mc.mcCntlSetLastError(inst, "Z Selected")
    elseif Aselection == 1 then
        mc.mcMpgSetAxis(inst, 0, 3)
        --mc.mcCntlSetLastError(inst, "A Selected")
    end
end
---------------------------------------------------------------
--Increment Selection
---------------------------------------------------------------
function IncSelect()
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT14)
    local Step01, rc = mc.mcSignalGetState(hsig) -- increment .01
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT15)
    local Step001, rc = mc.mcSignalGetState(hsig) -- increment .001
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT16)
    local Step0001, rc = mc.mcSignalGetState(hsig) -- increment .0001
    if Step01 == 1 then
        mc.mcMpgSetInc(inst, 0, .010)
        --mc.mcCntlSetLastError(inst, "X1 Selected")
    elseif Step001 == 1 then
        mc.mcMpgSetInc(inst, 0, .001)
        --mc.mcCntlSetLastError(inst, "X10 Selected")
    elseif Step0001 == 1 then
        mc.mcMpgSetInc(inst, 0, .0001)
        --mc.mcCntlSetLastError(inst, "X100 Selected")
    end
end
-------------------------------------------------------
--Run Lube
-------------------------------------------------------
local inst = mc.mcGetInstance()
local hsig,rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
if (machState == 0)then
    mc.mcSignalSetState(hsig,0)
else
    mc.mcSignalSetState(hsig,1)
end

now i get this error
signal script error
lua:error while running chunk
[string ""]:75:attempt to call global 'AxisSelect' (a nil function)
stack traceback
[string ""]:75: in function '?'
[string ""]:706: in function <[string ""] 703>
correct the error and restart

i also started a help ticket but here can help more people
as i said this worked fine i switched and switched and played with it. it was faster and more responsive.
then i boot up today and it gives me this error which i dont have the foggiest idea how to find much less solve.
thank you
mark

44
CS-Lab / Re: CSMIO IP/A and CSMIO IN/OUT MACH4 ISSUE
« on: May 06, 2018, 04:19:44 PM »
they really aren't doing a good job these days i think they have internal problems.
that being said did you change your active low settings might help i haven't tried it yet myself
and have you emailed them directly they do respond eventually.

45
Mach4 General Discussion / Re: MPG strange behavior
« on: April 13, 2018, 11:21:27 PM »
thanks for the reply i think i follow you but where would the
------------------------
--Mark 4-12-18
--MPG Settings
AxisSelect()
IncSelect()
------------------------
go. does that make lua look in the plc script for the functions.
mark


46
Mach4 General Discussion / MPG strange behavior
« on: April 12, 2018, 12:35:53 AM »
hello
i have a strange problem this is my setup. mach4,Ethernet smooth stepper, intel nuc with windows 10, ace 22 plc modbus over usb.
so the only job the plc has is to control two rotary switches one for axis X,Y,Z and A and one for X1,X10,X100 increment.
sometimes the axis will be set to say Y and X will jog. when you see this behavior all you need to do is flip the switch to one of
the other axises and back and it will jog on the proper axis. this usually happens after homing. the problem is i haven't been able to
successfully recreate the problem on demand so i cant tell whats wrong. if i were to guess i think it looses its way and doesn't look at the switch again if that makes sense. i am going to attach my screen load script please look at my switches and see if there is a problem. also i need to have an off position for the axis rotary switch and am not sure how to program that so when all switches are off mpg is off and no jog or the arrow buttons are active either would work for my setup.
thank you
mark

47
Mach4 General Discussion / Re: A solution for more switches than inputs
« on: February 13, 2018, 11:25:16 AM »
Hello thanks for the reply. I am looking at plc. I tried to do that with pokeys but that didn't work out. So can you recommend a plc I only have one Ethernet port. So for the pokeys I used a usb to Ethernet adapter and it seemed to work alright. Thank you
Mark

48
Mach4 General Discussion / Re: ESS not communicating to Mach 4
« on: February 13, 2018, 07:14:27 AM »
also just because i am thinking you can use a logic probe on the output for the drive or just connect a let to it in the proper polarity and if you want to not kill the led use a resistor.

49
Mach4 General Discussion / Re: ESS not communicating to Mach 4
« on: February 13, 2018, 07:11:18 AM »
hello the ESS has its own diagnostic screen its in the bottom of the 3rd pull down menu cant think of its name. it will tell you if the ess is putting signals out. the fact that numbers are moving is the MACH thinks it is. i would look over my motor and enable settings close. in case i miised it what BOB are you using and do the output pins have leds on them. the one i use has leds and they are invaluable

50
Mach4 General Discussion / Re: A solution for more switches than inputs
« on: February 13, 2018, 01:57:39 AM »
well so far i havent been able to make it work effectively it works as advertised but the coding is sluggish and not reliable. it might be the diodes arent fast enough or the switches need allot of debounce. so unless somebody comes up with some coding i havent tried i am going to add a multiplexer to my index pulses so i can gain 3 more inputs. that will get me the ones i need but truthfully i wanted to have a seperate input for each index.
mark

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »