reading the active axis from UCR201 in a macro..

If you have a question about the software please ask it here.

reading the active axis from UCR201 in a macro..

Postby cahit » Tue Nov 20, 2018 4:19 am

hi support team,

is it posibile to read the active field in the UCR201 like X Y or Z is selected. because i want to write a macro to devide it by 2.
example X is selected at the UCR201 , if i write a macro M20000 and assign it to F4 then X axis has to be halved (/2) hapens.

regarsd

cahit
cahit
 
Posts: 73
Joined: Thu Jun 09, 2016 6:27 pm
Location: the Netherlands

Re: reading the active axis from UCR201 in a macro..

Postby dezsoe » Tue Nov 20, 2018 8:38 am

Hi Cahit,

The UCR200 and UCR201 selects the axis by pressing the buttons on the jog screen. There are LEDs to show which axis is selected: 155 to 160 as X to C.
dezsoe
 
Posts: 2056
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: reading the active axis from UCR201 in a macro..

Postby cahit » Tue Nov 20, 2018 3:30 pm

Hi Dezsoe,

i found this solution for onliy F1 button on UCR201


//--------------------------------------------------------------------------------------------
//M20000, divide the xaxis or yaxis by 2 in combination with USR201
double xvalue;
double yvalue;

yvalue = Convert.ToDouble(AS3.Getfield(227)) / 2;
xvalue = Convert.ToDouble(AS3.Getfield(226)) / 2;


if (AS3.GetLED(155)==true){
exec.Code ("G00 X " + xvalue);
while(exec.IsMoving())
{
exec.Wait(200);
}
}

if (AS3.GetLED(156)==true){
exec.Code ("G00 Y " + yvalue);
while(exec.IsMoving())
{
exec.Wait(200);
}
}
//--------------------------------------------------------------------------------------------


thanks regards

cahit
cahit
 
Posts: 73
Joined: Thu Jun 09, 2016 6:27 pm
Location: the Netherlands


Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 8 guests