Hello Guest it is January 26, 2022, 03:28:11 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 - HeadyCS

Pages: 1 2 »
if anyone is interested and needs:

Code: [Select]
local inst = mc.mcGetInstance()
local i = 0;
while true do
local name = mc.mcCntlGetStateName(inst, i);
mc.mcCntlSetLastError(inst, "machState: "..tostring(i).." - "..tostring(name))
i = i +1;
if i > 300 then

available mach states (machState, rc = mc.mcCntlGetState(inst);):

machState: 0 - Idle
machState: 1 - Hold
machState: 2 - File:Subroutine
machState: 3 - MDI:Subroutine
machState: 4 - Jogging
machState: 5 - Dry Run
machState: 6 - Homing
machState: 7 - Config
machState: 100 - File:Run
machState: 101 - File:Run:Feed Hold
machState: 102 - File:Run:Probe
machState: 103 - File:Run:Probe:Feed Hold
machState: 104 - File:Run:Threading
machState: 105 - File:Run:Threading:Feed Hold
machState: 106 - File:Run:Feed Hold:Jog
machState: 107 - File:Run:Tapping
machState: 108 - File:Run:Macro Hold
machState: 109 - File:Run:Macro Hold:Jog
machState: 110 - File:Run:Single Block
machState: 111 - File:Run:Retract
machState: 112 - File:Run:Homing
machState: 113 - File:Run:Single Block Hold
machState: 199 - File:Run:Ending
machState: 200 - MDI:Run
machState: 201 - MDI:Run:Feed Hold
machState: 202 - MDI:Run:Probe
machState: 203 - MDI:Run:Probe:Feed Hold
machState: 204 - MDI:Run:Threading
machState: 205 - MDI:Run:Threading:Feed Hold
machState: 206 - MDI:Run:Tapping
machState: 207 - MDI:Run:Macro Hold
machState: 208 - MDI:Run:Macro Hold:Jog
machState: 209 - MDI:Run:Retract

You could try monitoring the state of the control using mcCntlGetState for when it is probing. 102 is File:Run:Probe and 202 is MDI:Run:Probe. You can then activate the output when it is either of these states.

that's exactly what I was looking for, thank you buddy.

I am looking for a way (in LUA script) to switch an output when G31 (probing) is active.

I looked into the API documentation but found no function where can query the status.

I have read the gcode variables / parameters but also found nothing.
local value = mc.mcCntlGetPoundVar (num inst, num PoundVar)
local Gvalue = mc.mcCntlGetPoundVar (inst, 10) -- G
Gvalue: 1.456e-14
local Gvalue = mc.mcCntlGetPoundVar (inst, 10) -- MOD GROUP 1 4001 // Group 1 // active G-code for motion
Gvalue: 1.0 on G1, G31 movements,

I do not know what the output digitize trigger does. So I searched at google and found this page: https://warp9td.com/index.php/faq/faq-mach4
"Digitize Trigger:  This output activates when the Probe is active with a G31/G31.x command."
I tried but there dont switches state on G31. it seems to be for SmoothStepper.

Mach4 General Discussion / Re: script changes not aplied after saving
« on: April 06, 2019, 12:17:12 PM »
Menu Operator -> Edit / Debug scripts. and change a custom m-code script in the profile / Macros folder. Changes are immediately applied in the instance after saving.

At Files in Profile / Modules folder not.

Mach4 General Discussion / script changes not aplied after saving
« on: April 06, 2019, 08:24:11 AM »
Mach4 v3804

When I make changes to Scripts with Notepad ++ and save the file via CTRL + S, they are not taken over in the current instance. m6 or other .mcs in Profile/Macro folder or .lua in Profile/Module folder.
I have to restart Mach4 so that the changes are taken over, very annoying.

In Mach4 v3481, the changes were accepted immediately after saving.

I also tried it with the Zerobrain editor via menu operator -> Edit / Debug scripts. or Open Script Editor.
Open Lua in Profile / Modules folder, make changes, save by Ctrl + S and Menu Project -> Compile show no changes in the current instance.

Thanks for sharing.

I have adapted the postprocessor. Subprograms use absolute mode now.
If it runs, the next run will show.

The program code comes from the post processor.

I tried the G82 line with different values in the Mach4 with simulation device to see what happens.
First some information:
Absolute Z 11.1 is 0.5mm above surface --> surface at 10.6
The drilling depth should be 2.15mm below the surface --> 2.65-0.5=2.15

G98 G82 X0. Y0. Z-2.65 R11.1 P5.06 F56.

This happens:
Move to absolute Z=11.1 and start drilling to absolute Z=-2.65
The drilling depth under the surface is 13.25mm

This shows Z and R are absolute values.

I add a picture of Mach4 CNC Controller Mill Programming Guide Version 1.1 Build 3775 from the Docs folder.
"In G91: Distance and direction along Z axis, from point R, to bottom of hole"
Then that does not match.

Following composition:

Milling machine 3 axes, Z+ upwards
Controller: CSMIO IP-M v3.016
Control: Mach4 v3804
CAM: Fusion 360
Postprocessor: newest Mach4 Config from Autodesk Portal: https://cam.autodesk.com/hsmposts?p=mach4mill

Code: [Select]
N1 G90 G94 G91.1 G40 G49 G17
N2 G21

N3 M5
N4 M9
N5 T3 M6
(MRKLEN_1115600600 - D6MM - SPOT DRILL)
N6 S1857 M3
N7 G54.1 P2
N8 M8
N10 G0 X8.08 Y4.075
N11 G43 Z39. H3
N12 M98 P0001
N13 G54.1 P3
N14 M8
N15 G0 X8.08 Y4.075
N16 Z39.
N17 M98 P0001

N142 M9
N143 M64 P41
N144 G04 P1.0
N145 M65 P41
N146 M30

G0 Z-10.
G98 G82 X0. Y0. Z-2.65 R-15.25 P0.06 F56.

G0 Z-10.
G98 G82 X0. Y0. Z-2.65 R-15.25 P0.06 F56.

G91: incremental mode,
G0 Z-10 .: Z moves down 10mm = absolute Z=29
G98 G82 X0. Y0. Z-2.65 R-15.25 P0.06 F56 .: Z moves with rapid traverse to absolute Z=-15.25 through the workpiece and drills up with F=56 to absoulte Z=-2.65.  ???
Correct would be: Z drive down 15.25mm and drill 2.65mm deep.
G82 values are not interpreted incrementally.

Information about G82 in the Mill GCode Programming.pdf page 57, 60 in the Docs folder.

Is it due to mach4 or the csmio controller?

Mach4 General Discussion / Define own global Variables to use in macros
« on: December 25, 2018, 04:09:47 AM »
In the "screen load script" I would like to define my own global variables and functions that are also available in macro scripts (m6).

I tried it with the following variables
myOwnVariable = 1;
mc.myOwnVariable = 1;

but in m6 script these are not available. when calling the scripts is executed up to this point and then the script aborted. I do not see any error message like "m6, line55: attempt to compare nil with string". Is there a log file in which such errors are written?

Mach4 General Discussion / Re: Homing Speed v3481
« on: March 23, 2018, 04:46:30 PM »
The answer from CS-Lab:

You have to ask ArtSoft about this.

If they add to Mach4 settings for driving speed from a switch then we will adapt to it.


Pages: 1 2 »