Hello Guest it is April 19, 2024, 08:20:41 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 - stirling

41
General Mach Discussion / Re: Read and write to Z DRO?
« on: October 08, 2016, 08:02:32 AM »
you can call as many macros from macros as you want (except in very old versions of Mach). But just be aware they all run in their own concurrent threads and are therefore asynchronous. Any synchronization required is up to you to code.

USER DROs are accessible from gcode (in a somewhat flaky sort of way) but (AFAIK) OEM DROs are not.

Jogging is possible during any macro assuming the macro takes long enough to allow it.

42
OEMTRIGGER1 is not a valid signal name. It's OEMTRIG1.

see http://www.machsupport.com/Mach3Wiki/index.php?title=VB_Constants_for_Signal_Names for all the valid signal constants.

Also see http://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf

Note that the systemWaitFor documentation is wrong in that it says OUTPUTS where it should say INPUTS.

43
systemWaitFor works for ALL input signals. It has nothing to do with LED states.

44
systemWaitFor waits on an input signal going active. getOEMLED returns a boolean. The integer casts of boolean are 0 and -1.

You are therefore waiting on either 0 or -1 depending on what getOEMLED returns when it's called. 0 is the DIGTRIGGER output and -1 doesn't exist as either an input or an output.

45
General Mach Discussion / Re: Run a macro from a button press??
« on: September 29, 2016, 11:09:04 AM »
If you suspect issues with the init string macro, then the simple way to TRY it is just to set your ports and pins for trigger1 and then set 301 as the OEM code in hotkeys. Then just do the setOEMTrigger 889 in the CB editor. At that point you can test your trigger.

The only reason for putting the trigger config macro in the init string is so that it's set each time you start Mach.

If that works THEN do the init string macro.

re: editing the macropump macro: There should be no issue because the macropump macro is compiled (as opposed to "regular" macros/scripts which are interpreted). The compilation is done when you start Mach so the edited version means nothing until you re-start Mach. i.e. there's no issue with you over writing it as it's running if that's what you're wondering.

You must have had an error in your macro that you called from the init string.
When I wrote the above info two years ago, it worked.

Absolutely agree. It works here now and it worked when I wrote this 6 years ago.  :P

http://www.machsupport.com/forum/index.php/topic,15120.msg101160.html#msg101160

46
General Mach Discussion / Re: Run a macro from a button press??
« on: September 29, 2016, 08:04:45 AM »
up to you - but I'd use a trigger - made for the job.

47
General Mach Discussion / Re: Run a macro from a button press??
« on: September 29, 2016, 07:23:38 AM »
OK - for that length of time and given that you only run it when no other gcode is happening, a trigger macro would be better. The problem is that you're going to be blocking the macropump. Does it matter? well - depends if you have anything else in it and how Mach will like having it blocked.

48
General Mach Discussion / Re: Run a macro from a button press??
« on: September 29, 2016, 04:58:36 AM »
Just one potential gotcha. You haven't said (or I missed it) what your M889 macro actually does.

How long does it take to execute?

49
General Mach Discussion / Re: Run a macro from a button press??
« on: September 29, 2016, 04:35:31 AM »
Gonna have a poke of fun with you here Dave - but it's all done in the best possible taste  ;D

When you built your magnificent traction engines - did you have to follow any instructions? or did you just make it up as you went along?

runScript (as clearly stated in the manual) requires a fully qualified filename which is relative to the Mach install directory.

so... cutting to the chase - try this: (it works just fine here with your version of Mach3)

Code: [Select]
Const script As String = "M889"
'note: script does NOT have to be an M code

If isActive(INPUT1) Then
  If runScript("macros\" & GetActiveProfileName() & "\" & script) < 0 Then
    message "runScript failed"
  End If
End If

Note that I'm assuming you put your M889 in the macros directory for your current profile. But note that a script is NOT a macro (M code) so you can put it wherever you like.

50
General Mach Discussion / Re: Run a macro from a button press??
« on: September 27, 2016, 04:37:04 AM »
See bottom of page 67 in Mach3_V3.x_Macro_Prog_Ref.pdf

Your version should be fine. Time to post your code.