Dro on screen and macroloop
Posted: Sun Sep 18, 2022 11:51 pm
Hello
I have been trying to get this piece of code to work.
This is going to be a tool changer script but i cant get out of the barn
first i need a dro on the screen. I went into screen editor and made this
Then i made a Macro. Actually i recieved some help and didnt write the macro
I tried very hard to make it work.
It is saved as m20800
while(loop)
{
int toolno = Getfield(20800); // Get current value of field
if GetLED(503); // If the LED for the sensor input is active...
{
SetLED(true,504);
toolno = toolno + 1; // When the sensor is triggered, add 1 to the tool number.
AS3.Setfield( toolno, 20800);
AS3.Validatefield (20800);
}
Thread.Sleep(50);
}
The goal is to have the dro count one when led 503 goes on.
Instead all i get is a compiler error.
here is where I am lost.
1st what number should the field for this type of dro be?
The number cannot be a defined field as far as I know. and that means user number. I have read nothing to suggest what that range is or should be
Do I name the macro the same number as the dro ?
I have tried many different combinations with no progress.
All I get is
UCCNC macro compiler error log file
--------------------------------------
Last error dated: 9/18/2022 9:39:13 AM
In macro: M30000
--------------------------------------
CS1003 | in line: 19 | error text: Syntax error, '(' expected
CS1026 | in line: 19 | error text: ) expected
not one thing i have done has made this go away. Please help
Thank you
Mark
I have been trying to get this piece of code to work.
This is going to be a tool changer script but i cant get out of the barn
first i need a dro on the screen. I went into screen editor and made this
Then i made a Macro. Actually i recieved some help and didnt write the macro
I tried very hard to make it work.
It is saved as m20800
while(loop)
{
int toolno = Getfield(20800); // Get current value of field
if GetLED(503); // If the LED for the sensor input is active...
{
SetLED(true,504);
toolno = toolno + 1; // When the sensor is triggered, add 1 to the tool number.
AS3.Setfield( toolno, 20800);
AS3.Validatefield (20800);
}
Thread.Sleep(50);
}
The goal is to have the dro count one when led 503 goes on.
Instead all i get is a compiler error.
here is where I am lost.
1st what number should the field for this type of dro be?
The number cannot be a defined field as far as I know. and that means user number. I have read nothing to suggest what that range is or should be
Do I name the macro the same number as the dro ?
I have tried many different combinations with no progress.
All I get is
UCCNC macro compiler error log file
--------------------------------------
Last error dated: 9/18/2022 9:39:13 AM
In macro: M30000
--------------------------------------
CS1003 | in line: 19 | error text: Syntax error, '(' expected
CS1026 | in line: 19 | error text: ) expected
not one thing i have done has made this go away. Please help
Thank you
Mark