Changing Pulley Selection with a button
Posted: Fri Sep 04, 2020 12:34 am
I'm trying to set up buttons to change between my two pulley options and also change the encoder PPR at the same time. (The PPR part is working fine. Dezsoe hooked me up almost 2 years ago... http://cncdrive.com/forum/viewtopic.php?f=4&t=1608 Where does the time go?)
For the pulley, I'm using the setfield for pulley number, but when I press the "apply" button or callbutton(168), the pulley selection goes back to the previous setting. I'm thinking that I need to call "M215 P1" or "M215 P2" from the button macro, but I'm not sure how to call a macro from a macro.
For the pulley, I'm using the setfield for pulley number, but when I press the "apply" button or callbutton(168), the pulley selection goes back to the previous setting. I'm thinking that I need to call "M215 P1" or "M215 P2" from the button macro, but I'm not sure how to call a macro from a macro.
- Code: Select all
AS3.Switchbutton(true, 20055);
AS3.SetLED(true, 455);
AS3.Setfield(1,2013); // Sets pulley number to 1
AS3.Switchbutton(false, 20056); //this turns off the other button that sets the pulley number to 2
AS3.SetLED(false, 456);
AS3.Setfield(113, 864); // set new value into field 864
AS3.Validatefield(864); // Validate
exec.Callbutton(168); // Apply settings