Page 1 of 1

MACROLOOP CONFIGURATION

PostPosted: Tue Jan 17, 2023 11:13 pm
by shakil1740
Hello ,
I'm trying to connect this MPG PENDANT with some extra buttons added and directly hard wired to the input port #1 of UC300ETH_5LPT

MPG.jpg


and following codes works perfectly fine, while I run in Macroloop configuration window with "AUTO RUN"
option enable.

Code: Select all
// M20226 MPG-PANDENT MACRO

//********************ALL INPUTS ARE ACTIVE LOW ******************************************//

  while(exec.IsMoving()){}    // DO NOTHING UNTILL SYSTEM COMES TO IDLE

// DESABLE X,Y,Z
      if((AS3.GetLED(2) == true) && (AS3.GetLED(3) == true)     // IF NO AXIS SELECTED
      && (AS3.GetLED(4) == true))   exec.Callbutton(225);       //  C-AXIS

// SELECT AXIS
       if(AS3.GetLED(2) != true)   exec.Callbutton(220);        //  X-AXIS
       if(AS3.GetLED(3) != true)   exec.Callbutton(221);        //  Y-AXIS
       if(AS3.GetLED(4) != true)   exec.Callbutton(222);        //  Z-AXIS


//SELECT M/C OR W/C CO-ORDINATE
      if((AS3.GetLED(13) == true) &&                            // RIGHT WHITE TOGAL  OFF 
     (AS3.GetLED(62) == true))     exec.Callbutton(197);       //  W/C ON                                                                                           
      else
      if((AS3.GetLED(13) != true) &&                            // RIGHT WHITE TOGAL  ON
      (AS3.GetLED(62) != true))     exec.Callbutton(197);       //  M/C ON

// SELECT MPG MODES
       if(AS3.GetLED(9) == true){                               // RED SWITCH OFF
        if(AS3.GetLED(5) != true)   exec.Callbutton(226);       // X1   = MPG CONT MODE
        if(AS3.GetLED(6) != true)   exec.Callbutton(227);       // X10  = MPG SINGLE MODE
        if(AS3.GetLED(7) != true)   exec.Callbutton(228);       // X100 = MPG MULTI MODE
      }   

// SELECT X1,X10,X100
       if(AS3.GetLED(9) != true){                               // RED SWITCH ON
         if(AS3.GetLED(5) != true)   exec.Callbutton(164);      // X1 
         if(AS3.GetLED(6) != true)   exec.Callbutton(165);      // X10
         if(AS3.GetLED(7) != true)   exec.Callbutton(166);      // X100
      }

//************************END OF FILE******************************


MACROLOOP.PNG


Now I would like a custom toggle button on the screen some where, that can RUN or STOP this macro without opening the Macroloop configuration window (Button # 532) .

I tried this according to the manual but don't work

Code: Select all
  while(loop)
  {
    //The macro code is executed here...
   Thread.Sleep(50);
  }


So my question is what are the button codes or C# commands for RUN and STOP buttons in the Macroloop configuration window,

Please help. and thanks in advance.

Re: MACROLOOP CONFIGURATION

PostPosted: Sat Jan 21, 2023 8:15 pm
by Battwell
connect the side button- configure it as an led. (use as enable button. i dont see the point of using for work/machine co ordinates as they are both on the screen)
(press button to use the mpg. not pressed ignore the whole macro)

something like
if (AS3.GetLED(500) ) // mpg is on?
{

macroloop code here

}