Hello Guest it is April 24, 2024, 02:03:57 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 - moorea21

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »
41
You were right about errors when executing movement from macros; total mayhem. Won't be doing that again...

42
General Mach Discussion / using a variable value directly in gcode
« on: May 03, 2015, 10:08:32 AM »
I'm having no luck executing movement from inside macro files, so I'm looking for an alternative to this macro.

Dim X As Double
X = GetVar(302)
Code "G00 X" & X
End

Is it possible to call up the value of the variable X in this way inside the macro, pass it to the main Gcode file, and then read and execute the 'G00 X &X' command in the Gcode itself, rather than unreliably from inside a macro? Absolute mayhem ensued when I tried more complicated moves from a macro, I'm looking to avoid all 'Code "G...."' statements if at all possible.

If not, would adding
'If IsMoving()
Wend'
before 'End' ensure that this line is executed properly before moving on?

Thanks,
M21

43
Thanks for outlining that for me, I am now warned!

The example for runscript in the manual is a bit baffling; if I want to run a script from within a macro, do I code something like this into the macro:-

RunScript(macros/Mach2mill/M4000)

or have I misread it?

44
Ok, ta. It seems like 'Wend' is the key command I didn't understand properly, I guess it means wait, rather than 'move towards' as it would have been in Olde English, if I remember right. Anyway...

Why is it a bad idea to run bits of gcode in macros? Not even thought of that being a no-no. Not much at all of my code is in macros; it just seemed to make more sense that bits of code that will get repeated on every file I run should be coded in separately, and called as needed.

Similarly, I didn't realise that calling macros from macros can be problematic. Is it unreliable or something?

45
Sorry I meant how to make the macro stop itself and wait for cyclestart to be pressed

46
When I run his macro (attached,) I wanted it to stop all activity at the statement 'DoOEMbutton(1003)', but this doesn't stop the macro call afterwards, which then executes some gcode moves when I had wanted no gcode moves...

Obviously DoOEMbutton(1003) isn't the right command to use.

What should I use instead, that will stop the macro from running (preferably as well as any gcode that's running) until I press cyclestart?

Thanks again

M21

47
Unless of course this is just something that only happens via the code window, and not when Gcode or MDI calls it?

48
Same here by MDI. But as run from vb editor window, I still get the last message only, about 'return to main program'. Hopefully (3rd attempt) I can attach my xml, is it okay  to run it with that? Thanks

49
Thanks. I didnt mention that each message has sleep 1000 after it, ie 1 second. Thought it would always hold it there for that long...

50
Attached macro works fine using F7, on run (in VB window), most messages don't appear. If I un-comment the message on 2nd to last line, no messages appear except the last one.

Can I change this behaviour?

Thanks

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »