Hello Guest it is December 26, 2024, 08:16:26 AM

Author Topic: Execution M00 for Brains  (Read 12370 times)

0 Members and 1 Guest are viewing this topic.

Re: Execution M00 for Brains
« Reply #10 on: May 10, 2023, 01:35:12 PM »

Tomas,
In this case I can't find the function to add a macro to the OEMTrigger


Hi Fred,

your code snipped will freeze the system because of your Do Loop.

you can try to use a OEMTrigger to run a macro.
how this is done i explained here:
https://www.machsupport.com/forum/index.php?topic=46414.msg293415#msg293415

but i am affraid that all this will be to slow anyhow.

without knowing exactly what the machine should do, it is very hard to think about possibilties.

Offline TPS

*
  •  2,539 2,539
Re: Execution M00 for Brains
« Reply #11 on: May 11, 2023, 02:15:40 AM »
Example:

1.assign your input in Config-> Ports & Pins -> Input Signals to OEM Trig #1 (keep the original assignment for input1)


2. Config->System hotkeys oemcodes -> external buttons OEM Code -> Trigger #1 - set 301

3. Config->General Config ->Initialisation string  M333, that means every time you reset M333.M1s is called

4. create  M333.M1s in your macro folder and add the VB code:
Code: [Select]
SetTriggerMacro(334)


so every time the OEMTrigger#1 comes True the VB Code within M334.M1S will run once.

code for M334.M1s wil be something like this

Code: [Select]
   If Oemtrigger(1) Then
      Code "M00"
      While (IsActive(Input1))
         Sleep(100)
      Wend
   End If

but as mentoined i think this will be to slow.

as Graham mentoined earlier G31 might be the right direction.

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execution M00 for Brains
« Reply #12 on: May 14, 2023, 09:03:46 PM »
Hello Tomas. how are you?
I hope it's ok. I have been trying to execute this macro and I have been able to, I have the following error, when executing the macro it says "script compile error m334", according to my deduction it is that some configuration or an error in the development of the M334... I have it exactly as I want you have developed it. When I run the macro the axes don't stop moving while the G code runs.

Kind regards,
Fred.

Offline TPS

*
  •  2,539 2,539
Re: Execution M00 for Brains
« Reply #13 on: May 15, 2023, 02:13:25 AM »
sorry, my fault:

Code: [Select]
If IsActive (OEMTRIG1) Then
      Code "M00"
      While (IsActive(Input1))
         Sleep(100)
      Wend
End If
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execution M00 for Brains
« Reply #14 on: May 15, 2023, 08:48:43 AM »
Hello Thomas, how are you again? I hope it's ok!
I'm testing the script you gave me and it seems to work correctly, that's great.
At this moment I have another problem, apparently the macro is executed when the G code finishes running, let's say; While the axes are running the coordinates this macro appears to be invalid. Maybe I did some wrong configuration...
I add that input1 is also being emulated when activating oemtrigger#1.

Thank you very much for your help, you are being very useful for me.
Kind regards,
Fred.

sorry, my fault:

Code: [Select]
If IsActive (OEMTRIG1) Then
      Code "M00"
      While (IsActive(Input1))
         Sleep(100)
      Wend
End If

Offline TPS

*
  •  2,539 2,539
Re: Execution M00 for Brains
« Reply #15 on: May 15, 2023, 12:38:42 PM »
i was affraid that this problem will come up, because code from macros is added into the queue.

so as Graham mentoined, G31 will be the road to go.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execution M00 for Brains
« Reply #16 on: May 15, 2023, 01:38:31 PM »
Is it possible to execute G31 with the pulse of input1 and pause the G code? or will it also be added to the queue?

Kind regards,
Fred.
i was affraid that this problem will come up, because code from macros is added into the queue.

so as Graham mentoined, G31 will be the road to go.

Offline TPS

*
  •  2,539 2,539
Re: Execution M00 for Brains
« Reply #17 on: May 15, 2023, 02:13:57 PM »
if you have a look in here:

http://support.machsupport.com/de/downloads/files/using-mach3-mill/download

chapter 10.7.12 explains, what G31 will do.

basicly G31 will stop movement triggered by an input signal.
it will not continue after input signal goes off again.
this wil have to be done by logic within a macro, the benfit is that the movement will
be stopped imediately.

i don't know where your GCode is coming from, but someting like a GCode "converter",
VB macro, might be the way to go.

can you post a sample GCode to see how it looks like.   
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execution M00 for Brains
« Reply #18 on: May 15, 2023, 03:52:48 PM »
Tomas, apparently the link you gave me is damaged or for something it won't let me access this information.
What do you mean by VB macro converter?
What I want to say and maybe I don't explain it well is that I need the program to pause when it detects the input signal input1, it is to prevent the gcode from continuing to play in the program until the mortiser tool is removed from the zone work, until the break is resumed. It would work very much like the MPG function... Only MPG won't be of any use to me in this case either.
Excuse my ignorance on the subject, maybe I'm still a bit fresh on this.

Kind regards,
Fred.

if you have a look in here:

http://support.machsupport.com/de/downloads/files/using-mach3-mill/download

chapter 10.7.12 explains, what G31 will do.

basicly G31 will stop movement triggered by an input signal.
it will not continue after input signal goes off again.
this wil have to be done by logic within a macro, the benfit is that the movement will
be stopped imediately.

i don't know where your GCode is coming from, but someting like a GCode "converter",
VB macro, might be the way to go.

can you post a sample GCode to see how it looks like.

Offline TPS

*
  •  2,539 2,539
Re: Execution M00 for Brains
« Reply #19 on: May 16, 2023, 02:56:53 AM »
the link downloads a file named Mach3Mill_1.84.pdf. pls check your download folder.

anyway, i do not know a possibility to pause a program by digital input.

with a vb macro converter i mean a VB macro witch reads the original GCode and
creates new program with use of G31.

that's why i asked for a sample GCode file witch will be used on the machine.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.