Hello Guest it is April 23, 2024, 07:00:49 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.


Topics - rrc1962

Pages: « 1 2 3 4 5 6 7 8 9 10 11 »
11
Mach4 General Discussion / List of Inputs and Outputs
« on: April 28, 2017, 04:56:56 PM »
Some of them like mc.OSIG_OUTPUT2, mc.OSIG_OUTPUT3, etc. are easy, but others like the output for Soft Limits are not so intuitive.  Is there a list of inputs and outputs? 

Thanks


12
Mach4 General Discussion / Reverse Run
« on: April 25, 2017, 01:20:24 PM »
Has reverse run been impemented in M4?  I don't see a function in the documentation or button action for it.

Thanks

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

14
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?




15
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

16
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

17
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

18
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
%


19
Mach4 General Discussion / Reading text box on screen
« on: April 10, 2017, 04:56:21 PM »
I'm having some diffiuclty with this.  I'm doing this numerous times with DRO's, but the text box seems to be an issue.  This is how I'm doing it with DRO's and it works great.  I figured the same approach would work with text boxes....

First, I save the text box value in the On Modify Script like this...

Code: [Select]
local inst = mc.mcGetInstance()
local val = scr.GetProperty("twFileName", "Value")
mc.mcProfileWriteString(inst, "PersistentDROs", "twFileName", string.format (val))

Then inside a Lua module, I try to read the value like this.  The code executes, but always returns "Error", which I'm assuming means that it's not finding the key value.

Code: [Select]
----------------------------------------------------------------
-- Get parameters
----------------------------------------------------------------
function getParam(key)
    local inst = mc.mcGetInstance()
    local theParam = mc.mcProfileGetString(inst,'PersistentDROs',key,'Error')
    return theParam
end
----------------------------------------------------------------
-- Display file name to dialog
----------------------------------------------------------------
function TW.ShowFileName()
    f = getParam('twFileName')
    wx.wxMessageBox(f)  
end

I can do this in a button event script as well, but I wasn't able to read the text box value there either.  Any idea what I'm doing wrong?  This works fine with DRO's.

Thanks

20
Mach4 General Discussion / Refreshing a module
« on: June 18, 2016, 09:39:18 PM »
It seems that when M4 loads, it compiles modules into memory.  When I make a change to a module, I have to shut down M4 and restart to see the change.  Is there something I can add or do that will refresh the module without restarting M4? 

Thanks

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