Differenz of API between macroloop and plugin API

Post anything you want to discuss with others about the software.

Differenz of API between macroloop and plugin API

Postby hekav » Wed Jul 24, 2019 2:29 pm

Hello

I'm in progress of porting my self made MPG from Mach3 to UCCNC.
I started writing some macroloops and they are working fine. I realized for certain
functions I need a plugin.

Now i have the problem that i cannot access button states form the Jog Window:

Here a example:
In the macro i coded

Code: Select all
// x achse selected
if (AS3jog.Getbuttonstate(220)){
  LEDS |=   MASK_X;
}else{
  LEDS &=  ~MASK_X;

and it works fine

in the plugin loop i coded
Code: Select all
// x achse selected
if (UC.Getbuttonstate(220))
     {
         LEDS |= MASK_X;
     }
     else
      {
         LEDS &= ~MASK_X;
       }


UC.Getbuttonstate(220) always returns false if the button is pressed or not

My questions:
how can I access this button state from the jog window in a plugin?
Is there a document of the differences between macro interface and plugin interface.

Helmut
hekav
 
Posts: 2
Joined: Wed Jul 24, 2019 1:59 pm

Re: Differenz of API between macroloop and plugin API

Postby Dan911 » Wed Jul 24, 2019 10:26 pm

Use...
UC.Getbutton(220)
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Differenz of API between macroloop and plugin API

Postby hekav » Thu Jul 25, 2019 6:42 pm

hello,

thanks for the info.

since the button is a toggle button I need its STATE, not the info when it is pressed.
This is what the function Getbuttonstate() is for and it works in a macro. Way not in a plugin? Is this a bug?

The Documentation says;
Getbutton() Function: bool Getbutton( int buttonumber ) Description: This function returns true if the button is being pressed on the screen OR via an input trigger and returns false if the button is released. Example: while(!AS3.Getbutton(128)); //Waits for the cycle start button press on the main screen.


If an other function change the state of the button I would not recognize it .

Helmut
hekav
 
Posts: 2
Joined: Wed Jul 24, 2019 1:59 pm

Re: Differenz of API between macroloop and plugin API

Postby Dan911 » Fri Jul 26, 2019 12:59 am

hekav wrote:hello,

thanks for the info.

since the button is a toggle button I need its STATE, not the info when it is pressed.


Both these "Functions" are get/set button bools and are going to return neither true or false, I find it fun to explore. Your right.... best to follow manual
and sorry for bad info.

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Differenz of API between macroloop and plugin API

Postby dezsoe » Fri Jul 26, 2019 5:44 am

Use LED 155 to get if the X is selected for MPG. All the bi-state buttons on the jog screen have their LEDs to check.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 27 guests