Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Bill_O on September 28, 2018, 10:05:03 AM
-
Ok i am finally back to working on the Mach4.
I am having a problem with what i thought was a simple code.
I do not want to use the sliders for speed adjustments so i made a button to increase and one to decrease the FRO.
When i click the button the DRO flicks the change then immediately back to what it started at.
Here is the code.
local val = scr.GetProperty('droCutSpeed', 'Value');
val = tonumber(val) + 10;
local maxval = 300
if (tonumber(val) >= tonumber(maxval)) then
val = maxval;
end
scr.SetProperty('droCutSpeed', 'Value', tostring(val));
I am sure it is something simple i am missing but I have no idea what.
Thanks,
Bill
-
Bill,
There are already buttons to adjust the FRO.
But you can use the code in this post below, see if it works.
http://www.machsupport.com/forum/index.php/topic,38406.0.html
-
I will definitely look at that code.
I have other code i will need to write so if you have any idea why mine doesnt keep the change in the dro it would be helpful to me.
Bill
-
If you replace your scr.GetProperty and scr.SetProperty commands with the API calls mc.mcCntlGetFRO and mc.mcCntlSetFRO your code will work
-
Swifty,
Thanks for the assistance.
Bill