Hello Guest it is April 23, 2024, 04:43:28 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 - dude1

1061
Mach4 General Discussion / Re: Needing help with screens
« on: December 04, 2014, 04:13:19 PM »
its not in macro folder in the button script.

for running the code its just a timing problem if I have a G code move plus output on off its ok when added zero x and y that's when it goes funny I just have to get the timing correct and it works fine.

there will be better ways of doing it but that's over my head at this time.

Its probable I could just do a call from a directory like you suggest, might try that any way 

1062
Mach4 General Discussion / Re: Needing help with screens
« on: December 04, 2014, 01:21:58 PM »
its in a button script

poppabear at this stage I can understand zero of what you have put I would like to learn how to do the scripting with just pointers of what to do but that's not working if I had the manual I think I would be ok.

all off your help gents is very well come and thank you for the help

1063
Mach4 General Discussion / Re: Needing help with screens
« on: December 04, 2014, 04:22:38 AM »
this is what I have ended up with so far what's commented out is because it crashes M4

-laser zero

local inst = mc.mcGetInstance();

mc.mcCntlGcodeExecute(inst, "G1 X10 Y10 F500");--run some g-code
wx.wxMilliSleep(18);  --it need to be set to this
mcState = mc.mcCntlGetState(inst);
--while (mcState ~= mc.MC_STATE_IDLE) do
--mcState = mc.mcCntlGetState(inst);
--wx.wxMilliSleep(30);
--end
mc.mcAxisSetPos(inst, 0, 0.000)
mc.mcAxisSetPos(inst, 1, 0.000)
--wx.wxMilliSleep (20)

so it looks like this so far to get it to work I have to home all first

-laser zero

local inst = mc.mcGetInstance();

mc.mcCntlGcodeExecute(inst, "G1 X10 Y10 F500");--run some g-code
wx.wxMilliSleep(18);--it needed to be set to this
mcState = mc.mcCntlGetState(inst);

mc.mcAxisSetPos(inst, 0, 0.000)
mc.mcAxisSetPos(inst, 1, 0.000)



1064
Mach4 General Discussion / Re: Needing help with screens
« on: December 03, 2014, 10:55:12 PM »
I will try in virtualmotion

1065
Mach4 General Discussion / Re: Needing help with screens
« on: December 03, 2014, 10:45:31 PM »
I am get output 5 on and off its just not zeroing x an y after move

1066
Mach4 General Discussion / Needing help with screens
« on: December 03, 2014, 09:54:41 PM »
did you try it like this did it turn your output 5 on

Code: [Select]
--Laser Zero
--Get the instance of the controller
local inst= mc.mcGetInstance();

mc.mcCntlGcodeExecute(inst, "G1 X10 Y10 F500");--run some g-code

mc.mcAxisSetPos(inst, 0, 0.000);
mc.mcAxisSetPos(inst, 1, 0.000);

--Get the out5 handle
local out5= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5);
--Output TOGGLE
 local outstate = mc.mcSignalGetState(out5);
 if (outstate == 1) then
   mc.mcSignalSetState(out5, false);
 else
   mc.mcSignalSetState(out5, true);

 end

1067
Mach4 General Discussion / Needing help with screens
« on: December 03, 2014, 09:31:40 PM »
yer should of put in what I have tried

below works with out mc.mcAxisSetPos(inst, 0, 0.000) or mc.mcMotorSetHomePos(inst,0,0); -- inst, 0= X axis , 0 = set to home anything else is counts per unit

if I add one or the other of the above codes it stops the output turning off and the axis`s don't go to zero.

I put them in after gcode execute

--Laser Zero
--Get the instance of the controller
local inst= mc.mcGetInstance();

mc.mcCntlGcodeExecute(inst, "G1 X10 Y10 F500");--run some g-code

--Get the out5 handle
local out5= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5);
--Output TOGGLE
 local outstate = mc.mcSignalGetState(out5);
 if (outstate == 1) then
   mc.mcSignalSetState(out5, false);
 else
   mc.mcSignalSetState(out5, true);

 end

1068
Mach4 General Discussion / Needing help with screens
« on: December 03, 2014, 08:17:45 PM »
thanks gents I must be missing something cant get the axis`s to zero out.

this is what I have so far.
This works
Code: [Select]
--Laser Zero
--Get the instance of the controller
local inst= mc.mcGetInstance();

mc.mcCntlGcodeExecute(inst, "G1 X10 Y10 F500");--run some g-code

--Get the out5 handle
local out5= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5);
--Output TOGGLE
 local outstate = mc.mcSignalGetState(out5);
 if (outstate == 1) then
   mc.mcSignalSetState(out5, false);
 else
   mc.mcSignalSetState(out5, true);

 end 

1069
Mach4 General Discussion / Needing help with screens
« on: December 03, 2014, 08:03:09 PM »
deep breaths

1070
Mach4 General Discussion / Needing help with screens
« on: December 03, 2014, 05:39:06 PM »
does anyone now the code to zero an axis after its moved to a position cant find any code for doing it