Hello Guest it is December 08, 2019, 04:59:36 AM

Author Topic: Creating a Probe File  (Read 6109 times)

0 Members and 1 Guest are viewing this topic.

Creating a Probe File
« on: May 15, 2014, 08:28:06 PM »
--Inspired by Nicks (Bodini) Tool table exporter
--Place under a button
--can be called from a probe input in the future development

local AXIS_X = mc.mcAxisGetMachinePos(inst,0);
local AXIS_Y = mc.mcAxisGetMachinePos(inst,1);
local AXIS_Z = mc.mcAxisGetMachinePos(inst,2);

filename = "ProbeData.txt";

file = io.open(filename,"a"); -- create new file or add to it
ProbeData = string.format("X%4.4f Y%4.4f Z%4.4f \n",AXIS_X, AXIS_Y, AXIS_Z);
file:write(ProbeData)

file:close()
« Last Edit: May 15, 2014, 08:32:18 PM by Ya-Nvr-No »

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Creating a Probe File
« Reply #1 on: May 17, 2014, 10:49:28 PM »
HIA Craig, I am working on converting a HIGH SPEED  probing routine to Mach4.

It appears that MACH4 does NOT have an internal file write to save the points to file ??

SO we have to create that part ourselves ????  BUMMER seems we are backing up here(;-)

SO in Gcode how do we save the points collected each trip to a save points file ?

In mach3 we had a Macro M40 that opened the point file and that switched on the record function inside Mach3 that wrote the points to file each trip.

IS THERE something in mach4 like that ???

(;-) TP

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Creating a Probe File
« Reply #2 on: May 17, 2014, 11:38:15 PM »
I do not see where Mach4 writes to the #var for the point on a G31 call.

#5061
#5062
#5063

SO it must not work yet ???
Re: Creating a Probe File
« Reply #3 on: May 18, 2014, 07:30:09 AM »
This code just takes the Dro values and writes them to a file, because a screen button, panel button, keyboard or modbus input can trigger an action.
Using the signal script routine, if the probe input was tripped it would write the values to the file. Crude and dirty but was an attempt of showing how you can pass DRO data to a file.

Offline ger21

*
  • *
  •  6,289 6,289
    • View Profile
    • The CNC Woodworker
Re: Creating a Probe File
« Reply #4 on: May 18, 2014, 07:43:17 AM »
Would you use something like mc.mcRegGetValue(number hReg) to get the probe trip points?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Creating a Probe File
« Reply #5 on: May 18, 2014, 08:07:38 AM »
I use it like this:
first you have to create a reg variable name and know the path
then fill it with something

    local Xval = mc.mcAxisGetPos(inst,0);
    WriteReg("iRegs0/Xvalue", Xval);

then go get it with something like this

    local hXval = mc.mcRegGetHandle(inst, "iRegs0/Xvalue");
    local Xval = mc.mcRegGetValue(hXval);

so you would have to pass the trip points into a register then read the register
« Last Edit: May 18, 2014, 08:09:14 AM by Ya-Nvr-No »

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Creating a Probe File
« Reply #6 on: May 18, 2014, 05:46:51 PM »
HIYA Brian, can you tell us what register contains the Indicator (value)  for the ProbeTrip ? I am working on a new HIGHSPEED 3d probing routine and I need to know on each G31 call if it tripped or ran to end point.

There are times IF it gets to the endpoint it is an error AND sometimes it will get to an endpoint and it is normal to the function BUT in all cases it cannot write the endpoint values as it would be False data and corrupt the point cloud.


IS there an endpoint register for the G31 call that shows what the endpoint values are ?

Thanks, (;-) TP
Re: Creating a Probe File
« Reply #7 on: May 19, 2014, 10:59:38 AM »
Just tested Probing... Worked better than expected.
I created a Button and then when pushed it called a probing.tap file that I ran with cycle start.
Did as it was coded and was fast
no more "isMoving", all seemed to get handled in the G31 move.
Liking/Lovin it  ;D


Re: Creating a Probe File
« Reply #8 on: May 19, 2014, 11:47:57 AM »
Also tested the Probe file creation file I posted above with the Signal Script in the Load Screen Script section. Added a block of code for input13, then in mach turned on the input 13 and associated to the probe input. When it was tripped it created the file and added the data. So straight forward and easy to make happen. Just takes awhile to wrap your head around the new capabilities of Mach4 :-\
Spent a lot of time throwing rocks as Terry says.

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Creating a Probe File
« Reply #9 on: May 19, 2014, 01:50:12 PM »
Ok maybe I missed something but WHY  did you have to do ANYTHING scripting wise to make probing WORK in Darwin ???

All that code must be built into Mach4 not rely on scripting to make it work.

I am close to having a new 3d routine for probing Might need you to test it.  Hard to verify some of the moves without a moving  machine where probing works. It will be a G65 macro type function where you program in the #vars to program the function.  ALL in GCODE no scripting.

(;-) TP

(;-) TP