Hello Guest it is April 23, 2024, 06:07:25 AM

Author Topic: macro for start  (Read 3826 times)

0 Members and 1 Guest are viewing this topic.

macro for start
« on: March 23, 2014, 05:06:07 AM »

hi to all
I frequent this forum just because I have to use the translator.
asking for your help to make a macropump.
I would make sure that when I push the start button, the machine starts to work only when it sees the signal input#1 ... (#2 or#3 etc etc)
Thank you.


http://www.cncitalia.net/forum/viewtopic.php?f=25&t=24799&start=135

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for start
« Reply #1 on: March 23, 2014, 05:45:04 AM »
This is one I use in the Start button on my big lathe. It is looking for the inputs from spindle enable/disable switch and also the headstock low/high gear ranges.

If GetInput(23) And (GetInput(10) Or GetInput(11)) Then 'look at modbus inputs
DoOemButton(1000) ' if inputs are seen  Start
Else
DoOemButton(1003) ' if inputs not seen   Stop
MsgBox("Engage Headstock or Enable Spindle") ' pop up message box telling me whats wrong
End
End If     

The Inputs I am using are Modbus inputs so if you were to be using the normal inputs in Mach you would use IsActive(Input1) etc instead of GetInput()

As said the script above is in the actual start button, to do that you open the screenset in one of the screen designers and change the start button to a VB button. Once back in Mach you can go to the Operator menu then Edit Button Scripts and you will then see the Start flashing, click it and the editor will open which will allow you to type in your VB script.
Hood
Re: macro for start
« Reply #2 on: March 23, 2014, 09:37:29 AM »
good day Hood
you always have solutions to everything.
Now I try to implement this macro then I'll let you know if I will succeed.
Thank you very much for the availability and expertise.
regards
  moreno
Re: macro for start
« Reply #3 on: March 23, 2014, 07:16:26 PM »
I implemented the macro editing the start button.
does not work as I want.
my aim is to start the cycle only when the spindle has reached the idle speed.
then, when I push start if the input is not active must wait for the signal
input, after which the cycle can start.
Do you think you could do?
thanks
moreno

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for start
« Reply #4 on: March 23, 2014, 09:20:46 PM »
Ah Ok, well depending how your spindle is started the Start button may not be the way to do it.
If you spindle is started from the G Code then likely the best way would be to alter the M3 macro.
Something like this in the M3 macro should do what you want.

DoSpinCW()
Do
Message " waiting for spindle to reach speed"
If IsActive (Input1) Then Exit Do
Sleep 10
Loop
Message"Spindle at speed"


Hood
Re: macro for start
« Reply #5 on: March 24, 2014, 04:42:26 AM »
Your observation is correct
Now I run this test then let you know.
thanks again
regards
moreno
Re: macro for start
« Reply #6 on: March 24, 2014, 05:06:49 AM »
I implemented the macro M3
now it works fine.
thank you
good day
moreno

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for start
« Reply #7 on: March 24, 2014, 05:59:02 AM »
Glad it helped :)
Hood