Hello Guest it is April 19, 2024, 01:16:10 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 - DAAD

Pages: 1 2 3 4 5 6 7 8 9 10 11 »
1
Mach4 General Discussion / Re: Adding Physical button check code Take 2
« on: January 04, 2021, 05:40:06 AM »
Thanks for the pointer!

Machine setup and working as i want.

Many thanks

2
Mach4 General Discussion / Adding Physical button check code Take 2
« on: December 30, 2020, 10:42:47 AM »
At the moment i'm implementing some Physical buttons for easier acces to some of my most used functions.

2 of them are Park and goto zero, both of the use an input signal from the button to run some g code.
Problem is that it's possible to press both buttons after each other which is no good news for my machine!

I've tried to solde this with an axisisstill api, but it's not working smoothly at the moment. If i press the button when the machine moves, it does what it's need to do (nothing + return error axis moving). But when i press the button when the machine is not moving, it starts whit a little yerk and moves into the correct spot. But it also returns the error "machine is moving"

I've already added a millisleep, to overcome this, but the problem persists.

Any idea howto implement this the correct way?

Code: [Select]
mc.ISIG_INPUT4 = Function (state) -- Park Button

local MotorIsStillX = mc.mcAxisIsStill (inst, 1)
local MotorIsStillXs = mc.mcAxisIsStill (inst, 3)
local MotorIsStillY = mc.mcAxisIsStill (inst, 0)

if (( state==1) and (MotorIsStillX == 1) and (MotorIsStillXs == 1) and (MotorIsStillY == 1)) then
wx.wxMillisleep (500)
local msg = " G00 G53 X3100 Y1200"
mc.mcCntlSetLastError(inst, "Goto Park")
mc.mcCntlGcodeExecute(inst, msg)

else

mc.mcCntlSetLastError (inst, "Machine is moving")

end
end,





Keep Safe & Best wishes for the year to come!

Adam

3
Mach4 General Discussion / Re: Zero Z / probing to different offsets
« on: December 11, 2020, 12:37:25 AM »
I don't want to use tool per zone, and i don't define my zones with length of my stock.
I would like to be able to switch form one zone to another without having to worry about my z axis not set correctly if i forget to do the probing in this zone.

is there a way to write a value to the offset table?

I'm thinking of taking the Z_axisgetposition and putting it into the table.

Other ideas are welcome.

4
Mach4 General Discussion / Zero Z / probing to different offsets
« on: December 09, 2020, 02:56:51 PM »
At the moment i’m using different offset zones to place my workpieces into.

I have setup a probing point so i can swap tools rapidly. The problem is that only the current offset is updated with the new tool probing. At the moment i have to type in the correct coordinates for each offset zone (g54/g55/g56) or do the probing per zone to get gooing.
Is there a way that i can script a bitton to update the needed zones?

Keep safe,

Adam

5
Mach4 General Discussion / Re: Mach 4 back up / Modus operandi
« on: December 09, 2020, 02:50:19 PM »
Thanks to both for the input!

6
Mach4 General Discussion / Mach 4 back up / Modus operandi
« on: December 01, 2020, 04:40:43 AM »
Hello,

I've finally got mach 4 setup and running as i wanted.
I've already created a hdd backup just in case. But how can i save all data i need from mach 4?

What i've done already:
-Save profile package (screenset / macro's)
-Save separate modules i've made

But how do i save the following info:
-Created registers
-Created keyboard mapping
-Screen load/unload/plc/ scripts.

I can't seem to find these back in the profile package.

Adam

Keep Safe

7
Mach4 General Discussion / Z positioning gets disturbed during headswap
« on: November 28, 2020, 02:30:00 PM »
Hello,

At the moment i have a working dual head setup with some hickups:

If i probe both spindles after each other, all is good. If i don't (because only one tool gets changed), strange things happen with my Z offset.
The spindle last probed is correct, but the other spindle gets the wrong settings, as if some measures get accumulated.

Same thing happens when i put the call for the module function in a toggle button. If i manually swap between the router and spindle, the z value keeps adding up and i loose my correct Z height.

Strangest thing is this works perfectly during usage with my m6 file. Ik can swap multiple times between router/spindlewithout losing my Z refence height. This can be done for multiple gcode files after each other also.

The problem starts when i do a button swap or don't probe both after each other..

same code used for M6/probing/button.

Do i need to tackle this differently to get these problems sorted?

code below:

Code: [Select]
function zControl.UseRouter()
if (zControl.UnmapMotors() == 1) then  --Return out of UseRouter if unmapmotors returns an error
return 1 --failure
end

mc.mcAxisMapMotor(inst, mc.Z_AXIS, Router)
mc.mcAxisMapMotor(inst, mc.A_AXIS, Spindle)
mc.mcCntlSetPoundVar(inst, mc.SV_HEAD_SHIFT_X, OffsetX)
mc.mcCntlSetPoundVar(inst, mc.SV_HEAD_SHIFT_Y, OffsetY)
local TempZ = mc.mcAxisGetPos(inst, mc.Z_AXIS) -- Get work position of Z-Axis
local TempA = mc.mcAxisGetPos(inst, mc.A_AXIS) -- Get work position of A-Axis
mc.mcAxisSetPos(inst, mc.A_AXIS, TempZ) -- Replace A-axis value with Z value
mc.mcAxisSetPos(inst, mc.Z_AXIS, TempA) -- Replace Z-axis value with A value
local h_OUTPUT4 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT4) --Spindle-Router swap output
local h_OUTPUT5 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5) --Spindle dust pneumatics
local h_OUTPUT6 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT6) --Router dust pneumatics
mc.mcSignalSetState(h_OUTPUT4, 0)
mc.mcSignalSetState(h_OUTPUT5, 0)
mc.mcSignalSetState(h_OUTPUT6, 1)
--mc.mcSignalSetState(h_RELAY2, 1) --Future dust collection
local axisID, rc = mc.mcMotorGetAxis(inst,Router) --Z axis maakt deel uit van variable rc om return code te bekomen
local state = mc.mcSignalGetState(h_OUTPUT4)
if ((axisID == mc.Z_AXIS) and (state == 0)and (rc==mc.MERROR_NOERROR)) then
mc.mcCntlSetLastError(inst, 'Router active - Output set')
return

