Hello Guest it is March 29, 2024, 04:19:30 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 - rrc1962

31
Mach4 General Discussion / CntlGcodeExecuteWait inside macro
« on: April 22, 2017, 09:53:08 AM »
Duplicate post.  Sorry about that.

32
Mach4 General Discussion / mcCntlGcodeExecuteWait Inside a macro
« on: April 22, 2017, 09:16:42 AM »
So unless I'm mistaken, this doesn't work.  I'm noticing that when inside a macro, it doesn't "wait".  I think I have a plane to address this bit was hoping y'all could tell me if I'm headed down the right path.  Here's what the macro looks like...

Collect some data
Build a block of GCode
Execute GCode
----------------------------------------
Do some other stuff inside the macro
----------------------------------------
Build another block of GCode
Execute GCode
End macro

So here's the plan...

Run this as a function in a coroutine.  Call it co1...
---Collect some data
---Build a block of GCode
---Execute GCode

Run this as another function in a coroutine.  Call it co2...
---Build another block of GCode
---Execute GCode

Then basically....

Coroutine.resume(co1)
While coroutine.status(co1) == 'Running' do
  Set error message
End

Do other stuff within the macro

Coroutine.resume(co2)
While coroutine.status(co2) == 'Running' do
  Set error message
End

Last block of GCode should be done.  Exit the macro and move to next line in the program.

So my only concern is where to put the 2 function.  If mcCntlGcodeExecuteWait won't work inside a macro, then they will have to be elsewhere.  Seems that even for the couroutine to work, it will need to wait for the Gcode within to execute before returning.  So how about a module?  Will mcCntlGcodeExecuteWait work inside a module?

How about using mcCntlIsStill() instead of coroutines?




33
Mach4 General Discussion / Re: Which is faster?
« on: April 17, 2017, 05:04:18 PM »
I thought that would be the case.  Thanks for confirming.

34
Mach4 General Discussion / mc.mcToolPathGenerate()
« on: April 17, 2017, 05:03:36 PM »
Is there something behind the scenes that prevents this function from executing during a program run?  I have a macro that I want to call that moves X and Y to a specific location, then zeros the DRO's, re-paints the toolpath display and continues on.  Everything works, but the toolpath display doesn't regenerate when mc.mcToolPathGenerate(inst) is called.

Thanks

35
Mach4 General Discussion / Which is faster?
« on: April 16, 2017, 01:57:58 PM »
Lets say you have a macro that collects a lot of data from the operator screen.  Would execution time be faster using mcProfileGetString() or mcCntlGetPountVar()?

If mcCntlGetPountVar() is faster, I can load the pound vars with screen data in another macro where execution time isn't so critical.  If there is no noticeable difference, then it's not worth dealing with.  I'm not having a problem, just wondering which way would be faster.  Faster is better.

Thanks

36
Mach4 General Discussion / Ignore M Calls While Loading
« on: April 16, 2017, 12:32:49 PM »
Is there a setting for this like there is in M3?  If not, is there a function like "IsLoading()" that I can use in the macros that I don't want to run while loading?

Thanks

37
Mach4 General Discussion / Re: G52 strange behaviour
« on: April 15, 2017, 07:34:54 AM »
Interesting.  I'll try changing the Gcode to lower case "m".  The function names inside the macro code are all lower case.  Thanks.

38
Mach4 General Discussion / Re: G52 strange behaviour
« on: April 14, 2017, 08:17:50 PM »
I made a little progress.  The issue is with an M code.  M1105.  When I execute it from MDI it sets the work offsets to X1Y1, but when I run it from the editor it works fine.  I ran into this before where I changed an M code and even though the correct version always came up in the editor, M4 wouldn't let go of the original version.  I had to copy the code to a new M code that had never been used.  Probably have to do the same here, unless there is a way to let M4 know that it needs to let go of the old version.

I think way back when I first started messing with M4, I wrote some M codes to test the waters.  This was one of them.  I wrote one to apply an offset (M1105) and one to set the offset back to zero (M1106).  I've since re-wrote both of those M codes.  M110 works great, but M4 won't recognize the changes to M1105.

39
Mach4 General Discussion / G52 strange behaviour
« on: April 14, 2017, 07:46:03 PM »
If I go to MDI and enter G52X2Y2 the G92 work offset reflects that.  If I enter G52X0Y0, the G92 offsets go back to zero.  Here's the strange part.  When I run the code below, the G92 work offsets end up at X1 Y1 and the only way I can get it back to normal is to restart M4.  There is nothing in any of the other M codes causing this.  If I remove both instances of the G52, the problem goes away.

I also tried G92 with the same results.  Is there a setting somewhere in M4 telling it to go to X1Y1 at the end of a program?

Code: [Select]
G20
G90
G91.1
M1000
G52X2Y2
G00 X9.44 Y4.97
M114 A0 B100
M1101
G01 X9.94 Y4.97
G02 I-4.97 J0
M115 A0
M01
G52X0Y0
M1105
G00 X0 Y0
M30
%


40
Mach4 General Discussion / Re: Reading text box on screen
« on: April 11, 2017, 07:40:21 PM »
Licence is still good.  Another install I have that is not licenced says Demo at the top.  Also says Unlicenced on the about screen.