else
mc.mcCntlSetLastError(inst, "Router or output not activated / process stopped")
mc.mcCntlEnable (inst, false)
end
end

Code: [Select]
function zControl.UseSpindle()

if (zControl.UnmapMotors() == 1) then --Return out of UseRouter if unmapmotors returns an error
return 1 -- failure
end

mc.mcAxisMapMotor(inst, mc.Z_AXIS, Spindle)
mc.mcAxisMapMotor(inst, mc.A_AXIS, Router)
mc.mcCntlSetPoundVar(inst, mc.SV_HEAD_SHIFT_X, 0)
mc.mcCntlSetPoundVar(inst, mc.SV_HEAD_SHIFT_Y, 0)
local TempZ = mc.mcAxisGetPos(inst, mc.Z_AXIS) -- Get work position of Z-Axis
local TempA = mc.mcAxisGetPos(inst, mc.A_AXIS) -- Get work position of A-Axis
mc.mcAxisSetPos(inst, mc.A_AXIS, TempZ) -- Replace A-axis value with Z value
mc.mcAxisSetPos(inst, mc.Z_AXIS, TempA) -- Replace Z-axis value with A value
local h_OUTPUT4 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT4) --Spindle-Router swap output
local h_OUTPUT5 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5) --Spindle dust pneumatics
local h_OUTPUT6 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT6) --Router dust pneumatics
--local h_RELAY2 = mc.mcSignalGetHandle(inst, mc.OSIG_MISTON) --Future dust collection
mc.mcSignalSetState(h_OUTPUT4, 1)
mc.mcSignalSetState(h_OUTPUT5, 1)
mc.mcSignalSetState(h_OUTPUT6, 0)

local axisID, rc = mc.mcMotorGetAxis(inst,Spindle) --Z axis maakt deel uit van variable rc om return code te bekomen
local state = mc.mcSignalGetState(h_OUTPUT4)
if ((axisID == mc.Z_AXIS) and (state == 1) and (rc==mc.MERROR_NOERROR)) then
mc.mcCntlSetLastError(inst, 'Spindle active - Output set')
return
else
mc.mcCntlSetLastError(inst, "Spindle or output not activated / process stopped")
mc.mcCntlEnable (inst, false)
end
end






8
Mach4 General Discussion / Re: Adding field for value input
« on: November 28, 2020, 10:26:36 AM »
rc = mc.mcProfileFlush(number mInst)
rc = mc.mcProfileSave(number mInst)

I see you are saving the value as a string and then reading it back as an int but setting the value of the DRO as a string.
Have you checked the droVal returned by the getProperty?  Is it a string or a number?

I think the preferred method is to not write to the profile but to create gReg entry (Config->Plugins->RegFile, Global Registers Tab) and mark it as persistent. It will be read and saved automatically and you can access its value as needed.  Set the 'Register' property of the DRO to be that variable.

HTH

RT

The above with the registers worked perfectly!

Thanks!

9
Mach4 General Discussion / Re: Adding field for value input
« on: November 27, 2020, 01:55:08 PM »
Hello,

Thanks for the tip,

Searched the ini file and no parameter or value is saved...
I've double checked the spelling of the dro and all seems correct.

do i need to do something specific for saving the data to the ini file?

10
Mach4 General Discussion / Re: Adding field for value input
« on: November 27, 2020, 12:35:15 PM »
I've made an error while pasting the code.
I've double checked, my code and both parameters are the same.

Still not saving the dro when i close and open mach 4...

Pages: 1 2 3 4 5 6 7 8 9 10 11 »